biomedisa 25.6.1__tar.gz → 25.7.1__tar.gz

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.
Files changed (48) hide show
  1. {biomedisa-25.6.1 → biomedisa-25.7.1}/PKG-INFO +4 -3
  2. {biomedisa-25.6.1 → biomedisa-25.7.1}/README.md +3 -2
  3. {biomedisa-25.6.1 → biomedisa-25.7.1}/pyproject.toml +1 -1
  4. {biomedisa-25.6.1 → biomedisa-25.7.1}/src/biomedisa/features/biomedisa_helper.py +36 -20
  5. {biomedisa-25.6.1 → biomedisa-25.7.1}/src/biomedisa/features/keras_helper.py +1 -1
  6. {biomedisa-25.6.1 → biomedisa-25.7.1}/src/biomedisa/features/random_walk/pyopencl_large.py +1 -1
  7. {biomedisa-25.6.1 → biomedisa-25.7.1}/src/biomedisa/features/random_walk/pyopencl_small.py +3 -3
  8. {biomedisa-25.6.1 → biomedisa-25.7.1}/src/biomedisa.egg-info/PKG-INFO +4 -3
  9. {biomedisa-25.6.1 → biomedisa-25.7.1}/LICENSE +0 -0
  10. {biomedisa-25.6.1 → biomedisa-25.7.1}/setup.cfg +0 -0
  11. {biomedisa-25.6.1 → biomedisa-25.7.1}/src/biomedisa/__init__.py +0 -0
  12. {biomedisa-25.6.1 → biomedisa-25.7.1}/src/biomedisa/__main__.py +0 -0
  13. {biomedisa-25.6.1 → biomedisa-25.7.1}/src/biomedisa/deeplearning.py +0 -0
  14. {biomedisa-25.6.1 → biomedisa-25.7.1}/src/biomedisa/features/DataGenerator.py +0 -0
  15. {biomedisa-25.6.1 → biomedisa-25.7.1}/src/biomedisa/features/DataGeneratorCrop.py +0 -0
  16. {biomedisa-25.6.1 → biomedisa-25.7.1}/src/biomedisa/features/PredictDataGenerator.py +0 -0
  17. {biomedisa-25.6.1 → biomedisa-25.7.1}/src/biomedisa/features/PredictDataGeneratorCrop.py +0 -0
  18. {biomedisa-25.6.1 → biomedisa-25.7.1}/src/biomedisa/features/__init__.py +0 -0
  19. {biomedisa-25.6.1 → biomedisa-25.7.1}/src/biomedisa/features/active_contour.py +0 -0
  20. {biomedisa-25.6.1 → biomedisa-25.7.1}/src/biomedisa/features/amira_to_np/__init__.py +0 -0
  21. {biomedisa-25.6.1 → biomedisa-25.7.1}/src/biomedisa/features/amira_to_np/amira_data_stream.py +0 -0
  22. {biomedisa-25.6.1 → biomedisa-25.7.1}/src/biomedisa/features/amira_to_np/amira_grammar.py +0 -0
  23. {biomedisa-25.6.1 → biomedisa-25.7.1}/src/biomedisa/features/amira_to_np/amira_header.py +0 -0
  24. {biomedisa-25.6.1 → biomedisa-25.7.1}/src/biomedisa/features/amira_to_np/amira_helper.py +0 -0
  25. {biomedisa-25.6.1 → biomedisa-25.7.1}/src/biomedisa/features/assd.py +0 -0
  26. {biomedisa-25.6.1 → biomedisa-25.7.1}/src/biomedisa/features/create_slices.py +0 -0
  27. {biomedisa-25.6.1 → biomedisa-25.7.1}/src/biomedisa/features/crop_helper.py +0 -0
  28. {biomedisa-25.6.1 → biomedisa-25.7.1}/src/biomedisa/features/curvop_numba.py +0 -0
  29. {biomedisa-25.6.1 → biomedisa-25.7.1}/src/biomedisa/features/django_env.py +0 -0
  30. {biomedisa-25.6.1 → biomedisa-25.7.1}/src/biomedisa/features/nc_reader.py +0 -0
  31. {biomedisa-25.6.1 → biomedisa-25.7.1}/src/biomedisa/features/pid.py +0 -0
  32. {biomedisa-25.6.1 → biomedisa-25.7.1}/src/biomedisa/features/process_image.py +0 -0
  33. {biomedisa-25.6.1 → biomedisa-25.7.1}/src/biomedisa/features/pycuda_test.py +0 -0
  34. {biomedisa-25.6.1 → biomedisa-25.7.1}/src/biomedisa/features/random_walk/__init__.py +0 -0
  35. {biomedisa-25.6.1 → biomedisa-25.7.1}/src/biomedisa/features/random_walk/gpu_kernels.py +0 -0
  36. {biomedisa-25.6.1 → biomedisa-25.7.1}/src/biomedisa/features/random_walk/pycuda_large.py +0 -0
  37. {biomedisa-25.6.1 → biomedisa-25.7.1}/src/biomedisa/features/random_walk/pycuda_large_allx.py +0 -0
  38. {biomedisa-25.6.1 → biomedisa-25.7.1}/src/biomedisa/features/random_walk/pycuda_small.py +0 -0
  39. {biomedisa-25.6.1 → biomedisa-25.7.1}/src/biomedisa/features/random_walk/pycuda_small_allx.py +0 -0
  40. {biomedisa-25.6.1 → biomedisa-25.7.1}/src/biomedisa/features/random_walk/rw_large.py +0 -0
  41. {biomedisa-25.6.1 → biomedisa-25.7.1}/src/biomedisa/features/random_walk/rw_small.py +0 -0
  42. {biomedisa-25.6.1 → biomedisa-25.7.1}/src/biomedisa/features/remove_outlier.py +0 -0
  43. {biomedisa-25.6.1 → biomedisa-25.7.1}/src/biomedisa/features/split_volume.py +0 -0
  44. {biomedisa-25.6.1 → biomedisa-25.7.1}/src/biomedisa/interpolation.py +0 -0
  45. {biomedisa-25.6.1 → biomedisa-25.7.1}/src/biomedisa/mesh.py +0 -0
  46. {biomedisa-25.6.1 → biomedisa-25.7.1}/src/biomedisa.egg-info/SOURCES.txt +0 -0
  47. {biomedisa-25.6.1 → biomedisa-25.7.1}/src/biomedisa.egg-info/dependency_links.txt +0 -0
  48. {biomedisa-25.6.1 → biomedisa-25.7.1}/src/biomedisa.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: biomedisa
