Parameters¶
Adding -params¶
Definition of the sequence of nodes in processing pipelines, as well as general parameters, are specified by json file. When specifying a -species and -soft (see Commands), the corresponding default parameter file will be used; They are located in the workflows directory of the package.
The original parameter file can be altered by some options in -soft (e.g. _robustreg, _prep, etc.; see Commands).
Here is an example of the params.json with parameters -soft ANTS_skull for -species macaque:
{ "general": { "template_name": "NMT_v2.0_asym" }, "short_preparation_pipe": { "aladin_T2_on_T1":{}, "crop_aladin_pipe": { "reg_T1_on_template": { } }, "pad_template": { "copy_header" : true, "operation" : "PadImage", "op2" : "70" } }, "N4debias": { "dimension": 3, "bspline_fitting_distance": 200, "n_iterations": [50, 50, 40, 30], "convergence_threshold": 1e-08, "shrink_factor": 2, "args": "-r 0 --verbose 1" }, "extract_pipe": { "atlas_brex": { "f": 0.5, "reg": 1, "wrp": "10,10,10", "msk": "a,0,0", "dil": 2, "nrm": 1 } }, "debias": { "s": 4 }, "brain_segment_pipe": { "reg": { "n": 2, "m": "ref", "dof": 12 }, "segment_atropos_pipe": { "use_priors": 0.0, "Atropos": { "dimension": 3 }, "tissue_dict": { "gm": [2, 3], "wm": 4, "csf": [1, 5] } }, "export_5tt_pipe": {}, "IsoSurface_brain_pipe": { "merge_brain_tissues": { "keep_indexes": [2, 3, 4] } } }, "skull_petra_pipe": { "petra_head_auto_mask": { "kmeans": true, "sample_bins": 3, "distance": 1, "operation": "lower", "index": 1 }, "petra_head_dilate": { "operation": "modal", "kernel_shape": "boxv", "kernel_size": 7.0 }, "petra_head_erode": { "kernel_shape": "boxv", "kernel_size": 7.0 }, "petra_fast": { "args": " -l 10", "img_type": 3, "output_biascorrected": true, "output_biasfield": true }, "petra_head_erode_skin": { "kernel_shape": "boxv", "kernel_size": 12.0 }, "petra_skull_dilate": { "operation": "modal", "kernel_shape": "boxv", "kernel_size": 7.0 }, "petra_skull_erode": { "kernel_shape": "boxv", "kernel_size": 7.0 }, "petra_skull_fov": { "brainsize": 45 } }, "skull_t1_pipe": { "use_debiased_t1": {}, "t1_head_auto_mask": { "kmeans": true, "sample_bins": 30, "distance": 1, "operation": "lower", "index": 1 }, "t1_head_dilate": { "operation": "modal", "kernel_shape": "boxv", "kernel_size": 9.0 }, "t1_head_erode": { "kernel_shape": "boxv", "kernel_size": 9.0 }, "t1_fast": { "args": "-l 10", "img_type": 1, "output_biascorrected": true, "output_biasfield": true }, "t1_head_erode_skin": { "kernel_shape": "boxv", "kernel_size": 9.0 }, "t1_skull_dilate": { "operation": "modal", "kernel_shape": "boxv", "kernel_size": 4.0 }, "t1_skull_erode": { "kernel_shape": "boxv", "kernel_size": 4.0 }, "t1_skull_fov": { "brainsize": 45 } }, "skull_ct_pipe": { "align_ct_on_T1_2": { }, "ct_skull_auto_mask": { "kmeans": true, "sample_bins": 30, "distance": 10, "operation": "lower", "index": 2 }, "ct_skull_dilate": { "operation" : "modal", "kernel_shape" : "boxv", "kernel_size" : 3.0 }, "ct_skull_erode": { "kernel_shape" : "boxv", "kernel_size" : 3.0 }, "ct_skull_fov": { "brainsize" : 45 } }, "angio_pipe": { "angio_denoise": { "shrink_factor": 1 }, "angio_fast": { "args": " -l 10", "img_type": 3, "output_biascorrected": true, "output_biasfield": true } } }
It is also possible to alter values of some nodes for individual sessions/subjects. See individual parameter section).
Note: Individual parameter will not modify the pipeline sequence itself, a value specified in indiv_params for a node that do not exists in params will ignored
Advanced parameters settings¶
For advanced user, it is however possible to pass the pipeline sequence as a params.json file. In this case all further alteration will be canceled.
Here is json file with all possible nodes to be tuned; Some node are optional, some nodes are exclusive with each other (XOR). All parameters given here are give as examples and may vary
{
"skull_t1_pipe":
{
"t1_head_mask_thr":
{
"params": "Threshold (FSL)",
"thr": "300"
},
"comment": "OR",
"t1_head_auto_mask":
{
"params": "mask_auto_img (python)",
"kmeans": true,
"operation": "lower",
"index": 2
},
"t1_head_dilate":
{
"params": "DilateImage (FSL)",
"operation" : "modal",
"kernel_shape" : "boxv",
"kernel_size" : 13.0
},
"t1_head_erode":
{
"params": "ErodeImage (FSL)",
"kernel_shape" : "boxv",
"kernel_size" : 13.0
},
"t1_debias":
{
"comment": "OPTIONAL",
"params": "N4BiasFieldCorrection (ANTS)"
},
"t1_fast":
{
"params": "FAST (FSL)",
},
"t1_skull_auto_mask":
{
"comment": "OPTIONAL",
"params": "mask_auto_img (python)",
"kmeans": true,
"operation": "lower",
"index": 2
},
"comment": "OR",
"t1_skull_mask_thr":
{
"comment": "OPTIONAL",
"params": "Threshold (FSL)",
"thr": "300"
},
"t1_head_erode_skin":
{
"comment": "OPTIONAL",
"params": "ErodeImage (FSL)",
"kernel_shape" : "boxv",
"kernel_size" : 14.0
},
"t1_skull_dilate":
{
"params": "DilateImage (FSL)",
"operation" : "modal",
"kernel_shape" : "boxv",
"kernel_size" : 13.0
},
"t1_skull_erode":
{
"params": "ErodeImage (FSL)",
"kernel_shape" : "boxv",
"kernel_size" : 13.0
},
"t1_skull_fov":
{
"comment": "OPTIONAL",
"params": "RobustFOV (FSL)",
"brainsize" : "45",
},
},
"skull_ct_pipe":
{
"align_ct_on_T1_2":
{
"comment": "OPTIONAL",
"comment": "Cannot be modified",
"params": "RegAladin (NiftyReg)"
},
"ct_head_mask_thr":
{
"params": "Threshold (FSL)",
"thr": "300"
},
"comment": "OR",
"ct_head_auto_mask":
{
"params": "mask_auto_img (python)",
"kmeans": true,
"operation": "lower",
"index": 2
},
"ct_skull_dilate":
{
"params": "DilateImage (FSL)",
"operation" : "modal",
"kernel_shape" : "boxv",
"kernel_size" : 13.0
},
"ct_skull_erode":
{
"params": "ErodeImage (FSL)",
"kernel_shape" : "boxv",
"kernel_size" : 13.0
}
},
"skull_petra_pipe":
{
"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":
{
"params": "Threshold (FSL)",
"thr": "300"
},
"comment": "OR",
"petra_head_auto_mask":
{
"params": "mask_auto_img (python)",
"kmeans": true,
"operation": "lower",
"index": 2
},
"petra_head_dilate":
{
"params": "DilateImage (FSL)",
"operation" : "modal",
"kernel_shape" : "boxv",
"kernel_size" : 13.0
},
"petra_head_erode":
{
"params": "ErodeImage (FSL)",
"kernel_shape" : "boxv",
"kernel_size" : 13.0
},
"petra_debias":
{
"comment": "OPTIONAL",
"params": "N4BiasFieldCorrection (ANTS)"
},
"petra_fast":
{
"params": "FAST (FSL)",
},
"petra_skull_auto_mask":
{
"comment": "OPTIONAL",
"params": "mask_auto_img (python)",
"kmeans": true,
"operation": "lower",
"index": 2
},
"comment": "OR",
"petra_skull_mask_thr":
{
"comment": "OPTIONAL",
"params": "Threshold (FSL)",
"thr": "300"
},
"petra_head_erode_skin":
{
"comment": "OPTIONAL",
"params": "ErodeImage (FSL)",
"kernel_shape" : "boxv",
"kernel_size" : 14.0
},
"petra_skull_dilate":
{
"params": "DilateImage (FSL)",
"operation" : "modal",
"kernel_shape" : "boxv",
"kernel_size" : 13.0
},
"petra_skull_erode":
{
"params": "ErodeImage (FSL)",
"kernel_shape" : "boxv",
"kernel_size" : 13.0
},
"petra_skull_fov":
{
"comment": "OPTIONAL",
"params": "RobustFOV (FSL)",
"brainsize" : "45",
},
},
"angio_pipe":
{
"angio_mask_thr":
{
"params": "Threshold (FSL)",
"thr": "300"
},
"comment": "OR",
"angio_auto_mask":
{
"params": "FAST (FSL)"
}
}
}
Note: The json file provided here only pass the node available in pipelines specific to skullTo3d processing. A functional pipeline will also require some pipeline sequence from macapype itself, a minima the definition of a short_preparation_pipe sequence of nodes. See macapype params page for more details.