biomedisa 2024.5.16__tar.gz → 2024.5.18__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-2024.5.16 → biomedisa-2024.5.18}/PKG-INFO +25 -54
  2. {biomedisa-2024.5.16 → biomedisa-2024.5.18}/README.md +24 -53
  3. {biomedisa-2024.5.16 → biomedisa-2024.5.18}/pyproject.toml +1 -1
  4. {biomedisa-2024.5.16 → biomedisa-2024.5.18}/src/biomedisa.egg-info/PKG-INFO +25 -54
  5. {biomedisa-2024.5.16 → biomedisa-2024.5.18}/LICENSE +0 -0
  6. {biomedisa-2024.5.16 → biomedisa-2024.5.18}/setup.cfg +0 -0
  7. {biomedisa-2024.5.16 → biomedisa-2024.5.18}/src/biomedisa/__init__.py +0 -0
  8. {biomedisa-2024.5.16 → biomedisa-2024.5.18}/src/biomedisa/__main__.py +0 -0
  9. {biomedisa-2024.5.16 → biomedisa-2024.5.18}/src/biomedisa/biomedisa_features/DataGenerator.py +0 -0
  10. {biomedisa-2024.5.16 → biomedisa-2024.5.18}/src/biomedisa/biomedisa_features/DataGeneratorCrop.py +0 -0
  11. {biomedisa-2024.5.16 → biomedisa-2024.5.18}/src/biomedisa/biomedisa_features/PredictDataGenerator.py +0 -0
  12. {biomedisa-2024.5.16 → biomedisa-2024.5.18}/src/biomedisa/biomedisa_features/PredictDataGeneratorCrop.py +0 -0
  13. {biomedisa-2024.5.16 → biomedisa-2024.5.18}/src/biomedisa/biomedisa_features/__init__.py +0 -0
  14. {biomedisa-2024.5.16 → biomedisa-2024.5.18}/src/biomedisa/biomedisa_features/active_contour.py +0 -0
  15. {biomedisa-2024.5.16 → biomedisa-2024.5.18}/src/biomedisa/biomedisa_features/amira_to_np/__init__.py +0 -0
  16. {biomedisa-2024.5.16 → biomedisa-2024.5.18}/src/biomedisa/biomedisa_features/amira_to_np/amira_data_stream.py +0 -0
  17. {biomedisa-2024.5.16 → biomedisa-2024.5.18}/src/biomedisa/biomedisa_features/amira_to_np/amira_grammar.py +0 -0
  18. {biomedisa-2024.5.16 → biomedisa-2024.5.18}/src/biomedisa/biomedisa_features/amira_to_np/amira_header.py +0 -0
  19. {biomedisa-2024.5.16 → biomedisa-2024.5.18}/src/biomedisa/biomedisa_features/amira_to_np/amira_helper.py +0 -0
  20. {biomedisa-2024.5.16 → biomedisa-2024.5.18}/src/biomedisa/biomedisa_features/assd.py +0 -0
  21. {biomedisa-2024.5.16 → biomedisa-2024.5.18}/src/biomedisa/biomedisa_features/biomedisa_helper.py +0 -0
  22. {biomedisa-2024.5.16 → biomedisa-2024.5.18}/src/biomedisa/biomedisa_features/create_slices.py +0 -0
  23. {biomedisa-2024.5.16 → biomedisa-2024.5.18}/src/biomedisa/biomedisa_features/crop_helper.py +0 -0
  24. {biomedisa-2024.5.16 → biomedisa-2024.5.18}/src/biomedisa/biomedisa_features/curvop_numba.py +0 -0
  25. {biomedisa-2024.5.16 → biomedisa-2024.5.18}/src/biomedisa/biomedisa_features/django_env.py +0 -0
  26. {biomedisa-2024.5.16 → biomedisa-2024.5.18}/src/biomedisa/biomedisa_features/keras_helper.py +0 -0
  27. {biomedisa-2024.5.16 → biomedisa-2024.5.18}/src/biomedisa/biomedisa_features/nc_reader.py +0 -0
  28. {biomedisa-2024.5.16 → biomedisa-2024.5.18}/src/biomedisa/biomedisa_features/pid.py +0 -0
  29. {biomedisa-2024.5.16 → biomedisa-2024.5.18}/src/biomedisa/biomedisa_features/process_image.py +0 -0
  30. {biomedisa-2024.5.16 → biomedisa-2024.5.18}/src/biomedisa/biomedisa_features/pycuda_test.py +0 -0
  31. {biomedisa-2024.5.16 → biomedisa-2024.5.18}/src/biomedisa/biomedisa_features/random_walk/__init__.py +0 -0
  32. {biomedisa-2024.5.16 → biomedisa-2024.5.18}/src/biomedisa/biomedisa_features/random_walk/gpu_kernels.py +0 -0
  33. {biomedisa-2024.5.16 → biomedisa-2024.5.18}/src/biomedisa/biomedisa_features/random_walk/pycuda_large.py +0 -0
  34. {biomedisa-2024.5.16 → biomedisa-2024.5.18}/src/biomedisa/biomedisa_features/random_walk/pycuda_large_allx.py +0 -0
  35. {biomedisa-2024.5.16 → biomedisa-2024.5.18}/src/biomedisa/biomedisa_features/random_walk/pycuda_small.py +0 -0
  36. {biomedisa-2024.5.16 → biomedisa-2024.5.18}/src/biomedisa/biomedisa_features/random_walk/pycuda_small_allx.py +0 -0
  37. {biomedisa-2024.5.16 → biomedisa-2024.5.18}/src/biomedisa/biomedisa_features/random_walk/pyopencl_large.py +0 -0
  38. {biomedisa-2024.5.16 → biomedisa-2024.5.18}/src/biomedisa/biomedisa_features/random_walk/pyopencl_small.py +0 -0
  39. {biomedisa-2024.5.16 → biomedisa-2024.5.18}/src/biomedisa/biomedisa_features/random_walk/rw_large.py +0 -0
  40. {biomedisa-2024.5.16 → biomedisa-2024.5.18}/src/biomedisa/biomedisa_features/random_walk/rw_small.py +0 -0
  41. {biomedisa-2024.5.16 → biomedisa-2024.5.18}/src/biomedisa/biomedisa_features/remove_outlier.py +0 -0
  42. {biomedisa-2024.5.16 → biomedisa-2024.5.18}/src/biomedisa/biomedisa_features/split_volume.py +0 -0
  43. {biomedisa-2024.5.16 → biomedisa-2024.5.18}/src/biomedisa/deeplearning.py +0 -0
  44. {biomedisa-2024.5.16 → biomedisa-2024.5.18}/src/biomedisa/interpolation.py +0 -0
  45. {biomedisa-2024.5.16 → biomedisa-2024.5.18}/src/biomedisa/mesh.py +0 -0
  46. {biomedisa-2024.5.16 → biomedisa-2024.5.18}/src/biomedisa.egg-info/SOURCES.txt +0 -0
  47. {biomedisa-2024.5.16 → biomedisa-2024.5.18}/src/biomedisa.egg-info/dependency_links.txt +0 -0
  48. {biomedisa-2024.5.16 → biomedisa-2024.5.18}/src/biomedisa.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: biomedisa