3
- Version: 25.6.1
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 10/11 + Smart Interpolation + Deep Learning](https://github.com/biomedisa/biomedisa/blob/master/README/windows_wsl.md)
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)
@@ -20,13 +20,14 @@
20
20
  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).
21
21
 
22
22
  ## Hardware Requirements
23
- + One or more NVIDIA GPUs
23
+ + One or more NVIDIA, AMD, or Intel GPUs
24
24
 
25
25
  ## Installation (command-line based)
26
26
  + [Ubuntu 22/24 + Smart Interpolation](https://github.com/biomedisa/biomedisa/blob/master/README/ubuntu_interpolation_cli.md)
27
27
  + [Ubuntu 22/24 + Deep Learning](https://github.com/biomedisa/biomedisa/blob/master/README/ubuntu_deeplearning_cli.md)
28
28
  + [Ubuntu 22/24 + Smart Interpolation + Deep Learning](https://github.com/biomedisa/biomedisa/blob/master/README/ubuntu_cli.md)
29
- + [Windows 10/11 + Smart Interpolation + Deep Learning](https://github.com/biomedisa/biomedisa/blob/master/README/windows_wsl.md)
29
+ + [Windows (WSL) + Smart Interpolation + Deep Learning ("advanced")](https://github.com/biomedisa/biomedisa/blob/master/README/windows_wsl.md)
30
+ + [Windows 10/11 + Smart Interpolation (NVIDIA, AMD, Intel) ("simple")](https://github.com/biomedisa/biomedisa/blob/master/README/windows_interpolation.md)
30
31
 
31
32
  ## Installation (3D Slicer extension)
32
33
  + [Ubuntu 22/24](https://github.com/biomedisa/biomedisa/blob/master/README/ubuntu_slicer.md)
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "biomedisa"
7
- version = "25.6.1"
7
+ version = "25.7.1"
8
8
  authors = [
9
9
  { name="Philipp Lösel"}, {email="philipp.loesel@anu.edu.au" },
10
10
  ]
@@ -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
- try:
71
- arr = arr.ravel()
72
- counts = np.zeros(np.amax(arr)+1, dtype=int)
73
- @numba.jit(nopython=True)
74
- def __unique__(arr, size, counts):
75
- for k in range(size):
76
- counts[arr[k]] += 1
77
- return counts
78
- counts = __unique__(arr, arr.size, counts)
79
- labels = np.where(counts)[0]
80
- if return_counts:
81
- return labels, counts[labels]
82
- else:
83
- return labels
84
- except Exception as e:
85
- print(f"Error: {e}")
86
- return None
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
- pass
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, 32, 32)
102
- #x_grid = ((xsh // 32) + 1)*32
103
- #y_grid = ((ysh // 32) + 1)*32
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.6.1
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 10/11 + Smart Interpolation + Deep Learning](https://github.com/biomedisa/biomedisa/blob/master/README/windows_wsl.md)
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)
File without changes
File without changes