1313
1414class ICA_AROMAInputSpec (CommandLineInputSpec ):
1515 feat_dir = Directory (exists = True , mandatory = True ,
16- argstr = '-feat %s' ,
17- xor = ['in_file' , 'mat_file' , 'fnirt_warp_file' , 'motion_parameters' ],
18- desc = 'If a feat directory exists and temporal filtering '
19- 'has not been run yet, ICA_AROMA can use the files in '
20- 'this directory.' )
16+ argstr = '-feat %s' ,
17+ xor = ['in_file' , 'mat_file' , 'fnirt_warp_file' , 'motion_parameters' ],
18+ desc = 'If a feat directory exists and temporal filtering '
19+ 'has not been run yet, ICA_AROMA can use the files in '
20+ 'this directory.' )
2121 in_file = File (exists = True , mandatory = True ,
22- argstr = '-i %s' , xor = ['feat_dir' ],
23- desc = 'volume to be denoised' )
22+ argstr = '-i %s' , xor = ['feat_dir' ],
23+ desc = 'volume to be denoised' )
2424 out_dir = Directory ('out' , mandatory = True ,
25- argstr = '-o %s' ,
26- desc = 'output directory' )
25+ argstr = '-o %s' ,
26+ desc = 'output directory' )
2727 mask = File (exists = True , argstr = '-m %s' , xor = ['feat_dir' ],
28- desc = 'path/name volume mask' )
28+ desc = 'path/name volume mask' )
2929 dim = traits .Int (argstr = '-dim %d' ,
30- desc = 'Dimensionality reduction when running '
31- 'MELODIC (defualt is automatic estimation)' )
30+ desc = 'Dimensionality reduction when running '
31+ 'MELODIC (defualt is automatic estimation)' )
3232 TR = traits .Float (argstr = '-tr %.3f' ,
33- desc = 'TR in seconds. If this is not specified '
34- 'the TR will be extracted from the '
35- 'header of the fMRI nifti file.' )
33+ desc = 'TR in seconds. If this is not specified '
34+ 'the TR will be extracted from the '
35+ 'header of the fMRI nifti file.' )
3636 melodic_dir = Directory (exists = True , argstr = '-meldir %s' ,
37- desc = 'path to MELODIC directory if MELODIC has already been run' )
38- mat_file = File (exists = True , mandatory = True ,
39- argstr = '-affmat %s' , xor = ['feat_dir' ],
40- desc = 'path/name of the mat-file describing the '
41- 'affine registration (e.g. FSL FLIRT) of the '
42- 'functional data to structural space (.mat file)' )
43- fnirt_warp_file = File (exists = True , mandatory = True ,
44- argstr = '-warp %s' , xor = ['feat_dir' ],
45- desc = 'File name of the warp-file describing '
46- 'the non-linear registration (e.g. FSL FNIRT) '
47- 'of the structural data to MNI152 space (.nii.gz)' )
37+ desc = 'path to MELODIC directory if MELODIC has already been run' )
38+ mat_file = File (exists = True , argstr = '-affmat %s' , xor = ['feat_dir' ],
39+ desc = 'path/name of the mat-file describing the '
40+ 'affine registration (e.g. FSL FLIRT) of the '
41+ 'functional data to structural space (.mat file)' )
42+ fnirt_warp_file = File (exists = True , argstr = '-warp %s' , xor = ['feat_dir' ],
43+ desc = 'File name of the warp-file describing '
44+ 'the non-linear registration (e.g. FSL FNIRT) '
45+ 'of the structural data to MNI152 space (.nii.gz)' )
4846 motion_parameters = File (exists = True , mandatory = True ,
49- argstr = '-mc %s' , xor = ['feat_dir' ],
50- desc = 'motion parameters file' )
47+ argstr = '-mc %s' , xor = ['feat_dir' ],
48+ desc = 'motion parameters file' )
5149 denoise_type = traits .Enum ('nonaggr' , 'aggr' , 'both' , 'no' , usedefault = True ,
52- mandatory = True , argstr = '-den %s' ,
53- desc = 'Type of denoising strategy: '
54- '-none: only classification, no denoising '
55- '-nonaggr (default): non-aggresssive denoising, i.e. partial component regression '
56- '-aggr: aggressive denoising, i.e. full component regression '
57- '-both: both aggressive and non-aggressive denoising (two outputs)' )
50+ mandatory = True , argstr = '-den %s' ,
51+ desc = 'Type of denoising strategy: '
52+ '-none: only classification, no denoising '
53+ '-nonaggr (default): non-aggresssive denoising, i.e. partial component regression '
54+ '-aggr: aggressive denoising, i.e. full component regression '
55+ '-both: both aggressive and non-aggressive denoising (two outputs)' )
5856
5957class ICA_AROMAOutputSpec (TraitedSpec ):
6058 aggr_denoised_file = File (exists = True ,
6159 desc = 'if generated: aggressively denoised volume' )
6260 nonaggr_denoised_file = File (exists = True ,
6361 desc = 'if generated: non aggressively denoised volume' )
6462 out_dir = Directory (exists = True ,
65- desc = 'directory contains (in addition to the denoised files): '
66- 'melodic.ica + classified_motion_components + '
67- 'classification_overview + feature_scores + melodic_ic_mni)' )
63+ desc = 'directory contains (in addition to the denoised files): '
64+ 'melodic.ica + classified_motion_components + '
65+ 'classification_overview + feature_scores + melodic_ic_mni)' )
6866
6967class ICA_AROMA (CommandLine ):
7068 """
69+ Interface for the ICA_AROMA.py script (v0.3 beta).
70+
71+ ICA-AROMA (i.e. 'ICA-based Automatic Removal Of Motion Artifacts') concerns
72+ a data-driven method to identify and remove motion-related independent
73+ components from fMRI data. To that end it exploits a small, but robust
74+ set of theoretically motivated features, preventing the need for classifier
75+ re-training and therefore providing direct and easy applicability.
76+
77+
78+ See link for further documentation: https://github.com/rhr-pruim/ICA-AROMA
79+
80+
7181
7282 Example
7383 -------
7484
7585 >>> from nipype.interfaces.fsl import ICA_AROMA
7686 >>> from nipype.testing import example_data
7787 >>> AROMA_obj = ICA_AROMA.ICA_AROMA()
78- >>> AROMA_obj.inputs.in_file=example_data( 'functional.nii')
79- >>> AROMA_obj.inputs.mat_file=example_data( 'func_to_struct.mat')
80- >>> AROMA_obj.inputs.fnirt_warp_file=example_data( 'warpfield.nii')
81- >>> AROMA_obj.inputs.motion_parameters=example_data( 'functional.par')
82- >>> AROMA_obj.inputs.mask=example_data( 'mask.nii.gz')
83- >>> AROMA_obj.inputs.denoise_type= 'both'
84- >>> AROMA_obj.inputs.out_dir= 'ICA_testout'
85- >>> AROMA_obj.cmdline
86- u 'ICA_AROMA.py -den both -warp /home/travis/build/nipy/nipype/nipype/testing/data/ warpfield.nii -i /home/travis/build/nipy/nipype/nipype/testing/data/ functional.nii -m /home/travis/build/nipy/nipype/nipype/testing/data/ mask.nii.gz -affmat /home/travis/build/nipy/nipype/nipype/testing/data/func_to_struct.mat -mc /home/travis/build/nipy/nipype/nipype/testing/data/functional.par -o ICA_testout'
87-
88+ >>> AROMA_obj.inputs.in_file = 'functional.nii'
89+ >>> AROMA_obj.inputs.mat_file = 'func_to_struct.mat'
90+ >>> AROMA_obj.inputs.fnirt_warp_file = 'warpfield.nii'
91+ >>> AROMA_obj.inputs.motion_parameters = 'functional.par'
92+ >>> AROMA_obj.inputs.mask = 'mask.nii.gz'
93+ >>> AROMA_obj.inputs.denoise_type = 'both'
94+ >>> AROMA_obj.inputs.out_dir = 'ICA_testout'
95+ >>> AROMA_obj.cmdline # doctest: +ALLOW_UNICODE
96+ 'ICA_AROMA.py -den both -warp warpfield.nii -i functional.nii -m mask.nii.gz \
97+ -affmat func_to_struct.mat -mc fsl_mcflirt_movpar.txt -o ICA_testout'
8898 """
8999 _cmd = 'ICA_AROMA.py'
90100 input_spec = ICA_AROMAInputSpec
91101 output_spec = ICA_AROMAOutputSpec
92102
93103 def _list_outputs (self ):
94-
95104 out_dir = os .path .abspath (self .inputs .out_dir )
96105 outputs ['out_dir' ] = out_dir
97- #outputs = self.output_spec.get()
98- #outdir = self.input_spec.outdir
99- #denoising_strategy = input_spec.denoise_type
100106
101107 if self .inputs .denoise_type in ('aggr' , 'both' ):
102108 outputs ['aggr_denoised_file' ] = os .path .join (out_dir , 'denoised_func_data_aggr.nii.gz' )
103109 if self .inputs .denoise_type in ('nonaggr' , 'both' ):
104110 outputs ['nonaggr_denoised_file' ] = os .path .join (out_dir , 'denoised_func_data_nonaggr.nii.gz' )
105111
106- return outputs
112+ return outputs
0 commit comments