biomedisa 25.6.1__py3-none-any.whl → 25.7.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- biomedisa/features/biomedisa_helper.py +36 -20
- biomedisa/features/keras_helper.py +1 -1
- biomedisa/features/random_walk/pyopencl_large.py +1 -1
- biomedisa/features/random_walk/pyopencl_small.py +3 -3
- {biomedisa-25.6.1.dist-info → biomedisa-25.7.1.dist-info}/METADATA +4 -3
- {biomedisa-25.6.1.dist-info → biomedisa-25.7.1.dist-info}/RECORD +9 -9
- {biomedisa-25.6.1.dist-info → biomedisa-25.7.1.dist-info}/WHEEL +0 -0
- {biomedisa-25.6.1.dist-info → biomedisa-25.7.1.dist-info}/licenses/LICENSE +0 -0
- {biomedisa-25.6.1.dist-info → biomedisa-25.7.1.dist-info}/top_level.txt +0 -0
@@ -32,6 +32,7 @@ from biomedisa.features.amira_to_np.amira_helper import amira_to_np, np_to_amira
|
|
32
32
|
from biomedisa.features.nc_reader import nc_to_np, np_to_nc
|
33
33
|
from tifffile import imread, imwrite
|
34
34
|
from medpy.io import load, save
|
35
|
+
from skimage import io
|
35
36
|
import SimpleITK as sitk
|
36
37
|
from PIL import Image
|
37
38
|
import numpy as np
|
@@ -67,23 +68,26 @@ def welford_mean_std(arr):
|
|
67
68
|
|
68
69
|
# determine all values and their count from an array
|
69
70
|
def unique(arr, return_counts=False):
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
71
|
+
if np.issubdtype(arr.dtype, np.integer) and np.all(arr >= 0):
|
72
|
+
try:
|
73
|
+
arr = arr.ravel()
|
74
|
+
counts = np.zeros(np.amax(arr)+1, dtype=int)
|
75
|
+
@numba.jit(nopython=True)
|
76
|
+
def __unique__(arr, size, counts):
|
77
|
+
for k in range(size):
|
78
|
+
counts[arr[k]] += 1
|
79
|
+
return counts
|
80
|
+
counts = __unique__(arr, arr.size, counts)
|
81
|
+
labels = np.where(counts)[0]
|
82
|
+
if return_counts:
|
83
|
+
return labels, counts[labels]
|
84
|
+
else:
|
85
|
+
return labels
|
86
|
+
except Exception as e:
|
87
|
+
print(f"Error: {e}")
|
88
|
+
return None
|
89
|
+
else:
|
90
|
+
return np.unique(arr, return_counts=return_counts)
|
87
91
|
|
88
92
|
# create a unique filename
|
89
93
|
def unique_file_path(path, dir_path=biomedisa.BASE_DIR+'/private_storage/'):
|
@@ -273,6 +277,10 @@ def recursive_file_permissions(path_to_dir):
|
|
273
277
|
except:
|
274
278
|
pass
|
275
279
|
|
280
|
+
def natural_key(string):
|
281
|
+
# Split the string into parts of digits and non-digits
|
282
|
+
return [int(s) if s.isdigit() else s.lower() for s in re.split(r'(\d+)', string)]
|
283
|
+
|
276
284
|
def load_data(path_to_data, process='None', return_extension=False):
|
277
285
|
|
278
286
|
if not os.path.exists(path_to_data):
|
@@ -354,7 +362,7 @@ def load_data(path_to_data, process='None', return_extension=False):
|
|
354
362
|
file_names = []
|
355
363
|
img_slices = []
|
356
364
|
header = []
|
357
|
-
files.sort()
|
365
|
+
files.sort(key=natural_key)
|
358
366
|
for file_name in files:
|
359
367
|
if os.path.isfile(file_name):
|
360
368
|
try:
|
@@ -362,8 +370,16 @@ def load_data(path_to_data, process='None', return_extension=False):
|
|
362
370
|
file_names.append(file_name)
|
363
371
|
img_slices.append(img)
|
364
372
|
header.append(img_header)
|
365
|
-
except:
|
366
|
-
|
373
|
+
except RuntimeError as e:
|
374
|
+
# Check for 64-bit TIFF error
|
375
|
+
if "Unable to read tiff file" in str(e) and "64-bit samples" in str(e):
|
376
|
+
try:
|
377
|
+
img = io.imread(file_name)
|
378
|
+
file_names.append(file_name)
|
379
|
+
img_slices.append(img)
|
380
|
+
header.append(None)
|
381
|
+
except:
|
382
|
+
pass
|
367
383
|
|
368
384
|
# get data size
|
369
385
|
img = img_slices[0]
|
@@ -1643,7 +1643,7 @@ def predict_segmentation(bm, region_of_interest, channels, normalization_paramet
|
|
1643
1643
|
if bm.return_probs and not load_blockwise:
|
1644
1644
|
probabilities = scale_probabilities(final)
|
1645
1645
|
if bm.scaling:
|
1646
|
-
probabilities = img_resize(probabilities, z_shape, y_shape, x_shape)
|
1646
|
+
probabilities = img_resize(probabilities, z_shape, y_shape, x_shape, interpolation=cv2.INTER_LINEAR)
|
1647
1647
|
if np.any(region_of_interest):
|
1648
1648
|
min_z,max_z,min_y,max_y,min_x,max_x,original_zsh,original_ysh,original_xsh = region_of_interest[:]
|
1649
1649
|
tmp = np.zeros((original_zsh, original_ysh, original_xsh, nb_labels), dtype=np.float32)
|
@@ -259,7 +259,7 @@ def walk(comm, raw, slices, indices, nbrw, sorw, blockmin, blockmax,
|
|
259
259
|
# allocate device memory or use subdomains
|
260
260
|
memory_error = False
|
261
261
|
subdomains = False
|
262
|
-
if zsh * ysh * xsh > 42e8 or platform.split('_')[-1] == 'GPU':
|
262
|
+
if zsh * ysh * xsh > 42e8:# or platform.split('_')[-1] == 'GPU':
|
263
263
|
if zsh * ysh * xsh > 42e8:
|
264
264
|
print('Warning: Volume indexes exceed unsigned long int range. The volume is splitted into subdomains.')
|
265
265
|
else:
|
@@ -98,9 +98,9 @@ def _walk_on_current_gpu(raw, slices, allLabels, indices, nbrw, sorw, name, ctx,
|
|
98
98
|
segment_cl = cl.Buffer(ctx, mf.READ_ONLY | mf.COPY_HOST_PTR, hostbuf=np.int32(0))
|
99
99
|
|
100
100
|
# block and grid size
|
101
|
-
#block = (1,
|
102
|
-
#x_grid = ((xsh //
|
103
|
-
#y_grid = ((ysh //
|
101
|
+
#block = (1, 16, 16)
|
102
|
+
#x_grid = ((xsh // 16) + 1)*16
|
103
|
+
#y_grid = ((ysh // 16) + 1)*16
|
104
104
|
#grid = (slshape, y_grid, x_grid)
|
105
105
|
|
106
106
|
block = None
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: biomedisa
|
3
|
-
Version: 25.
|
3
|
+
Version: 25.7.1
|
4
4
|
Summary: Segmentation of 3D volumetric image data
|
5
5
|
Author: Philipp Lösel
|
6
6
|
Author-email: philipp.loesel@anu.edu.au
|
@@ -37,13 +37,14 @@ Dynamic: license-file
|
|
37
37
|
Biomedisa (https://biomedisa.info) is a free and easy-to-use open-source application for segmenting large 3D volumetric images such as CT and MRI scans, developed at [The Australian National University CTLab](https://ctlab.anu.edu.au/). Biomedisa's smart interpolation of sparsely pre-segmented slices enables accurate semi-automated segmentation by considering the complete underlying image data. Additionally, Biomedisa enables deep learning for fully automated segmentation across similar samples and structures. It is compatible with segmentation tools like Amira/Avizo, ImageJ/Fiji, and 3D Slicer. If you are using Biomedisa or the data for your research please cite: Lösel, P.D. et al. [Introducing Biomedisa as an open-source online platform for biomedical image segmentation.](https://www.nature.com/articles/s41467-020-19303-w) *Nat. Commun.* **11**, 5577 (2020).
|
38
38
|
|
39
39
|
## Hardware Requirements
|
40
|
-
+ One or more NVIDIA GPUs
|
40
|
+
+ One or more NVIDIA, AMD, or Intel GPUs
|
41
41
|
|
42
42
|
## Installation (command-line based)
|
43
43
|
+ [Ubuntu 22/24 + Smart Interpolation](https://github.com/biomedisa/biomedisa/blob/master/README/ubuntu_interpolation_cli.md)
|
44
44
|
+ [Ubuntu 22/24 + Deep Learning](https://github.com/biomedisa/biomedisa/blob/master/README/ubuntu_deeplearning_cli.md)
|
45
45
|
+ [Ubuntu 22/24 + Smart Interpolation + Deep Learning](https://github.com/biomedisa/biomedisa/blob/master/README/ubuntu_cli.md)
|
46
|
-
+ [Windows
|
46
|
+
+ [Windows (WSL) + Smart Interpolation + Deep Learning ("advanced")](https://github.com/biomedisa/biomedisa/blob/master/README/windows_wsl.md)
|
47
|
+
+ [Windows 10/11 + Smart Interpolation (NVIDIA, AMD, Intel) ("simple")](https://github.com/biomedisa/biomedisa/blob/master/README/windows_interpolation.md)
|
47
48
|
|
48
49
|
## Installation (3D Slicer extension)
|
49
50
|
+ [Ubuntu 22/24](https://github.com/biomedisa/biomedisa/blob/master/README/ubuntu_slicer.md)
|
@@ -10,12 +10,12 @@ biomedisa/features/PredictDataGeneratorCrop.py,sha256=HF5tJbGtlJMHr7lMT9IiIdLG2C
|
|
10
10
|
biomedisa/features/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
11
11
|
biomedisa/features/active_contour.py,sha256=FnPuvYck_KL4xYRFqwzm4Grdm288EdlcLFt88E0OtqA,17938
|
12
12
|
biomedisa/features/assd.py,sha256=q9NUQXEoA4Pi3d8b5fmys615CWu06Sm0N9-OGwJOFnw,6537
|
13
|
-
biomedisa/features/biomedisa_helper.py,sha256=
|
13
|
+
biomedisa/features/biomedisa_helper.py,sha256=6VP45eaI0q2t6rmU4mF6tsvZVB0VU0lZfs96j7GZQSQ,35184
|
14
14
|
biomedisa/features/create_slices.py,sha256=uSDH1OcEYc5BFPZHSy3UpS4P2DuoVnxOZ-l7wmyT_Po,13108
|
15
15
|
biomedisa/features/crop_helper.py,sha256=6OmLSK8rH-lT8OaU3zTndnp0rpciWd1r37jKhEgyD_I,24255
|
16
16
|
biomedisa/features/curvop_numba.py,sha256=AjKQJcUBoURTB8pq1HmugQYpBwBELthhcEu51_r_xPI,7049
|
17
17
|
biomedisa/features/django_env.py,sha256=LNrZ6rBHZ5I0FaWa5xN8K-ASPgq0r5dGDEUI56HzJxE,8615
|
18
|
-
biomedisa/features/keras_helper.py,sha256=
|
18
|
+
biomedisa/features/keras_helper.py,sha256=1-UXcIECeBpPOQZneqlH9q5w75q5BANQCe01yITk7ls,74651
|
19
19
|
biomedisa/features/nc_reader.py,sha256=RoRMwu3ELSNfoV3qZtaT2OWACnXb2EhNFu_DAF1T93o,7406
|
20
20
|
biomedisa/features/pid.py,sha256=Jmn1VIp0fBlgBrqZ-yUIQVVb5-NAxNBdibXALVr2PPI,2545
|
21
21
|
biomedisa/features/process_image.py,sha256=VtS3fGDvglqJiiJLPK1toe76J58j914NJ8XQKg3CRwo,11091
|
@@ -33,12 +33,12 @@ biomedisa/features/random_walk/pycuda_large.py,sha256=Vfvd0uFRB-qLReDFKIyAAhdWDL
|
|
33
33
|
biomedisa/features/random_walk/pycuda_large_allx.py,sha256=zjy1Ai8D-foXjaT-6G33vGMANS1i00BBbLCTAMUfP5c,30677
|
34
34
|
biomedisa/features/random_walk/pycuda_small.py,sha256=rSwjq2DdtGyNGH1_EfiRQGSgEsCZqvVUrh1UN64AEc8,15786
|
35
35
|
biomedisa/features/random_walk/pycuda_small_allx.py,sha256=z4koEQNWqy3EYOhHbMkO8sP6mpl6R7i8mM6OEQQ4kUQ,18225
|
36
|
-
biomedisa/features/random_walk/pyopencl_large.py,sha256=
|
37
|
-
biomedisa/features/random_walk/pyopencl_small.py,sha256=
|
36
|
+
biomedisa/features/random_walk/pyopencl_large.py,sha256=fBUellvpE2rOuT_ksZWwrqq_KFlqHx2o3mMLnUzGYp8,31017
|
37
|
+
biomedisa/features/random_walk/pyopencl_small.py,sha256=V4afT0kJRNQmfD7FEf8oBQ8warn0OaDIngkpmJhpfK0,17068
|
38
38
|
biomedisa/features/random_walk/rw_large.py,sha256=LtBffUEmNBU6OmcjkKUbISf2ZPTTnzXzbDlinspSm8g,20105
|
39
39
|
biomedisa/features/random_walk/rw_small.py,sha256=BudR1LVCcEPOYK45N-2400CK__MX3aVbunDwhEVvseY,15174
|
40
|
-
biomedisa-25.
|
41
|
-
biomedisa-25.
|
42
|
-
biomedisa-25.
|
43
|
-
biomedisa-25.
|
44
|
-
biomedisa-25.
|
40
|
+
biomedisa-25.7.1.dist-info/licenses/LICENSE,sha256=sehayP6UhydNnmstfL4yFR3genMRdpuUh6uZVWJN1H0,14152
|
41
|
+
biomedisa-25.7.1.dist-info/METADATA,sha256=zRhrraJQzojxLxELMMUAH7InMOs0REkrv9r9Xbkioic,10138
|
42
|
+
biomedisa-25.7.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
43
|
+
biomedisa-25.7.1.dist-info/top_level.txt,sha256=opsf1Eb4vCguPSxev4HHSeiUKCccT_C_RcUCdAYbHWQ,10
|
44
|
+
biomedisa-25.7.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|