biomedisa 2024.5.18__py3-none-any.whl → 2024.5.20__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/__init__.py +2 -6
- biomedisa/deeplearning.py +88 -91
- biomedisa/{biomedisa_features → features}/DataGenerator.py +1 -1
- biomedisa/{biomedisa_features → features}/DataGeneratorCrop.py +1 -1
- biomedisa/{biomedisa_features → features}/PredictDataGenerator.py +1 -1
- biomedisa/{biomedisa_features → features}/PredictDataGeneratorCrop.py +1 -1
- biomedisa/{biomedisa_features → features}/active_contour.py +15 -18
- biomedisa/{biomedisa_features → features}/assd.py +1 -1
- biomedisa/{biomedisa_features → features}/biomedisa_helper.py +107 -117
- biomedisa/{biomedisa_features → features}/create_slices.py +51 -60
- biomedisa/{biomedisa_features → features}/crop_helper.py +111 -116
- biomedisa/{biomedisa_features → features}/curvop_numba.py +1 -1
- biomedisa/{biomedisa_features → features}/django_env.py +9 -10
- biomedisa/{biomedisa_features → features}/keras_helper.py +143 -170
- biomedisa/{biomedisa_features → features}/nc_reader.py +1 -1
- biomedisa/{biomedisa_features → features}/pid.py +2 -2
- biomedisa/{biomedisa_features → features}/process_image.py +12 -14
- biomedisa/{biomedisa_features → features}/pycuda_test.py +2 -1
- biomedisa/{biomedisa_features → features}/random_walk/gpu_kernels.py +2 -1
- biomedisa/{biomedisa_features → features}/random_walk/pycuda_large.py +2 -2
- biomedisa/{biomedisa_features → features}/random_walk/pycuda_large_allx.py +2 -2
- biomedisa/{biomedisa_features → features}/random_walk/pycuda_small.py +2 -2
- biomedisa/{biomedisa_features → features}/random_walk/pycuda_small_allx.py +2 -2
- biomedisa/{biomedisa_features → features}/random_walk/pyopencl_large.py +1 -1
- biomedisa/{biomedisa_features → features}/random_walk/pyopencl_small.py +1 -1
- biomedisa/{biomedisa_features → features}/random_walk/rw_large.py +11 -11
- biomedisa/{biomedisa_features → features}/random_walk/rw_small.py +12 -12
- biomedisa/{biomedisa_features → features}/remove_outlier.py +13 -16
- biomedisa/features/split_volume.py +167 -0
- biomedisa/interpolation.py +10 -12
- biomedisa/mesh.py +9 -12
- {biomedisa-2024.5.18.dist-info → biomedisa-2024.5.20.dist-info}/METADATA +15 -16
- biomedisa-2024.5.20.dist-info/RECORD +44 -0
- biomedisa/biomedisa_features/split_volume.py +0 -274
- biomedisa-2024.5.18.dist-info/RECORD +0 -44
- /biomedisa/{biomedisa_features → features}/__init__.py +0 -0
- /biomedisa/{biomedisa_features → features}/amira_to_np/__init__.py +0 -0
- /biomedisa/{biomedisa_features → features}/amira_to_np/amira_data_stream.py +0 -0
- /biomedisa/{biomedisa_features → features}/amira_to_np/amira_grammar.py +0 -0
- /biomedisa/{biomedisa_features → features}/amira_to_np/amira_header.py +0 -0
- /biomedisa/{biomedisa_features → features}/amira_to_np/amira_helper.py +0 -0
- /biomedisa/{biomedisa_features → features}/random_walk/__init__.py +0 -0
- {biomedisa-2024.5.18.dist-info → biomedisa-2024.5.20.dist-info}/LICENSE +0 -0
- {biomedisa-2024.5.18.dist-info → biomedisa-2024.5.20.dist-info}/WHEEL +0 -0
- {biomedisa-2024.5.18.dist-info → biomedisa-2024.5.20.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,44 @@
|
|
1
|
+
biomedisa/__init__.py,sha256=RxXuOh-e-W9k7pvmKDyYZz3bbze7AkB7RgRpUCzLbcE,1538
|
2
|
+
biomedisa/__main__.py,sha256=a1--8vhtztWEloHVtbM43FZLCfrFo4BELgdsgtWE8ls,536
|
3
|
+
biomedisa/deeplearning.py,sha256=dVwLkijm0ibtn6zUUV3t2WK6Fzvks4VlgzKNLqzDpAQ,27064
|
4
|
+
biomedisa/interpolation.py,sha256=R8UbBWt7vOuiQCPSeNIpEY0_yfQUg1oBfhAjXi91Hl4,17253
|
5
|
+
biomedisa/mesh.py,sha256=glvpTN0PPByb5j2IbLCdWQtc5O4VT-Pwu3en8EaYyTo,15819
|
6
|
+
biomedisa/features/DataGenerator.py,sha256=bGys6UZ0bnKb_k1Y3Spo6MNPk_goSAmptdZnI39smaw,12770
|
7
|
+
biomedisa/features/DataGeneratorCrop.py,sha256=23R4Z-8tB1CsjYTYfhHGovlJpAny_q9OV9hq8kc2GJg,5454
|
8
|
+
biomedisa/features/PredictDataGenerator.py,sha256=JH8SPGQm-Y7_Drec2fw3jBUupvpIkQ1FvkDXP7mUjDY,4074
|
9
|
+
biomedisa/features/PredictDataGeneratorCrop.py,sha256=HF5tJbGtlJMHr7lMT9IiIdLG2CTjXstbKoOjlZJ93Is,3431
|
10
|
+
biomedisa/features/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
11
|
+
biomedisa/features/active_contour.py,sha256=n5_vAD8jvQjU6fQ6A9hxjSmtkLLo_1fl0S5q1H2pmVg,18096
|
12
|
+
biomedisa/features/assd.py,sha256=q9NUQXEoA4Pi3d8b5fmys615CWu06Sm0N9-OGwJOFnw,6537
|
13
|
+
biomedisa/features/biomedisa_helper.py,sha256=iLbt4RpCU3EK51uiMefkM0321AgBdeLgrT-X4d--YJY,32250
|
14
|
+
biomedisa/features/create_slices.py,sha256=tLDJmuJFN8teTiCYvMauExfVzT2ZUF28VcPXpo4sOsE,13001
|
15
|
+
biomedisa/features/crop_helper.py,sha256=si72n9Q-C7U0cXYOD9Ux2UqIbZdXbZSOARBYDeqRggI,24533
|
16
|
+
biomedisa/features/curvop_numba.py,sha256=AjKQJcUBoURTB8pq1HmugQYpBwBELthhcEu51_r_xPI,7049
|
17
|
+
biomedisa/features/django_env.py,sha256=pdiPcBpqu1BWuyvh-palIGVwHFaY-leQ4Gatlbm8hIg,8942
|
18
|
+
biomedisa/features/keras_helper.py,sha256=1rM5-fMj71oW99VxEt2U3SZey1EbO9q5CNVJlmN6YxA,50250
|
19
|
+
biomedisa/features/nc_reader.py,sha256=RoRMwu3ELSNfoV3qZtaT2OWACnXb2EhNFu_DAF1T93o,7406
|
20
|
+
biomedisa/features/pid.py,sha256=Jmn1VIp0fBlgBrqZ-yUIQVVb5-NAxNBdibXALVr2PPI,2545
|
21
|
+
biomedisa/features/process_image.py,sha256=VtS3fGDvglqJiiJLPK1toe76J58j914NJ8XQKg3CRwo,11091
|
22
|
+
biomedisa/features/pycuda_test.py,sha256=UGAGIz_dgcCJkzjyCqnMlflp-WJPzpCtFQmE9C5DwIo,3275
|
23
|
+
biomedisa/features/remove_outlier.py,sha256=XhbFPkazMmEUZiP0FERdCkrXaLhwO095x4wcn-B3SdU,16756
|
24
|
+
biomedisa/features/split_volume.py,sha256=l106WXlDSDut-PlP9_O7WmJCp6euoViPjYG7awoA9Y8,8926
|
25
|
+
biomedisa/features/amira_to_np/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
26
|
+
biomedisa/features/amira_to_np/amira_data_stream.py,sha256=JrZTyKP01CKDFB5d9BlGtSFwBgoAo0AJeAmn3pADH88,32618
|
27
|
+
biomedisa/features/amira_to_np/amira_grammar.py,sha256=z1yajLHmn-GDb-rzZ5iHlKmPZDDbO9fNqP2jXf8z3KE,14324
|
28
|
+
biomedisa/features/amira_to_np/amira_header.py,sha256=eWHECsTx3ls8c0RHjy5xO4s-BehRC-96wONj7n9IzrY,11553
|
29
|
+
biomedisa/features/amira_to_np/amira_helper.py,sha256=giuZKkX8eI_2MVAy3wwBvcmmmDxSOo8k9eAzu2QA6uo,2218
|
30
|
+
biomedisa/features/random_walk/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
31
|
+
biomedisa/features/random_walk/gpu_kernels.py,sha256=IQDjq1H6iJCwdS-LCWx2S6F1TMEXjrN2veLcTLCeCoI,7191
|
32
|
+
biomedisa/features/random_walk/pycuda_large.py,sha256=Vfvd0uFRB-qLReDFKIyAAhdWDLflKMUEUAm_ZXSkPZs,32917
|
33
|
+
biomedisa/features/random_walk/pycuda_large_allx.py,sha256=zjy1Ai8D-foXjaT-6G33vGMANS1i00BBbLCTAMUfP5c,30677
|
34
|
+
biomedisa/features/random_walk/pycuda_small.py,sha256=rSwjq2DdtGyNGH1_EfiRQGSgEsCZqvVUrh1UN64AEc8,15786
|
35
|
+
biomedisa/features/random_walk/pycuda_small_allx.py,sha256=z4koEQNWqy3EYOhHbMkO8sP6mpl6R7i8mM6OEQQ4kUQ,18225
|
36
|
+
biomedisa/features/random_walk/pyopencl_large.py,sha256=q79AxG3p3qFjxfiAZfUK9I5BAYT2prq48yEEmpP1Yjk,31015
|
37
|
+
biomedisa/features/random_walk/pyopencl_small.py,sha256=opNlS-qzOa9qWafBNJdvf6r1aRAFf7_JXf6ISDnkdXE,17068
|
38
|
+
biomedisa/features/random_walk/rw_large.py,sha256=ZnITvk00Y11ZZlGuBRaJO1EwU0wYBdEwdpj9vvXCqF4,19805
|
39
|
+
biomedisa/features/random_walk/rw_small.py,sha256=RPzZe24YrEwYelJukDjvqaoD_SyhgdriEi7uV3kZGXI,14881
|
40
|
+
biomedisa-2024.5.20.dist-info/LICENSE,sha256=sehayP6UhydNnmstfL4yFR3genMRdpuUh6uZVWJN1H0,14152
|
41
|
+
biomedisa-2024.5.20.dist-info/METADATA,sha256=uM3KiOS5fzl6WFv8cNRgsCT-l4DnGzgZoBiDqPg_qXM,10677
|
42
|
+
biomedisa-2024.5.20.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
43
|
+
biomedisa-2024.5.20.dist-info/top_level.txt,sha256=opsf1Eb4vCguPSxev4HHSeiUKCccT_C_RcUCdAYbHWQ,10
|
44
|
+
biomedisa-2024.5.20.dist-info/RECORD,,
|
@@ -1,274 +0,0 @@
|
|
1
|
-
##########################################################################
|
2
|
-
## ##
|
3
|
-
## Copyright (c) 2024 Philipp Lösel. All rights reserved. ##
|
4
|
-
## ##
|
5
|
-
## This file is part of the open source project biomedisa. ##
|
6
|
-
## ##
|
7
|
-
## Licensed under the European Union Public Licence (EUPL) ##
|
8
|
-
## v1.2, or - as soon as they will be approved by the ##
|
9
|
-
## European Commission - subsequent versions of the EUPL; ##
|
10
|
-
## ##
|
11
|
-
## You may redistribute it and/or modify it under the terms ##
|
12
|
-
## of the EUPL v1.2. You may not use this work except in ##
|
13
|
-
## compliance with this Licence. ##
|
14
|
-
## ##
|
15
|
-
## You can obtain a copy of the Licence at: ##
|
16
|
-
## ##
|
17
|
-
## https://joinup.ec.europa.eu/page/eupl-text-11-12 ##
|
18
|
-
## ##
|
19
|
-
## Unless required by applicable law or agreed to in ##
|
20
|
-
## writing, software distributed under the Licence is ##
|
21
|
-
## distributed on an "AS IS" basis, WITHOUT WARRANTIES ##
|
22
|
-
## OR CONDITIONS OF ANY KIND, either express or implied. ##
|
23
|
-
## ##
|
24
|
-
## See the Licence for the specific language governing ##
|
25
|
-
## permissions and limitations under the Licence. ##
|
26
|
-
## ##
|
27
|
-
##########################################################################
|
28
|
-
|
29
|
-
import sys, os
|
30
|
-
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
31
|
-
sys.path.append(BASE_DIR)
|
32
|
-
from biomedisa_features.biomedisa_helper import load_data, save_data
|
33
|
-
import numpy as np
|
34
|
-
import subprocess
|
35
|
-
import platform
|
36
|
-
import glob
|
37
|
-
|
38
|
-
if __name__ == '__main__':
|
39
|
-
|
40
|
-
# path to data
|
41
|
-
path_to_data = sys.argv[1]
|
42
|
-
path_to_labels = sys.argv[2]
|
43
|
-
|
44
|
-
# get arguments
|
45
|
-
nump = 1
|
46
|
-
smooth = 0
|
47
|
-
overlap = 100
|
48
|
-
sub_z, sub_y, sub_x = 1, 1, 1
|
49
|
-
for i, val in enumerate(sys.argv):
|
50
|
-
if val in ['--split_z','-sz']:
|
51
|
-
sub_z = max(int(sys.argv[i+1]), 1)
|
52
|
-
if val in ['--split_y','-sy']:
|
53
|
-
sub_y = max(int(sys.argv[i+1]), 1)
|
54
|
-
if val in ['--split_x','-sx']:
|
55
|
-
sub_x = max(int(sys.argv[i+1]), 1)
|
56
|
-
if val in ['--overlap','-ol']:
|
57
|
-
overlap = max(int(sys.argv[i+1]), 0)
|
58
|
-
if val in ['-n','-np']:
|
59
|
-
nump = max(int(sys.argv[i+1]), 1)
|
60
|
-
if val in ['--smooth','-s']:
|
61
|
-
smooth = int(sys.argv[i+1])
|
62
|
-
uq = True if any(x in sys.argv for x in ['--uncertainty','-uq']) else False
|
63
|
-
allx = 1 if '-allx' in sys.argv else 0
|
64
|
-
|
65
|
-
# base directory
|
66
|
-
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
67
|
-
|
68
|
-
# clean tmp folder
|
69
|
-
filelist = glob.glob(BASE_DIR+'/tmp/*.tif')
|
70
|
-
for f in filelist:
|
71
|
-
os.remove(f)
|
72
|
-
|
73
|
-
# data shape
|
74
|
-
data, _ = load_data(path_to_data, 'split_volume')
|
75
|
-
shape = np.copy(np.array(data.shape), order='C')
|
76
|
-
zsh, ysh, xsh = shape
|
77
|
-
del data
|
78
|
-
|
79
|
-
# split volume
|
80
|
-
sub_size_z = np.ceil(zsh / sub_z)
|
81
|
-
sub_size_y = np.ceil(ysh / sub_y)
|
82
|
-
sub_size_x = np.ceil(xsh / sub_x)
|
83
|
-
|
84
|
-
# iterate over subvolumes
|
85
|
-
for sub_z_i in range(sub_z):
|
86
|
-
for sub_y_i in range(sub_y):
|
87
|
-
for sub_x_i in range(sub_x):
|
88
|
-
subvolume = sub_z_i*sub_y*sub_x + sub_y_i*sub_x + sub_x_i + 1
|
89
|
-
print('Subvolume:', subvolume, '/', sub_z*sub_y*sub_x)
|
90
|
-
|
91
|
-
# determine z subvolume
|
92
|
-
blockmin_z = int(sub_z_i * sub_size_z)
|
93
|
-
blockmax_z = int((sub_z_i+1) * sub_size_z)
|
94
|
-
datamin_z = max(blockmin_z - overlap, 0)
|
95
|
-
datamax_z = min(blockmax_z + overlap, zsh)
|
96
|
-
|
97
|
-
# determine y subvolume
|
98
|
-
blockmin_y = int(sub_y_i * sub_size_y)
|
99
|
-
blockmax_y = int((sub_y_i+1) * sub_size_y)
|
100
|
-
datamin_y = max(blockmin_y - overlap, 0)
|
101
|
-
datamax_y = min(blockmax_y + overlap, ysh)
|
102
|
-
|
103
|
-
# determine x subvolume
|
104
|
-
blockmin_x = int(sub_x_i * sub_size_x)
|
105
|
-
blockmax_x = int((sub_x_i+1) * sub_size_x)
|
106
|
-
datamin_x = max(blockmin_x - overlap, 0)
|
107
|
-
datamax_x = min(blockmax_x + overlap, xsh)
|
108
|
-
|
109
|
-
# extract image subvolume
|
110
|
-
data, _ = load_data(path_to_data, 'split_volume')
|
111
|
-
save_data(BASE_DIR+f'/tmp/sub_volume_{subvolume}.tif', data[datamin_z:datamax_z,datamin_y:datamax_y,datamin_x:datamax_x], False)
|
112
|
-
del data
|
113
|
-
|
114
|
-
# extract label subvolume
|
115
|
-
labelData, header, final_image_type = load_data(path_to_labels, 'split_volume', True)
|
116
|
-
save_data(BASE_DIR+'/tmp/labels.sub_volume.tif', labelData[datamin_z:datamax_z,datamin_y:datamax_y,datamin_x:datamax_x])
|
117
|
-
del labelData
|
118
|
-
|
119
|
-
# configure command
|
120
|
-
cmd = ['mpiexec', '-np', f'{nump}', 'python3', 'biomedisa_interpolation.py', BASE_DIR+f'/tmp/sub_volume_{subvolume}.tif', BASE_DIR+'/tmp/labels.sub_volume.tif', '-s', f'{smooth}']
|
121
|
-
if uq:
|
122
|
-
cmd.append('-uq')
|
123
|
-
if allx:
|
124
|
-
cmd.append('-allx')
|
125
|
-
cwd = BASE_DIR + '/demo/'
|
126
|
-
|
127
|
-
# run segmentation
|
128
|
-
if platform.system() == 'Windows':
|
129
|
-
cmd[3] = 'python'
|
130
|
-
cmd.insert(4, '-u')
|
131
|
-
p = subprocess.Popen(cmd, cwd=cwd, stdout=subprocess.PIPE)
|
132
|
-
for line in iter(p.stdout.readline, b''):
|
133
|
-
line = str(line,'utf-8')
|
134
|
-
print(line.rstrip())
|
135
|
-
p.stdout.close()
|
136
|
-
else:
|
137
|
-
p = subprocess.Popen(cmd, cwd=cwd)
|
138
|
-
p.wait()
|
139
|
-
|
140
|
-
# remove tmp files
|
141
|
-
os.remove(BASE_DIR+f'/tmp/sub_volume_{subvolume}.tif')
|
142
|
-
os.remove(BASE_DIR+'/tmp/labels.sub_volume.tif')
|
143
|
-
|
144
|
-
# create path_to_final
|
145
|
-
filename, extension = os.path.splitext(os.path.basename(path_to_data))
|
146
|
-
if extension == '.gz':
|
147
|
-
filename = filename[:-4]
|
148
|
-
filename = 'final.' + filename
|
149
|
-
path_to_final = path_to_data.replace(os.path.basename(path_to_data), filename + final_image_type)
|
150
|
-
|
151
|
-
# path_to_uq and path_to_smooth
|
152
|
-
filename, extension = os.path.splitext(path_to_final)
|
153
|
-
if extension == '.gz':
|
154
|
-
filename = filename[:-4]
|
155
|
-
path_to_smooth = filename + '.smooth' + final_image_type
|
156
|
-
path_to_uq = filename + '.uncertainty.tif'
|
157
|
-
|
158
|
-
# iterate over subvolumes
|
159
|
-
final = np.zeros((zsh, ysh, xsh), dtype=np.uint8)
|
160
|
-
for sub_z_i in range(sub_z):
|
161
|
-
for sub_y_i in range(sub_y):
|
162
|
-
for sub_x_i in range(sub_x):
|
163
|
-
subvolume = sub_z_i*sub_y*sub_x + sub_y_i*sub_x + sub_x_i + 1
|
164
|
-
print('Subvolume:', subvolume, '/', sub_z*sub_y*sub_x)
|
165
|
-
|
166
|
-
# determine z subvolume
|
167
|
-
blockmin_z = int(sub_z_i * sub_size_z)
|
168
|
-
blockmax_z = int((sub_z_i+1) * sub_size_z)
|
169
|
-
datamin_z = max(blockmin_z - overlap, 0)
|
170
|
-
datamax_z = min(blockmax_z + overlap, zsh)
|
171
|
-
|
172
|
-
# determine y subvolume
|
173
|
-
blockmin_y = int(sub_y_i * sub_size_y)
|
174
|
-
blockmax_y = int((sub_y_i+1) * sub_size_y)
|
175
|
-
datamin_y = max(blockmin_y - overlap, 0)
|
176
|
-
datamax_y = min(blockmax_y + overlap, ysh)
|
177
|
-
|
178
|
-
# determine x subvolume
|
179
|
-
blockmin_x = int(sub_x_i * sub_size_x)
|
180
|
-
blockmax_x = int((sub_x_i+1) * sub_size_x)
|
181
|
-
datamin_x = max(blockmin_x - overlap, 0)
|
182
|
-
datamax_x = min(blockmax_x + overlap, xsh)
|
183
|
-
|
184
|
-
# load subvolume
|
185
|
-
path_to_subvolume = BASE_DIR+f'/tmp/final.sub_volume_{subvolume}.tif'
|
186
|
-
if os.path.isfile(path_to_subvolume):
|
187
|
-
tmp, _ = load_data(path_to_subvolume)
|
188
|
-
final[blockmin_z:blockmax_z,blockmin_y:blockmax_y,blockmin_x:blockmax_x] \
|
189
|
-
= tmp[blockmin_z-datamin_z:blockmax_z-datamin_z,blockmin_y-datamin_y:blockmax_y-datamin_y,blockmin_x-datamin_x:blockmax_x-datamin_x]
|
190
|
-
os.remove(path_to_subvolume)
|
191
|
-
|
192
|
-
# save result
|
193
|
-
save_data(path_to_final, final, header)
|
194
|
-
|
195
|
-
# iterate over subvolumes (smooth)
|
196
|
-
smooth = 0
|
197
|
-
final.fill(0)
|
198
|
-
for sub_z_i in range(sub_z):
|
199
|
-
for sub_y_i in range(sub_y):
|
200
|
-
for sub_x_i in range(sub_x):
|
201
|
-
subvolume = sub_z_i*sub_y*sub_x + sub_y_i*sub_x + sub_x_i + 1
|
202
|
-
print('Subvolume:', subvolume, '/', sub_z*sub_y*sub_x)
|
203
|
-
|
204
|
-
# determine z subvolume
|
205
|
-
blockmin_z = int(sub_z_i * sub_size_z)
|
206
|
-
blockmax_z = int((sub_z_i+1) * sub_size_z)
|
207
|
-
datamin_z = max(blockmin_z - overlap, 0)
|
208
|
-
datamax_z = min(blockmax_z + overlap, zsh)
|
209
|
-
|
210
|
-
# determine y subvolume
|
211
|
-
blockmin_y = int(sub_y_i * sub_size_y)
|
212
|
-
blockmax_y = int((sub_y_i+1) * sub_size_y)
|
213
|
-
datamin_y = max(blockmin_y - overlap, 0)
|
214
|
-
datamax_y = min(blockmax_y + overlap, ysh)
|
215
|
-
|
216
|
-
# determine x subvolume
|
217
|
-
blockmin_x = int(sub_x_i * sub_size_x)
|
218
|
-
blockmax_x = int((sub_x_i+1) * sub_size_x)
|
219
|
-
datamin_x = max(blockmin_x - overlap, 0)
|
220
|
-
datamax_x = min(blockmax_x + overlap, xsh)
|
221
|
-
|
222
|
-
# load subvolume
|
223
|
-
path_to_subvolume = BASE_DIR+f'/tmp/final.sub_volume_{subvolume}.smooth.tif'
|
224
|
-
if os.path.isfile(path_to_subvolume):
|
225
|
-
tmp, _ = load_data(path_to_subvolume)
|
226
|
-
final[blockmin_z:blockmax_z,blockmin_y:blockmax_y,blockmin_x:blockmax_x] \
|
227
|
-
= tmp[blockmin_z-datamin_z:blockmax_z-datamin_z,blockmin_y-datamin_y:blockmax_y-datamin_y,blockmin_x-datamin_x:blockmax_x-datamin_x]
|
228
|
-
os.remove(path_to_subvolume)
|
229
|
-
smooth = 1
|
230
|
-
|
231
|
-
# save result
|
232
|
-
if smooth:
|
233
|
-
save_data(path_to_smooth, final, header)
|
234
|
-
|
235
|
-
# iterate over subvolumes (uncertainty)
|
236
|
-
uncertainty = 0
|
237
|
-
final.fill(0)
|
238
|
-
for sub_z_i in range(sub_z):
|
239
|
-
for sub_y_i in range(sub_y):
|
240
|
-
for sub_x_i in range(sub_x):
|
241
|
-
subvolume = sub_z_i*sub_y*sub_x + sub_y_i*sub_x + sub_x_i + 1
|
242
|
-
print('Subvolume:', subvolume, '/', sub_z*sub_y*sub_x)
|
243
|
-
|
244
|
-
# determine z subvolume
|
245
|
-
blockmin_z = int(sub_z_i * sub_size_z)
|
246
|
-
blockmax_z = int((sub_z_i+1) * sub_size_z)
|
247
|
-
datamin_z = max(blockmin_z - overlap, 0)
|
248
|
-
datamax_z = min(blockmax_z + overlap, zsh)
|
249
|
-
|
250
|
-
# determine y subvolume
|
251
|
-
blockmin_y = int(sub_y_i * sub_size_y)
|
252
|
-
blockmax_y = int((sub_y_i+1) * sub_size_y)
|
253
|
-
datamin_y = max(blockmin_y - overlap, 0)
|
254
|
-
datamax_y = min(blockmax_y + overlap, ysh)
|
255
|
-
|
256
|
-
# determine x subvolume
|
257
|
-
blockmin_x = int(sub_x_i * sub_size_x)
|
258
|
-
blockmax_x = int((sub_x_i+1) * sub_size_x)
|
259
|
-
datamin_x = max(blockmin_x - overlap, 0)
|
260
|
-
datamax_x = min(blockmax_x + overlap, xsh)
|
261
|
-
|
262
|
-
# load subvolume
|
263
|
-
path_to_subvolume = BASE_DIR+f'/tmp/final.sub_volume_{subvolume}.uncertainty.tif'
|
264
|
-
if os.path.isfile(path_to_subvolume):
|
265
|
-
tmp, _ = load_data(path_to_subvolume)
|
266
|
-
final[blockmin_z:blockmax_z,blockmin_y:blockmax_y,blockmin_x:blockmax_x] \
|
267
|
-
= tmp[blockmin_z-datamin_z:blockmax_z-datamin_z,blockmin_y-datamin_y:blockmax_y-datamin_y,blockmin_x-datamin_x:blockmax_x-datamin_x]
|
268
|
-
os.remove(path_to_subvolume)
|
269
|
-
uncertainty = 1
|
270
|
-
|
271
|
-
# save result
|
272
|
-
if uncertainty:
|
273
|
-
save_data(path_to_uq, final, header)
|
274
|
-
|
@@ -1,44 +0,0 @@
|
|
1
|
-
biomedisa/__init__.py,sha256=BLbuGv-c8I8XMzOOnc07qrcWxq8CUA5NM73S3gkixEI,1690
|
2
|
-
biomedisa/__main__.py,sha256=a1--8vhtztWEloHVtbM43FZLCfrFo4BELgdsgtWE8ls,536
|
3
|
-
biomedisa/deeplearning.py,sha256=eobgRva1ucb1IKpj7SNxmBOsWdZCPAJ-BNbIKnApNeA,27063
|
4
|
-
biomedisa/interpolation.py,sha256=mz5Ieiee2RftqisqNzKcCU7IV1n0LGON4zyhvBwE94s,17335
|
5
|
-
biomedisa/mesh.py,sha256=6f5klVPoA3zmF3jxLCOUkCXelLtlroS6tJquRHaMwsQ,15920
|
6
|
-
biomedisa/biomedisa_features/DataGenerator.py,sha256=FTktX35_FboSzk4UXG_ZN58xXYJqwjX_7ZJ65bzNuFs,12770
|
7
|
-
biomedisa/biomedisa_features/DataGeneratorCrop.py,sha256=cL_1rbXSq79vCNAHnIwvow-J1s-4gWStR1pWTbF_VTY,5454
|
8
|
-
biomedisa/biomedisa_features/PredictDataGenerator.py,sha256=MISkB2tlxCw6rd8pfwwz1clVnvyPwg5dB-8yxR6WsBw,4074
|
9
|
-
biomedisa/biomedisa_features/PredictDataGeneratorCrop.py,sha256=JBwFcOZMakNMlL5UvP5bNg9FlQl5sbrM9UVSCyFhwBQ,3431
|
10
|
-
biomedisa/biomedisa_features/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
11
|
-
biomedisa/biomedisa_features/active_contour.py,sha256=PUAfCzHKU-p7xeQoWxmDh0ZFbnInXEsafgeE1k-96d0,18131
|
12
|
-
biomedisa/biomedisa_features/assd.py,sha256=cXHAhwJqhwOvzgTodlQb21NvYafWTjBJ7_H_icuBNMU,6537
|
13
|
-
biomedisa/biomedisa_features/biomedisa_helper.py,sha256=fY7kHLg5VBLF4f_W-p9tZaeqZn6wCq9OHPImZC41GRU,32401
|
14
|
-
biomedisa/biomedisa_features/create_slices.py,sha256=gQJev1-DXvqDchGbnLC1bsCtb1gAnv4D82IgOnCJVt8,13329
|
15
|
-
biomedisa/biomedisa_features/crop_helper.py,sha256=Op8x10IltAR_5YMotuVHzF3hSbxiOkAchhJM5L0qutw,23894
|
16
|
-
biomedisa/biomedisa_features/curvop_numba.py,sha256=9jc4OvHQ6JDN-DaFhRQMLpBDU85HhqzX_YUVBf3Q3vA,7049
|
17
|
-
biomedisa/biomedisa_features/django_env.py,sha256=S-ajQpw5A2aBlTYgn_FiyIr02QH05rInzhBDulb9lNg,8989
|
18
|
-
biomedisa/biomedisa_features/keras_helper.py,sha256=J4VZNPgdoQSH5wnCcdkubRhxquNmPOUzEAlSkTZltuw,50343
|
19
|
-
biomedisa/biomedisa_features/nc_reader.py,sha256=7uwdmz4pLC__xb8hWjZ7Y9jrkNJOyD01kIA1EOP8GV0,7406
|
20
|
-
biomedisa/biomedisa_features/pid.py,sha256=HAIq52F-PKwDGRyKE74qsY-bdBTs1s85vcIQTKaMIy8,2528
|
21
|
-
biomedisa/biomedisa_features/process_image.py,sha256=yxBC3ACV2umscEycXZtY9Hsi1ATws7omnvXROEDfQfA,11159
|
22
|
-
biomedisa/biomedisa_features/pycuda_test.py,sha256=LLd5JnlDu1hOZUTFs8IbuE2I2sBSRyZaU3sRdNpdy5Y,3274
|
23
|
-
biomedisa/biomedisa_features/remove_outlier.py,sha256=V-3E7w3SGwmHMBCk1QzVoUJFdMV_NEYkUZG_-R15bqI,16801
|
24
|
-
biomedisa/biomedisa_features/split_volume.py,sha256=yBdoO3ojEphnfs9P-Ap8NPFrmb-WM8CCZSV9deIEASs,12394
|
25
|
-
biomedisa/biomedisa_features/amira_to_np/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
26
|
-
biomedisa/biomedisa_features/amira_to_np/amira_data_stream.py,sha256=JrZTyKP01CKDFB5d9BlGtSFwBgoAo0AJeAmn3pADH88,32618
|
27
|
-
biomedisa/biomedisa_features/amira_to_np/amira_grammar.py,sha256=z1yajLHmn-GDb-rzZ5iHlKmPZDDbO9fNqP2jXf8z3KE,14324
|
28
|
-
biomedisa/biomedisa_features/amira_to_np/amira_header.py,sha256=eWHECsTx3ls8c0RHjy5xO4s-BehRC-96wONj7n9IzrY,11553
|
29
|
-
biomedisa/biomedisa_features/amira_to_np/amira_helper.py,sha256=giuZKkX8eI_2MVAy3wwBvcmmmDxSOo8k9eAzu2QA6uo,2218
|
30
|
-
biomedisa/biomedisa_features/random_walk/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
31
|
-
biomedisa/biomedisa_features/random_walk/gpu_kernels.py,sha256=r8BsyOU_a5tYMM8d_mS9MPrUCXoTFI7NY8JIQnyfe0U,7190
|
32
|
-
biomedisa/biomedisa_features/random_walk/pycuda_large.py,sha256=_dfYP2cFSm0aKU6n_YotsdNLZcvO8OjE5hYbgeAQk98,32917
|
33
|
-
biomedisa/biomedisa_features/random_walk/pycuda_large_allx.py,sha256=Cfb_cq184LgfdiSTImQu7Ax8L_EKQgpXfSVapYGXy0E,30677
|
34
|
-
biomedisa/biomedisa_features/random_walk/pycuda_small.py,sha256=691oa8JhVwDmS-y7KnNbVUziW14fAtC-lvB3rg2VWA4,15786
|
35
|
-
biomedisa/biomedisa_features/random_walk/pycuda_small_allx.py,sha256=8bNHDKDxa-02q1ykWo_YWjzYQkM77raX_DivpWkVoQY,18225
|
36
|
-
biomedisa/biomedisa_features/random_walk/pyopencl_large.py,sha256=cOBhvxrdKCkbr6xaKneBTiUMXPk9lSdjwt95TdHC2EY,31015
|
37
|
-
biomedisa/biomedisa_features/random_walk/pyopencl_small.py,sha256=2XALYNNv9D8Gb1u2lcjR1O4W9UM0Xxjj0r4nr-NiEkk,17068
|
38
|
-
biomedisa/biomedisa_features/random_walk/rw_large.py,sha256=FERIsTXmqZprGCTShRR75PesIX5MMVtptk-SqI-4abo,19805
|
39
|
-
biomedisa/biomedisa_features/random_walk/rw_small.py,sha256=0YFL0Ovb_400Ikbxv5yOXWskl3vAyfQ_0_Gz5EXzvVQ,14881
|
40
|
-
biomedisa-2024.5.18.dist-info/LICENSE,sha256=sehayP6UhydNnmstfL4yFR3genMRdpuUh6uZVWJN1H0,14152
|
41
|
-
biomedisa-2024.5.18.dist-info/METADATA,sha256=Ck2qVtPA2ayKHrT0Rq7MUKl9wSWlvp9XNKxQ5HsTsHU,10748
|
42
|
-
biomedisa-2024.5.18.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
43
|
-
biomedisa-2024.5.18.dist-info/top_level.txt,sha256=opsf1Eb4vCguPSxev4HHSeiUKCccT_C_RcUCdAYbHWQ,10
|
44
|
-
biomedisa-2024.5.18.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|