nipype.interfaces.freesurfer.longitudinal module¶
Provides interfaces to various longitudinal commands provided by freesurfer
FuseSegmentations¶
Bases: FSCommand
Wrapped executable:
mri_fuse_segmentations
.fuse segmentations together from multiple timepoints
Examples
>>> from nipype.interfaces.freesurfer import FuseSegmentations >>> fuse = FuseSegmentations() >>> fuse.inputs.subject_id = 'tp.long.A.template' >>> fuse.inputs.timepoints = ['tp1', 'tp2'] >>> fuse.inputs.out_file = 'aseg.fused.mgz' >>> fuse.inputs.in_segmentations = ['aseg.mgz', 'aseg.mgz'] >>> fuse.inputs.in_segmentations_noCC = ['aseg.mgz', 'aseg.mgz'] >>> fuse.inputs.in_norms = ['norm.mgz', 'norm.mgz', 'norm.mgz'] >>> fuse.cmdline 'mri_fuse_segmentations -n norm.mgz -a aseg.mgz -c aseg.mgz tp.long.A.template tp1 tp2'
- Mandatory Inputs:
in_norms (a list of items which are a pathlike object or string representing an existing file) – -n <filename> - name of norm file to use (default: norm.mgs) must include the corresponding norm file for all given timepoints as well as for the current subject. Maps to a command-line argument:
-n %s
.in_segmentations (a list of items which are a pathlike object or string representing an existing file) – Name of aseg file to use (default: aseg.mgz) must include the aseg files for all the given timepoints. Maps to a command-line argument:
-a %s
.in_segmentations_noCC (a list of items which are a pathlike object or string representing an existing file) – Name of aseg file w/o CC labels (default: aseg.auto_noCCseg.mgz) must include the corresponding file for all the given timepoints. Maps to a command-line argument:
-c %s
.out_file (a pathlike object or string representing a file) – Output fused segmentation file.
timepoints (a list of items which are a string) – Subject_ids or timepoints to be processed. Maps to a command-line argument:
%s
(position: -2).- Optional Inputs:
args (a string) – Additional parameters to the command. Maps to a command-line argument:
%s
.environ (a dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’) – Environment variables. (Nipype default value:
{}
)subject_id (a string) – Subject_id being processed. Maps to a command-line argument:
%s
(position: -3).subjects_dir (a pathlike object or string representing an existing directory) – Subjects directory.
- Outputs:
out_file (a pathlike object or string representing a file) – Output fused segmentation file.
RobustTemplate¶
Bases: FSCommandOpenMP
Wrapped executable:
mri_robust_template
.construct an unbiased robust template for longitudinal volumes
Examples
>>> from nipype.interfaces.freesurfer import RobustTemplate >>> template = RobustTemplate() >>> template.inputs.in_files = ['structural.nii', 'functional.nii'] >>> template.inputs.auto_detect_sensitivity = True >>> template.inputs.average_metric = 'mean' >>> template.inputs.initial_timepoint = 1 >>> template.inputs.fixed_timepoint = True >>> template.inputs.no_iteration = True >>> template.inputs.subsample_threshold = 200 >>> template.cmdline #doctest: 'mri_robust_template --satit --average 0 --fixtp --mov structural.nii functional.nii --inittp 1 --noit --template mri_robust_template_out.mgz --subsample 200' >>> template.inputs.out_file = 'T1.nii' >>> template.cmdline #doctest: 'mri_robust_template --satit --average 0 --fixtp --mov structural.nii functional.nii --inittp 1 --noit --template T1.nii --subsample 200'>>> template.inputs.transform_outputs = ['structural.lta', ... 'functional.lta'] >>> template.inputs.scaled_intensity_outputs = ['structural-iscale.txt', ... 'functional-iscale.txt'] >>> template.cmdline 'mri_robust_template --satit --average 0 --fixtp --mov structural.nii functional.nii --inittp 1 --noit --template T1.nii --iscaleout .../structural-iscale.txt .../functional-iscale.txt --subsample 200 --lta .../structural.lta .../functional.lta'>>> template.inputs.transform_outputs = True >>> template.inputs.scaled_intensity_outputs = True >>> template.cmdline 'mri_robust_template --satit --average 0 --fixtp --mov structural.nii functional.nii --inittp 1 --noit --template T1.nii --iscaleout .../is1.txt .../is2.txt --subsample 200 --lta .../tp1.lta .../tp2.lta'>>> template.run()References
[https://surfer.nmr.mgh.harvard.edu/fswiki/mri_robust_template]
- Mandatory Inputs:
auto_detect_sensitivity (a boolean) – Auto-detect good sensitivity (recommended for head or full brain scans). Maps to a command-line argument:
--satit
. Mutually exclusive with inputs:outlier_sensitivity
.in_files (a list of items which are a pathlike object or string representing an existing file) – Input movable volumes to be aligned to common mean/median template. Maps to a command-line argument:
--mov %s
.out_file (a pathlike object or string representing a file) – Output template volume (final mean/median image). Maps to a command-line argument:
--template %s
. (Nipype default value:mri_robust_template_out.mgz
)outlier_sensitivity (a float) – Set outlier sensitivity manually (e.g. “–sat 4.685” ). Higher values mean less sensitivity. Maps to a command-line argument:
--sat %.4f
. Mutually exclusive with inputs:auto_detect_sensitivity
.- Optional Inputs:
args (a string) – Additional parameters to the command. Maps to a command-line argument:
%s
.average_metric (‘median’ or ‘mean’) – Construct template from: 0 Mean, 1 Median (default). Maps to a command-line argument:
--average %d
.environ (a dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’) – Environment variables. (Nipype default value:
{}
)fixed_timepoint (a boolean) – Map everything to init TP# (init TP is not resampled). Maps to a command-line argument:
--fixtp
.in_intensity_scales (a list of items which are a pathlike object or string representing an existing file) – Use initial intensity scales. Maps to a command-line argument:
--iscalein %s
.initial_timepoint (an integer) – Use TP# for special init (default random), 0: no init. Maps to a command-line argument:
--inittp %d
.initial_transforms (a list of items which are a pathlike object or string representing an existing file) – Use initial transforms (lta) on source. Maps to a command-line argument:
--ixforms %s
.intensity_scaling (a boolean) – Allow also intensity scaling (default off). Maps to a command-line argument:
--iscale
.no_iteration (a boolean) – Do not iterate, just create first template. Maps to a command-line argument:
--noit
.num_threads (an integer) – Allows for specifying more threads.
scaled_intensity_outputs (a list of items which are a pathlike object or string representing a file or a boolean) – Final intensity scales (will activate –iscale). Maps to a command-line argument:
--iscaleout %s
.subjects_dir (a pathlike object or string representing an existing directory) – Subjects directory.
subsample_threshold (an integer) – Subsample if dim > # on all axes (default no subs.). Maps to a command-line argument:
--subsample %d
.transform_outputs (a list of items which are a pathlike object or string representing a file or a boolean) – Output xforms to template (for each input). Maps to a command-line argument:
--lta %s
.- Outputs:
out_file (a pathlike object or string representing an existing file) – Output template volume (final mean/median image).
scaled_intensity_outputs (a list of items which are a pathlike object or string representing an existing file) – Output final intensity scales.
transform_outputs (a list of items which are a pathlike object or string representing an existing file) – Output xform files from moving to template.