Bläddra i källkod

gin commit from SUND33778

Modified files: 2
Frederik Filip Stæger 4 år sedan
förälder
incheckning
8e44ce86d0

+ 1 - 6
template_creation_pipeline/helper_functions.py

@@ -42,7 +42,7 @@ def files_ind_dir_wo_string(path, exclusion_string):
 
 
 # Get list of images with specific file type in folders. Also returns list of folders.
-def images_in_folders(path, file_tyoe=''):
+def images_in_folders(path, file_type=''):
     path_list = []
     folder_list = []
     for folder in os.listdir(path):
@@ -162,11 +162,6 @@ def identity_transform(work_dir, dimensions):
     return path
 
 
-# Convert int to string with two places (1, 7, 13) --> (01, 07, 13).
-def pretty(i):
-    return '0' + str(i) if i < 10 else str(i)
-
-
 # Returns True i given path exists.
 def path_exists(path):
     return True if os.path.exists(path) else False

+ 1 - 1
template_creation_pipeline/main.py

@@ -29,7 +29,7 @@ def pre_process_brain_tiffs(tif_path, result_path, mouse_id):
 
     # Loop through each image and pre-process.
     for image_nr, image_path in enumerate(images, 1):
-        image_nr_beauty = hf.pretty(image_nr)
+        image_nr_beauty = str(image_nr).zfill(2)
         output = result_path + mouse_id + '_S' + image_nr_beauty + '.nii'
         if not os.path.exists(output):
             pre_process(image_path, output)