Commit 4f3593fc authored by Christoph Arthofer's avatar Christoph Arthofer
Browse files

lesion + brain mask for moving image in registration; mean for 2 iterations...

lesion + brain mask for moving image in registration; mean for 2 iterations and median for all following iterations; additional iteration 7
parent 0359cdb3
......@@ -404,19 +404,19 @@ def maskPreprocessing(tree):
fslmaths(tree.get('data/T1_brain_mask')).thr(0.1).bin().mul(7).add(1).inm(1).run(tree.get('T1_weighted_brain_mask'))
fslmaths(tree.get('data/lesion_mask_in_T1')).binv().mul(tree.get('T1_weighted_brain_mask')).run(tree.get('inverse_lesion_and_brain_mask_in_T1'))
def averageImages(img_paths, out_path, mod='average', norm_bool=False):
def averageImages(img_paths, out_path, mod='mean', norm_bool=False):
"""! Creates an average image from individual (non)normalised images.
@param img_paths: List of filepaths
@param out_path: Path to average/median output image
@param mod: Choose between 'average' or 'median' image.
@param mod: Choose between 'mean' or 'median' image.
@param norm_bool: Normalise intensities of each image before averaging true or false
"""
n_imgs = len(img_paths)
n_exist = 0
if mod == 'average':
if mod == 'mean':
for i, img_path in enumerate(img_paths):
if os.path.exists(img_path):
n_exist += 1
......@@ -1440,11 +1440,11 @@ if __name__ == "__main__":
if affine_on:
job_ids[28] = submitJob(script_path, tag + '_' + task_name, log_dir, queue=gpuq,
wait_for=list(itemgetter(*[21, 23, 24, 25, 26, 27, 28, 44, 45, 46, 47, 48, 50])(job_ids)),
array_task=True, coprocessor='-R 32', coprocessor_class=None, coprocessor_multi="1", threads=1, export_var=[export_var_str['SINGULARITY_BIND']], jobtime=jobtime_high)
array_task=True, coprocessor='cuda', coprocessor_class=None, coprocessor_multi="1", threads=1, export_var=[export_var_str['SINGULARITY_BIND']], jobram=32, jobtime=jobtime_high)
else:
job_ids[28] = submitJob(script_path, tag + '_' + task_name, log_dir, queue=gpuq,
wait_for=list(itemgetter(*[44, 45, 46, 47, 48, 50])(job_ids)),
array_task=True, coprocessor='-R 32', coprocessor_class=None, coprocessor_multi="1", threads=1, export_var=[export_var_str['SINGULARITY_BIND']], jobtime=jobtime_high)
array_task=True, coprocessor='cuda', coprocessor_class=None, coprocessor_multi="1", threads=1, export_var=[export_var_str['SINGULARITY_BIND']], jobram=32, jobtime=jobtime_high)
print('submitted: ' + task_name)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment