File tree Expand file tree Collapse file tree 2 files changed +9
-8
lines changed
brats/preprocessing/project Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -16,14 +16,11 @@ def run(
16
16
data_path : str , parameters_file : str , output_path : str
17
17
) -> None :
18
18
19
- env = os .environ .copy ()
20
- env .update ({
21
- 'data_path' : data_path ,
22
- 'parameters_file' : parameters_file ,
23
- 'output_path' : output_path
24
- })
25
-
26
- process = subprocess .Popen ("./run.sh" , cwd = "." , env = env )
19
+ cmd = f"python3 preprocess.py --data_path={ data_path } \
20
+ --parameters_file { parameters_file } --output_path { output_path } "
21
+ splitted_cmd = cmd .split ()
22
+
23
+ process = subprocess .Popen (splitted_cmd , cwd = "." )
27
24
process .wait ()
28
25
29
26
class SanityCheckTask :
Original file line number Diff line number Diff line change 5
5
import yaml
6
6
import numpy as np
7
7
import nibabel as nib
8
+ from shutil import copyfile
8
9
from tqdm import tqdm
9
10
10
11
@@ -95,6 +96,9 @@ def main():
95
96
images_arr = get_data_arr (args .data_path )
96
97
save_processed_data (args .output_path , params ["output_filename" ], images_arr )
97
98
99
+ input_file = os .path .normpath (args .data_path + "/BraTS_example_seg.nii.gz" )
100
+ output_file = os .path .normpath (args .output_path + "/BraTS_example_seg.nii.gz" )
101
+ copyfile (input_file , output_file )
98
102
99
103
if __name__ == "__main__" :
100
104
main ()
You can’t perform that action at this time.
0 commit comments