diff --git a/examples_doc/params_skull.json b/examples_doc/params_skull.json index 61cc498..e719d9e 100644 --- a/examples_doc/params_skull.json +++ b/examples_doc/params_skull.json @@ -109,6 +109,14 @@ "skull_ct_pipe": { + "align_ct_on_T1_2": + { + + "comment": "OPTIONAL", + "comment": "Cannot be modified", + "params": "RegAladin (NiftyReg)" + + }, "ct_head_mask_thr": { "params": "Threshold (FSL)", @@ -149,12 +157,18 @@ "avg_reorient_pipe": { - "comment": "OPTIONAL", "params": "see corresponding doc in short_preparation_pipe in macapype" }, + "petra_itk_debias": + { + "comment": "OPTIONAL", + "params": "SimpleITK N4BiasFieldCorrectionImageFilter dirty wrap (defined in macapype.nodes.correc_bias)", + "comment": "Should be made a proper nipype node ", + + }, "petra_head_mask_thr": { diff --git a/skullTo3d/pipelines/skull_pipe.py b/skullTo3d/pipelines/skull_pipe.py index cd38a46..f8a9697 100644 --- a/skullTo3d/pipelines/skull_pipe.py +++ b/skullTo3d/pipelines/skull_pipe.py @@ -682,17 +682,18 @@ def create_skull_petra_pipe(name="skull_petra_pipe", params={}): skull_petra_pipe.connect(inputnode, "stereo_T1", align_petra_on_stereo_T1, "ref_file") - # Adding early petra_debias - petra_itk_debias = NodeParams( - interface=niu.Function( - input_names=["img_file"], - output_names=["cor_img_file", "bias_img_file"], - function=itk_debias), - params=parse_key(params, "petra_itk_debias"), - name="petra_itk_debias") - - skull_petra_pipe.connect(align_petra_on_stereo_T1, "out_file", - petra_itk_debias, "img_file") + if "petra_itk_debias" in params.keys(): + + # Adding early petra_debias + petra_itk_debias = pe.Node( + interface=niu.Function( + input_names=["img_file"], + output_names=["cor_img_file", "bias_img_file"], + function=itk_debias), + name="petra_itk_debias") + + skull_petra_pipe.connect(align_petra_on_stereo_T1, "out_file", + petra_itk_debias, "img_file") # ### head mask # headmask_threshold @@ -703,8 +704,14 @@ def create_skull_petra_pipe(name="skull_petra_pipe", params={}): params=parse_key(params, 'petra_head_mask_thr'), name="petra_head_mask_thr") - skull_petra_pipe.connect(petra_itk_debias, "cor_img_file", - petra_head_mask_thr, "in_file") + if "petra_itk_debias" in params.keys(): + + skull_petra_pipe.connect(petra_itk_debias, "cor_img_file", + petra_head_mask_thr, "in_file") + else: + + skull_petra_pipe.connect(align_petra_on_stereo_T1, "out_file", + petra_head_mask_thr, "in_file") skull_petra_pipe.connect( inputnode, ('indiv_params', parse_key, "petra_head_mask_thr"), @@ -720,8 +727,14 @@ def create_skull_petra_pipe(name="skull_petra_pipe", params={}): params=parse_key(params, "petra_head_auto_mask"), name="petra_head_auto_mask") - skull_petra_pipe.connect(petra_itk_debias, "cor_img_file", - petra_head_auto_mask, "img_file") + if "petra_itk_debias" in params.keys(): + + skull_petra_pipe.connect(petra_itk_debias, "cor_img_file", + petra_head_auto_mask, "img_file") + else: + + skull_petra_pipe.connect(align_petra_on_stereo_T1, "out_file", + petra_head_auto_mask, "img_file") skull_petra_pipe.connect( inputnode, ('indiv_params', parse_key, "petra_head_auto_mask"), @@ -791,8 +804,14 @@ def create_skull_petra_pipe(name="skull_petra_pipe", params={}): petra_hmasked = pe.Node(interface=ApplyMask(), name="petra_hmasked") - skull_petra_pipe.connect(petra_itk_debias, "cor_img_file", - petra_hmasked, "in_file") + if "petra_itk_debias" in params.keys(): + + skull_petra_pipe.connect(petra_itk_debias, "cor_img_file", + petra_hmasked, "in_file") + else: + + skull_petra_pipe.connect(align_petra_on_stereo_T1, "out_file", + petra_hmasked, "in_file") skull_petra_pipe.connect(petra_head_erode, "out_file", petra_hmasked, "mask_file") diff --git a/workflows/params_segment_marmo_ants_skull.json b/workflows/params_segment_marmo_ants_skull.json index 86f9e3e..9a379a8 100755 --- a/workflows/params_segment_marmo_ants_skull.json +++ b/workflows/params_segment_marmo_ants_skull.json @@ -98,7 +98,7 @@ } }, "skull_petra_pipe": - { + { "petra_itk_debias":{}, "petra_head_auto_mask": { "kmeans": true,