Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions examples/rsfmri_preprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@

specifically the 2mm versions of:

- `Joint Fusion Atlas <http://mindboggle.info/data/atlases/jointfusion/OASIS-TRT-20_DKT31_CMA_jointfusion_labels_in_MNI152_2mm.nii.gz>`_
- `MNI template <http://mindboggle.info/data/templates/ants/OASIS-TRT-20_template_in_MNI152_2mm.nii.gz>`_
- `Joint Fusion Atlas <http://mindboggle.info/data/atlases/jointfusion/OASIS-TRT-20_jointfusion_DKT31_CMA_labels_in_MNI152_2mm.nii.gz>`_
- `MNI template <http://mindboggle.info/data/templates/ants/OASIS-30_Atropos_template_in_MNI152_2mm.nii.gz>`_

The 2mm version was generated with::

>>> from nipype import freesurfer as fs
>>> rs = fs.Resample()
>>> rs.inputs.in_file = 'OASIS-TRT-20_DKT31_CMA_jointfusion_labels_in_MNI152.nii.gz'
>>> rs.inputs.resampled_file = 'OASIS-TRT-20_DKT31_CMA_jointfusion_labels_in_MNI152_2mm.nii.gz'
>>> rs.inputs.in_file = 'OASIS-TRT-20_jointfusion_DKT31_CMA_labels_in_MNI152.nii.gz'
>>> rs.inputs.resampled_file = 'OASIS-TRT-20_jointfusion_DKT31_CMA_labels_in_MNI152_2mm.nii.gz'
>>> rs.inputs.voxel_size = (2., 2., 2.)
>>> rs.inputs.args = '-rt nearest -ns 1'
>>> res = rs.run()
Expand Down Expand Up @@ -584,7 +584,7 @@ def create_workflow(files,
reg.inputs.use_histogram_matching = [False] * 3 + [True]
reg.inputs.output_warped_image = 'output_warped_image.nii.gz'
reg.inputs.fixed_image = \
os.path.abspath('OASIS-TRT-20_template_to_MNI152_2mm.nii.gz')
os.path.abspath('OASIS-30_Atropos_template_in_MNI152_2mm.nii.gz')
reg.inputs.num_threads = 4
reg.plugin_args = {'qsub_args': '-l nodes=1:ppn=4'}

Expand Down Expand Up @@ -625,7 +625,7 @@ def create_workflow(files,
sample2mni.inputs.interpolation = 'BSpline'
sample2mni.inputs.invert_transform_flags = [False, False]
sample2mni.inputs.reference_image = \
os.path.abspath('OASIS-TRT-20_template_to_MNI152_2mm.nii.gz')
os.path.abspath('OASIS-30_Atropos_template_in_MNI152_2mm.nii.gz')
sample2mni.inputs.terminal_output = 'file'
wf.connect(bandpass, 'out_file', sample2mni, 'input_image')
wf.connect(merge, 'out', sample2mni, 'transforms')
Expand All @@ -641,8 +641,8 @@ def create_workflow(files,
ts2txt.inputs.indices = [8] + range(10, 14) + [17, 18, 26, 47] +\
range(49, 55) + [58]
ts2txt.inputs.label_file = \
os.path.abspath(('OASIS-TRT-20_DKT31_CMA_jointfusion_labels_in_MNI152'
'_2mm.nii.gz'))
os.path.abspath(('OASIS-TRT-20_jointfusion_DKT31_CMA_labels_in_MNI152_'
'2mm.nii.gz'))
wf.connect(sample2mni, 'output_image', ts2txt, 'timeseries_file')

# Save the relevant data into an output directory
Expand Down Expand Up @@ -699,7 +699,7 @@ def create_workflow(files,
"""


def create_resting_workflow(args):
def create_resting_workflow(args, name='resting'):
TR = args.TR
slice_times = args.slice_times
slice_thickness = None
Expand All @@ -722,7 +722,8 @@ def create_resting_workflow(args):
slice_thickness=slice_thickness,
lowpass_freq=args.lowpass_freq,
highpass_freq=args.highpass_freq,
sink_directory=os.path.abspath(args.sink))
sink_directory=os.path.abspath(args.sink),
name=name)
if args.field_maps:
kwargs.update(**dict(fieldmap_images=args.field_maps,
FM_TEdiff=args.TE_diff,
Expand Down