3
- Version: 2024.5.16
3
+ Version: 2024.5.18
4
4
  Summary: Segmentation of 3D volumetric image data
5
5
  Author: Philipp Lösel
6
6
  Author-email: philipp.loesel@anu.edu.au
@@ -55,13 +55,8 @@ Biomedisa (https://biomedisa.info) is a free and easy-to-use open-source applica
55
55
 
56
56
  #### Python example
57
57
  ```python
58
- # change this line to your biomedisa directory
59
- path_to_biomedisa = '/home/<user>/git/biomedisa'
60
-
61
- import sys
62
- sys.path.append(path_to_biomedisa)
63
- from biomedisa_features.biomedisa_helper import load_data, save_data
64
- from biomedisa_features.biomedisa_interpolation import smart_interpolation
58
+ from biomedisa.biomedisa_features.biomedisa_helper import load_data, save_data
59
+ from biomedisa.interpolation import smart_interpolation
65
60
 
66
61
  # load data
67
62
  img, _ = load_data('Downloads/trigonopterus.tif')
@@ -81,11 +76,7 @@ save_data('Downloads/final.trigonopterus.smooth.am', smooth_result, header=heade
81
76
 
82
77
  #### Command-line based
83
78
  ```
84
- # change to the features directory
85
- cd git/biomedisa/biomedisa_features/
86
-
87
- # start smart interpolation
88
- python biomedisa_interpolation.py C:\Users\%USERNAME%\Downloads\tumor.tif C:\Users\%USERNAME%\Downloads\labels.tumor.tif
79
+ python -m biomedisa.interpolation C:\Users\%USERNAME%\Downloads\tumor.tif C:\Users\%USERNAME%\Downloads\labels.tumor.tif
89
80
  ```
90
81
 
91
82
  # Deep Learning
@@ -93,14 +84,8 @@ python biomedisa_interpolation.py C:\Users\%USERNAME%\Downloads\tumor.tif C:\Use
93
84
 
94
85
  #### Python example (training)
95
86
  ```python
96
- # change this line to your biomedisa directory
97
- path_to_biomedisa = '/home/<user>/git/biomedisa'
98
-
99
- # load libraries
100
- import sys
101
- sys.path.append(path_to_biomedisa)
102
- from biomedisa_features.biomedisa_helper import load_data
103
- from biomedisa_features.biomedisa_deeplearning import deep_learning
87
+ from biomedisa.biomedisa_features.biomedisa_helper import load_data
88
+ from biomedisa.deeplearning import deep_learning
104
89
 
105
90
  # load image data
106
91
  img1, _ = load_data('Head1.am')
@@ -129,27 +114,18 @@ deep_learning(img_data, label_data, train=True, batch_size=12,
129
114
 
130
115
  #### Command-line based (training)
131
116
  ```
132
- # change to the features directory
133
- cd git/biomedisa/biomedisa_features/
134
-
135
117
  # start training with a batch size of 12
136
- python biomedisa_deeplearning.py C:\Users\%USERNAME%\Downloads\training_heart C:\Users\%USERNAME%\Downloads\training_heart_labels -t -bs 12
118
+ python -m biomedisa.deeplearning C:\Users\%USERNAME%\Downloads\training_heart C:\Users\%USERNAME%\Downloads\training_heart_labels -t -bs 12
137
119
 
138
120
  # validation (optional)
139
- python biomedisa_deeplearning.py C:\Users\%USERNAME%\Downloads\training_heart C:\Users\%USERNAME%\Downloads\training_heart_labels -t -vi C:\Users\%USERNAME%\Downloads\val_img -vl C:\Users\%USERNAME%\Downloads\val_labels
121
+ python -m biomedisa.deeplearning C:\Users\%USERNAME%\Downloads\training_heart C:\Users\%USERNAME%\Downloads\training_heart_labels -t -vi C:\Users\%USERNAME%\Downloads\val_img -vl C:\Users\%USERNAME%\Downloads\val_labels
140
122
  ```
141
123
  If running into ResourceExhaustedError due to out of memory (OOM), try to use smaller batch size.
142
124
 
143
125
  #### Python example (prediction)
144
126
  ```python
145
- # change this line to your biomedisa directory
146
- path_to_biomedisa = '/home/<user>/git/biomedisa'
147
-
148
- # load libraries
149
- import sys
150
- sys.path.append(path_to_biomedisa)
151
- from biomedisa_features.biomedisa_helper import load_data, save_data
152
- from biomedisa_features.biomedisa_deeplearning import deep_learning
127
+ from biomedisa.biomedisa_features.biomedisa_helper import load_data, save_data
128
+ from biomedisa.deeplearning import deep_learning
153
129
 
154
130
  # load data
155
131
  img, _ = load_data('Head5.am')
@@ -164,20 +140,15 @@ save_data('final.Head5.am', results['regular'], results['header'])
164
140
 
165
141
  #### Command-line based (prediction)
166
142
  ```
167
- # change to the features directory
168
- cd git/biomedisa/biomedisa_features/
169
-
170
143
  # start prediction with a batch size of 6
171
- python biomedisa_deeplearning.py C:\Users\%USERNAME%\Downloads\testing_axial_crop_pat13.nii.gz C:\Users\%USERNAME%\Downloads\heart.h5 -p -bs 6
144
+ python -m biomedisa.deeplearning C:\Users\%USERNAME%\Downloads\testing_axial_crop_pat13.nii.gz C:\Users\%USERNAME%\Downloads\heart.h5 -p -bs 6
172
145
  ```
173
146
 
174
147
  # Biomedisa Features
175
148
 
176
149
  #### Load and save data (such as Amira Mesh, TIFF, NRRD, NIfTI or DICOM)
177
150
  ```python
178
- import sys
179
- sys.path.append(path_to_biomedisa) # e.g. '/home/<user>/git/biomedisa'
180
- from biomedisa_features.biomedisa_helper import load_data, save_data
151
+ from biomedisa.biomedisa_features.biomedisa_helper import load_data, save_data
181
152
 
182
153
  # load data as numpy array
183
154
  # for DICOM, PNG files, or similar formats, 'path_to_data' must reference
@@ -190,10 +161,8 @@ save_data(path_to_data, data, header)
190
161
 
191
162
  #### Create STL mesh from segmentation (label values are saved as attributes)
192
163
  ```python
193
- import os, sys
194
- sys.path.append(path_to_biomedisa) # e.g. '/home/<user>/git/biomedisa'
195
- from biomedisa_features.biomedisa_helper import load_data, save_data
196
- from biomedisa_features.create_mesh import get_voxel_spacing, save_mesh
164
+ from biomedisa.biomedisa_features.biomedisa_helper import load_data, save_data
165
+ from biomedisa.mesh import get_voxel_spacing, save_mesh
197
166
 
198
167
  # load segmentation
199
168
  data, header, extension = load_data(path_to_data, return_extension=True)
@@ -209,7 +178,7 @@ save_mesh(path_to_data, data, x_res, y_res, z_res, poly_reduction=0.9, smoothing
209
178
 
210
179
  #### Create mesh directly
211
180
  ```
212
- python git/biomedisa/biomedisa_features/create_mesh.py <path_to_data>
181
+ python -m biomedisa.mesh <path_to_data>
213
182
  ```
214
183
 
215
184
  #### Options
@@ -225,9 +194,7 @@ python git/biomedisa/biomedisa_features/create_mesh.py <path_to_data>
225
194
 
226
195
  #### Resize data
227
196
  ```python
228
- import os, sys
229
- sys.path.append(path_to_biomedisa) # e.g. '/home/<user>/git/biomedisa'
230
- from biomedisa_features.biomedisa_helper import img_resize
197
+ from biomedisa.biomedisa_features.biomedisa_helper import img_resize
231
198
 
232
199
  # resize image data
233
200
  zsh, ysh, xsh = data.shape
@@ -240,7 +207,7 @@ label_data = img_resize(label_data, new_zsh, new_ysh, new_xsh, labels=True)
240
207
 
241
208
  #### Remove outliers and fill holes
242
209
  ```python
243
- from biomedisa_features.biomedisa_helper import clean, fill
210
+ from biomedisa.biomedisa_features.biomedisa_helper import clean, fill
244
211
 
245
212
  # delete outliers smaller than 90% of the segment
246
213
  label_data = clean(label_data, 0.9)
@@ -251,24 +218,28 @@ label_data = fill(label_data, 0.9)
251
218
 
252
219
  #### Accuracy assessment
253
220
  ```python
254
- from biomedisa_features.biomedisa_helper import Dice_score, ASSD
221
+ from biomedisa.biomedisa_features.biomedisa_helper import Dice_score, ASSD
255
222
  dice = Dice_score(ground_truth, result)
256
223
  assd = ASSD(ground_truth, result)
257
224
  ```
258
225
 
259
226
  # Update Biomedisa
260
- If you have used `git clone`, change to the Biomedisa directory and make a pull request.
227
+ If you installed Biomedisa via Pip.
228
+ ```
229
+ pip install --upgrade biomedisa
230
+ ```
231
+ If you used `git clone`, change to the Biomedisa directory and make a pull request.
261
232
  ```
262
233
  cd git/biomedisa
263
234
  git pull
264
235
  ```
265
236
 
266
- If you have installed the browser based version of Biomedisa (including MySQL database), you also need to update the database.
237
+ If you installed the browser based version of Biomedisa (including MySQL database), you also need to update the database.
267
238
  ```
268
239
  python manage.py migrate
269
240
  ```
270
241
 
271
- If you have installed an [Apache Server](https://github.com/biomedisa/biomedisa/blob/master/README/APACHE_SERVER.md), you need to restart the server.
242
+ If you installed an [Apache Server](https://github.com/biomedisa/biomedisa/blob/master/README/APACHE_SERVER.md), you need to restart the server.
272
243
  ```
273
244
  sudo service apache2 restart
274
245
  ```
@@ -39,13 +39,8 @@ Biomedisa (https://biomedisa.info) is a free and easy-to-use open-source applica
39
39
 
40
40
  #### Python example
41
41
  ```python
42
- # change this line to your biomedisa directory
43
- path_to_biomedisa = '/home/<user>/git/biomedisa'
44
-
45
- import sys
46
- sys.path.append(path_to_biomedisa)
47
- from biomedisa_features.biomedisa_helper import load_data, save_data
48
- from biomedisa_features.biomedisa_interpolation import smart_interpolation
42
+ from biomedisa.biomedisa_features.biomedisa_helper import load_data, save_data
43
+ from biomedisa.interpolation import smart_interpolation
49
44
 
50
45
  # load data
51
46
  img, _ = load_data('Downloads/trigonopterus.tif')
@@ -65,11 +60,7 @@ save_data('Downloads/final.trigonopterus.smooth.am', smooth_result, header=heade
65
60
 
66
61
  #### Command-line based
67
62
  ```
68
- # change to the features directory
69
- cd git/biomedisa/biomedisa_features/
70
-
71
- # start smart interpolation
72
- python biomedisa_interpolation.py C:\Users\%USERNAME%\Downloads\tumor.tif C:\Users\%USERNAME%\Downloads\labels.tumor.tif
63
+ python -m biomedisa.interpolation C:\Users\%USERNAME%\Downloads\tumor.tif C:\Users\%USERNAME%\Downloads\labels.tumor.tif
73
64
  ```
74
65
 
75
66
  # Deep Learning
@@ -77,14 +68,8 @@ python biomedisa_interpolation.py C:\Users\%USERNAME%\Downloads\tumor.tif C:\Use
77
68
 
78
69
  #### Python example (training)
79
70
  ```python
80
- # change this line to your biomedisa directory
81
- path_to_biomedisa = '/home/<user>/git/biomedisa'
82
-
83
- # load libraries
84
- import sys
85
- sys.path.append(path_to_biomedisa)
86
- from biomedisa_features.biomedisa_helper import load_data
87
- from biomedisa_features.biomedisa_deeplearning import deep_learning
71
+ from biomedisa.biomedisa_features.biomedisa_helper import load_data
72
+ from biomedisa.deeplearning import deep_learning
88
73
 
89
74
  # load image data
90
75
  img1, _ = load_data('Head1.am')
@@ -113,27 +98,18 @@ deep_learning(img_data, label_data, train=True, batch_size=12,
113
98
 
114
99
  #### Command-line based (training)
115
100
  ```
116
- # change to the features directory
117
- cd git/biomedisa/biomedisa_features/
118
-
119
101
  # start training with a batch size of 12
120
- python biomedisa_deeplearning.py C:\Users\%USERNAME%\Downloads\training_heart C:\Users\%USERNAME%\Downloads\training_heart_labels -t -bs 12
102
+ python -m biomedisa.deeplearning C:\Users\%USERNAME%\Downloads\training_heart C:\Users\%USERNAME%\Downloads\training_heart_labels -t -bs 12
121
103
 
122
104
  # validation (optional)
123
- python biomedisa_deeplearning.py C:\Users\%USERNAME%\Downloads\training_heart C:\Users\%USERNAME%\Downloads\training_heart_labels -t -vi C:\Users\%USERNAME%\Downloads\val_img -vl C:\Users\%USERNAME%\Downloads\val_labels
105
+ python -m biomedisa.deeplearning C:\Users\%USERNAME%\Downloads\training_heart C:\Users\%USERNAME%\Downloads\training_heart_labels -t -vi C:\Users\%USERNAME%\Downloads\val_img -vl C:\Users\%USERNAME%\Downloads\val_labels
124
106
  ```
125
107
  If running into ResourceExhaustedError due to out of memory (OOM), try to use smaller batch size.
126
108
 
127
109
  #### Python example (prediction)
128
110
  ```python
129
- # change this line to your biomedisa directory
130
- path_to_biomedisa = '/home/<user>/git/biomedisa'
131
-
132
- # load libraries
133
- import sys
134
- sys.path.append(path_to_biomedisa)
135
- from biomedisa_features.biomedisa_helper import load_data, save_data
136
- from biomedisa_features.biomedisa_deeplearning import deep_learning
111
+ from biomedisa.biomedisa_features.biomedisa_helper import load_data, save_data
112
+ from biomedisa.deeplearning import deep_learning
137
113
 
138
114
  # load data
139
115
  img, _ = load_data('Head5.am')
@@ -148,20 +124,15 @@ save_data('final.Head5.am', results['regular'], results['header'])
148
124
 
149
125
  #### Command-line based (prediction)
150
126
  ```
151
- # change to the features directory
152
- cd git/biomedisa/biomedisa_features/
153
-
154
127
  # start prediction with a batch size of 6
155
- python biomedisa_deeplearning.py C:\Users\%USERNAME%\Downloads\testing_axial_crop_pat13.nii.gz C:\Users\%USERNAME%\Downloads\heart.h5 -p -bs 6
128
+ python -m biomedisa.deeplearning C:\Users\%USERNAME%\Downloads\testing_axial_crop_pat13.nii.gz C:\Users\%USERNAME%\Downloads\heart.h5 -p -bs 6
156
129
  ```
157
130
 
158
131
  # Biomedisa Features
159
132
 
160
133
  #### Load and save data (such as Amira Mesh, TIFF, NRRD, NIfTI or DICOM)
161
134
  ```python
162
- import sys
163
- sys.path.append(path_to_biomedisa) # e.g. '/home/<user>/git/biomedisa'
164
- from biomedisa_features.biomedisa_helper import load_data, save_data
135
+ from biomedisa.biomedisa_features.biomedisa_helper import load_data, save_data
165
136
 
166
137
  # load data as numpy array
167
138
  # for DICOM, PNG files, or similar formats, 'path_to_data' must reference
@@ -174,10 +145,8 @@ save_data(path_to_data, data, header)
174
145
 
175
146
  #### Create STL mesh from segmentation (label values are saved as attributes)
176
147
  ```python
177
- import os, sys
178
- sys.path.append(path_to_biomedisa) # e.g. '/home/<user>/git/biomedisa'
179
- from biomedisa_features.biomedisa_helper import load_data, save_data
180
- from biomedisa_features.create_mesh import get_voxel_spacing, save_mesh
148
+ from biomedisa.biomedisa_features.biomedisa_helper import load_data, save_data
149
+ from biomedisa.mesh import get_voxel_spacing, save_mesh
181
150
 
182
151
  # load segmentation
183
152
  data, header, extension = load_data(path_to_data, return_extension=True)
@@ -193,7 +162,7 @@ save_mesh(path_to_data, data, x_res, y_res, z_res, poly_reduction=0.9, smoothing
193
162
 
194
163
  #### Create mesh directly
195
164
  ```
196
- python git/biomedisa/biomedisa_features/create_mesh.py <path_to_data>
165
+ python -m biomedisa.mesh <path_to_data>
197
166
  ```
198
167
 
199
168
  #### Options
@@ -209,9 +178,7 @@ python git/biomedisa/biomedisa_features/create_mesh.py <path_to_data>
209
178
 
210
179
  #### Resize data
211
180
  ```python
212
- import os, sys
213
- sys.path.append(path_to_biomedisa) # e.g. '/home/<user>/git/biomedisa'
214
- from biomedisa_features.biomedisa_helper import img_resize
181
+ from biomedisa.biomedisa_features.biomedisa_helper import img_resize
215
182
 
216
183
  # resize image data
217
184
  zsh, ysh, xsh = data.shape
@@ -224,7 +191,7 @@ label_data = img_resize(label_data, new_zsh, new_ysh, new_xsh, labels=True)
224
191
 
225
192
  #### Remove outliers and fill holes
226
193
  ```python
227
- from biomedisa_features.biomedisa_helper import clean, fill
194
+ from biomedisa.biomedisa_features.biomedisa_helper import clean, fill
228
195
 
229
196
  # delete outliers smaller than 90% of the segment
230
197
  label_data = clean(label_data, 0.9)
@@ -235,24 +202,28 @@ label_data = fill(label_data, 0.9)
235
202
 
236
203
  #### Accuracy assessment
237
204
  ```python
238
- from biomedisa_features.biomedisa_helper import Dice_score, ASSD
205
+ from biomedisa.biomedisa_features.biomedisa_helper import Dice_score, ASSD
239
206
  dice = Dice_score(ground_truth, result)
240
207
  assd = ASSD(ground_truth, result)
241
208
  ```
242
209
 
243
210
  # Update Biomedisa
244
- If you have used `git clone`, change to the Biomedisa directory and make a pull request.
211
+ If you installed Biomedisa via Pip.
212
+ ```
213
+ pip install --upgrade biomedisa
214
+ ```
215
+ If you used `git clone`, change to the Biomedisa directory and make a pull request.
245
216
  ```
246
217
  cd git/biomedisa
247
218
  git pull
248
219
  ```
249
220
 
250
- If you have installed the browser based version of Biomedisa (including MySQL database), you also need to update the database.
221
+ If you installed the browser based version of Biomedisa (including MySQL database), you also need to update the database.
251
222
  ```
252
223
  python manage.py migrate
253
224
  ```
254
225
 
255
- If you have installed an [Apache Server](https://github.com/biomedisa/biomedisa/blob/master/README/APACHE_SERVER.md), you need to restart the server.
226
+ If you installed an [Apache Server](https://github.com/biomedisa/biomedisa/blob/master/README/APACHE_SERVER.md), you need to restart the server.
256
227
  ```
257
228
  sudo service apache2 restart
258
229
  ```
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "biomedisa"
7
- version = "2024.5.16"
7
+ version = "2024.5.18"
8
8
  authors = [
9
9
  { name="Philipp Lösel"}, {email="philipp.loesel@anu.edu.au" },
10
10
  ]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: biomedisa
3
- Version: 2024.5.16
3
+ Version: 2024.5.18
4
4
  Summary: Segmentation of 3D volumetric image data
5
5
  Author: Philipp Lösel
6
6
  Author-email: philipp.loesel@anu.edu.au
@@ -55,13 +55,8 @@ Biomedisa (https://biomedisa.info) is a free and easy-to-use open-source applica
55
55
 
56
56
  #### Python example
57
57
  ```python
58
- # change this line to your biomedisa directory
59
- path_to_biomedisa = '/home/<user>/git/biomedisa'
60
-
61
- import sys
62
- sys.path.append(path_to_biomedisa)
63
- from biomedisa_features.biomedisa_helper import load_data, save_data
64
- from biomedisa_features.biomedisa_interpolation import smart_interpolation
58
+ from biomedisa.biomedisa_features.biomedisa_helper import load_data, save_data
59
+ from biomedisa.interpolation import smart_interpolation
65
60
 
66
61
  # load data
67
62
  img, _ = load_data('Downloads/trigonopterus.tif')
@@ -81,11 +76,7 @@ save_data('Downloads/final.trigonopterus.smooth.am', smooth_result, header=heade
81
76
 
82
77
  #### Command-line based
83
78
  ```
84
- # change to the features directory
85
- cd git/biomedisa/biomedisa_features/
86
-
87
- # start smart interpolation
88
- python biomedisa_interpolation.py C:\Users\%USERNAME%\Downloads\tumor.tif C:\Users\%USERNAME%\Downloads\labels.tumor.tif
79
+ python -m biomedisa.interpolation C:\Users\%USERNAME%\Downloads\tumor.tif C:\Users\%USERNAME%\Downloads\labels.tumor.tif
89
80
  ```
90
81
 
91
82
  # Deep Learning
@@ -93,14 +84,8 @@ python biomedisa_interpolation.py C:\Users\%USERNAME%\Downloads\tumor.tif C:\Use
93
84
 
94
85
  #### Python example (training)
95
86
  ```python
96
- # change this line to your biomedisa directory
97
- path_to_biomedisa = '/home/<user>/git/biomedisa'
98
-
99
- # load libraries
100
- import sys
101
- sys.path.append(path_to_biomedisa)
102
- from biomedisa_features.biomedisa_helper import load_data
103
- from biomedisa_features.biomedisa_deeplearning import deep_learning
87
+ from biomedisa.biomedisa_features.biomedisa_helper import load_data
88
+ from biomedisa.deeplearning import deep_learning
104
89
 
105
90
  # load image data
106
91
  img1, _ = load_data('Head1.am')
@@ -129,27 +114,18 @@ deep_learning(img_data, label_data, train=True, batch_size=12,
129
114
 
130
115
  #### Command-line based (training)
131
116
  ```
132
- # change to the features directory
133
- cd git/biomedisa/biomedisa_features/
134
-
135
117
  # start training with a batch size of 12
136
- python biomedisa_deeplearning.py C:\Users\%USERNAME%\Downloads\training_heart C:\Users\%USERNAME%\Downloads\training_heart_labels -t -bs 12
118
+ python -m biomedisa.deeplearning C:\Users\%USERNAME%\Downloads\training_heart C:\Users\%USERNAME%\Downloads\training_heart_labels -t -bs 12
137
119
 
138
120
  # validation (optional)
139
- python biomedisa_deeplearning.py C:\Users\%USERNAME%\Downloads\training_heart C:\Users\%USERNAME%\Downloads\training_heart_labels -t -vi C:\Users\%USERNAME%\Downloads\val_img -vl C:\Users\%USERNAME%\Downloads\val_labels
121
+ python -m biomedisa.deeplearning C:\Users\%USERNAME%\Downloads\training_heart C:\Users\%USERNAME%\Downloads\training_heart_labels -t -vi C:\Users\%USERNAME%\Downloads\val_img -vl C:\Users\%USERNAME%\Downloads\val_labels
140
122
  ```
141
123
  If running into ResourceExhaustedError due to out of memory (OOM), try to use smaller batch size.
142
124
 
143
125
  #### Python example (prediction)
144
126
  ```python
145
- # change this line to your biomedisa directory
146
- path_to_biomedisa = '/home/<user>/git/biomedisa'
147
-
148
- # load libraries
149
- import sys
150
- sys.path.append(path_to_biomedisa)
151
- from biomedisa_features.biomedisa_helper import load_data, save_data
152
- from biomedisa_features.biomedisa_deeplearning import deep_learning
127
+ from biomedisa.biomedisa_features.biomedisa_helper import load_data, save_data
128
+ from biomedisa.deeplearning import deep_learning
153
129
 
154
130
  # load data
155
131
  img, _ = load_data('Head5.am')
@@ -164,20 +140,15 @@ save_data('final.Head5.am', results['regular'], results['header'])
164
140
 
165
141
  #### Command-line based (prediction)
166
142
  ```
167
- # change to the features directory
168
- cd git/biomedisa/biomedisa_features/
169
-
170
143
  # start prediction with a batch size of 6
171
- python biomedisa_deeplearning.py C:\Users\%USERNAME%\Downloads\testing_axial_crop_pat13.nii.gz C:\Users\%USERNAME%\Downloads\heart.h5 -p -bs 6
144
+ python -m biomedisa.deeplearning C:\Users\%USERNAME%\Downloads\testing_axial_crop_pat13.nii.gz C:\Users\%USERNAME%\Downloads\heart.h5 -p -bs 6
172
145
  ```
173
146
 
174
147
  # Biomedisa Features
175
148
 
176
149
  #### Load and save data (such as Amira Mesh, TIFF, NRRD, NIfTI or DICOM)
177
150
  ```python
178
- import sys
179
- sys.path.append(path_to_biomedisa) # e.g. '/home/<user>/git/biomedisa'
180
- from biomedisa_features.biomedisa_helper import load_data, save_data
151
+ from biomedisa.biomedisa_features.biomedisa_helper import load_data, save_data
181
152
 
182
153
  # load data as numpy array
183
154
  # for DICOM, PNG files, or similar formats, 'path_to_data' must reference
@@ -190,10 +161,8 @@ save_data(path_to_data, data, header)
190
161
 
191
162
  #### Create STL mesh from segmentation (label values are saved as attributes)
192
163
  ```python
193
- import os, sys
194
- sys.path.append(path_to_biomedisa) # e.g. '/home/<user>/git/biomedisa'
195
- from biomedisa_features.biomedisa_helper import load_data, save_data
196
- from biomedisa_features.create_mesh import get_voxel_spacing, save_mesh
164
+ from biomedisa.biomedisa_features.biomedisa_helper import load_data, save_data
165
+ from biomedisa.mesh import get_voxel_spacing, save_mesh
197
166
 
198
167
  # load segmentation
199
168
  data, header, extension = load_data(path_to_data, return_extension=True)
@@ -209,7 +178,7 @@ save_mesh(path_to_data, data, x_res, y_res, z_res, poly_reduction=0.9, smoothing
209
178
 
210
179
  #### Create mesh directly
211
180
  ```
212
- python git/biomedisa/biomedisa_features/create_mesh.py <path_to_data>
181
+ python -m biomedisa.mesh <path_to_data>
213
182
  ```
214
183
 
215
184
  #### Options
@@ -225,9 +194,7 @@ python git/biomedisa/biomedisa_features/create_mesh.py <path_to_data>
225
194
 
226
195
  #### Resize data
227
196
  ```python
228
- import os, sys
229
- sys.path.append(path_to_biomedisa) # e.g. '/home/<user>/git/biomedisa'
230
- from biomedisa_features.biomedisa_helper import img_resize
197
+ from biomedisa.biomedisa_features.biomedisa_helper import img_resize
231
198
 
232
199
  # resize image data
233
200
  zsh, ysh, xsh = data.shape
@@ -240,7 +207,7 @@ label_data = img_resize(label_data, new_zsh, new_ysh, new_xsh, labels=True)
240
207
 
241
208
  #### Remove outliers and fill holes
242
209
  ```python
243
- from biomedisa_features.biomedisa_helper import clean, fill
210
+ from biomedisa.biomedisa_features.biomedisa_helper import clean, fill
244
211
 
245
212
  # delete outliers smaller than 90% of the segment
246
213
  label_data = clean(label_data, 0.9)
@@ -251,24 +218,28 @@ label_data = fill(label_data, 0.9)
251
218
 
252
219
  #### Accuracy assessment
253
220
  ```python
254
- from biomedisa_features.biomedisa_helper import Dice_score, ASSD
221
+ from biomedisa.biomedisa_features.biomedisa_helper import Dice_score, ASSD
255
222
  dice = Dice_score(ground_truth, result)
256
223
  assd = ASSD(ground_truth, result)
257
224
  ```
258
225
 
259
226
  # Update Biomedisa
260
- If you have used `git clone`, change to the Biomedisa directory and make a pull request.
227
+ If you installed Biomedisa via Pip.
228
+ ```
229
+ pip install --upgrade biomedisa
230
+ ```
231
+ If you used `git clone`, change to the Biomedisa directory and make a pull request.
261
232
  ```
262
233
  cd git/biomedisa
263
234
  git pull
264
235
  ```
265
236
 
266
- If you have installed the browser based version of Biomedisa (including MySQL database), you also need to update the database.
237
+ If you installed the browser based version of Biomedisa (including MySQL database), you also need to update the database.
267
238
  ```
268
239
  python manage.py migrate
269
240
  ```
270
241
 
271
- If you have installed an [Apache Server](https://github.com/biomedisa/biomedisa/blob/master/README/APACHE_SERVER.md), you need to restart the server.
242
+ If you installed an [Apache Server](https://github.com/biomedisa/biomedisa/blob/master/README/APACHE_SERVER.md), you need to restart the server.
272
243
  ```
273
244
  sudo service apache2 restart
274
245
  ```
File without changes
File without changes