Esempio n. 1
0
def processS():

    numCores=int(sys.argv[1])

    wfname='resting_preproc'
    workflow=pe.Workflow(name=wfname)

    anatpreproc=create_anat_preproc()
    anatpreproc.inputs.inputspec.anat=os.path.abspath('/home/sharad/Resources/0010052/session_1/anat_1/mprage.nii.gz')

    funcpreproc=create_func_preproc()
    funcpreproc.inputs.inputspec.rest=os.path.abspath('/home/sharad/Resources/0010052/session_1/rest_1/rest.nii.gz')
    funcpreproc.inputs.inputspec.start_idx=0
    funcpreproc.inputs.inputspec.stop_idx=175

    segpreproc=create_seg_preproc()
    segpreproc.inputs.inputspec.PRIOR_CSF = os.path.abspath('/home/sharad/nki_nyu_pipeline/tissuepriors/avg152T1_csf_bin.nii.gz')
    segpreproc.inputs.inputspec.PRIOR_WHITE = os.path.abspath('/home/sharad/nki_nyu_pipeline/tissuepriors/avg152T1_white_bin.nii.gz')
    segpreproc.inputs.inputspec.standard_res_brain=os.path.abspath('/frodo/shared/RH5_fsl/data/standard/MNI152_T1_3mm_brain.nii.gz')

    regpreproc=create_reg_preproc()
    regpreproc.inputs.inputspec.standard_res_brain=os.path.abspath('/frodo/shared/RH5_fsl/data/standard/MNI152_T1_3mm_brain.nii.gz')
    regpreproc.inputs.inputspec.standard=os.path.abspath('/frodo/shared/RH5_fsl/data/standard/MNI152_T1_3mm.nii.gz')
    regpreproc.inputs.inputspec.config_file=os.path.abspath('/frodo/shared/RH5_fsl/etc/flirtsch/T1_2_MNI152_3mm.cnf')
    regpreproc.inputs.inputspec.standard_brain_mask_dil=os.path.abspath('/frodo/shared/RH5_fsl/data/standard/MNI152_T1_3mm_brain_mask_dil.nii.gz')

    workflow.connect(funcpreproc, 'outputspec.example_func', regpreproc, 'inputspec.example_func')
    workflow.connect(anatpreproc, 'outputspec.brain', regpreproc, 'inputspec.brain')
    workflow.connect(anatpreproc, 'outputspec.reorient', regpreproc, 'inputspec.reorient')
    workflow.connect(funcpreproc, 'outputspec.preprocessed_mask', segpreproc, 'inputspec.preprocessed_mask')
    workflow.connect(anatpreproc, 'outputspec.brain', segpreproc, 'inputspec.brain')
    workflow.connect(funcpreproc, 'outputspec.example_func', segpreproc, 'inputspec.example_func')
    workflow.connect(regpreproc, 'outputspec.highres2example_func_mat', segpreproc, 'inputspec.highres2example_func_mat')
    workflow.connect(regpreproc, 'outputspec.stand2highres_warp', segpreproc, 'inputspec.stand2highres_warp')


#    workflow.add_nodes([anatpreproc, funcpreproc])
    workflow.base_dir='/home/sharad/nki_nyu_pipeline/working_dir'
    workflow.run(plugin='MultiProc', plugin_args={'n_procs': numCores})
def get_workflow(wf_name, c):

    preproc = None
    """
        setup standard file paths
    """
    prior_path = os.path.join(c.priorDirectory, c.standardResolution)
    PRIOR_CSF = os.path.join(prior_path, 'avg152T1_csf_bin.nii.gz')
    PRIOR_GRAY = os.path.join(prior_path, 'avg152T1_gray_bin.nii.gz')
    PRIOR_WHITE = os.path.join(prior_path, 'avg152T1_white_bin.nii.gz')
    standard_res_brain = os.path.join(c.FSLDIR,
            'data/standard/MNI152_T1_%s_brain.nii.gz' % (c.standardResolution))
    standard = os.path.join(c.FSLDIR,
            'data/standard/MNI152_T1_%s.nii.gz' % (c.standardResolution))
    standard_brain_mask_dil = os.path.join(c.FSLDIR,
            'data/standard/MNI152_T1_%s_brain_mask_dil.nii.gz' % (c.standardResolution))
    config_file = os.path.join(c.FSLDIR,
            'etc/flirtsch/T1_2_MNI152_%s.cnf' % (c.standardResolution))
    brain_symmetric = os.path.join(c.FSLDIR,
            'data/standard/MNI152_T1_2mm_brain_symmetric.nii.gz')
    symm_standard = os.path.join(c.FSLDIR,
            'data/standard/MNI152_T1_2mm_symmetric.nii.gz')
    twomm_brain_mask_dil = os.path.join(c.FSLDIR,
            'data/standard/MNI152_T1_2mm_brain_mask_symmetric_dil.nii.gz')
    config_file_twomm = os.path.join(c.FSLDIR,
            'etc/flirtsch/T1_2_MNI152_2mm.cnf')
    identity_matrix = os.path.join(c.FSLDIR,
            'etc/flirtsch/ident.mat')

    if wf_name.lower() == 'anat':
        preproc = create_anat_preproc()
        return preproc

    if wf_name.lower() == 'func':

        preproc = create_func_preproc()
        preproc.inputs.inputspec.start_idx = c.startIdx
        preproc.inputs.inputspec.stop_idx = c.stopIdx

        return preproc

    if wf_name.lower() == 'seg':

        preproc = create_seg_preproc()
        preproc.inputs.inputspec.PRIOR_CSF = PRIOR_CSF
        preproc.inputs.inputspec.PRIOR_WHITE = PRIOR_WHITE
        preproc.inputs.inputspec.PRIOR_GRAY = PRIOR_GRAY
        preproc.inputs.inputspec.standard_res_brain = standard_res_brain
        preproc.inputs.csf_threshold.csf_threshold = \
                                        c.cerebralSpinalFluidThreshold
        preproc.inputs.wm_threshold.wm_threshold = \
                                        c.whiteMatterThreshold
        preproc.inputs.gm_threshold.gm_threshold = \
                                        c.grayMatterThreshold
        preproc.get_node('csf_threshold').iterables = ('csf_threshold',
                                        c.cerebralSpinalFluidThreshold)
        preproc.get_node('wm_threshold').iterables = ('wm_threshold',
                                        c.whiteMatterThreshold)
        preproc.get_node('gm_threshold').iterables = ('gm_threshold',
                                        c.grayMatterThreshold)

        return preproc

    if wf_name.lower() == 'reg':

        preproc = create_reg_preproc()
        preproc.inputs.inputspec.standard_res_brain = \
                                            standard_res_brain
        preproc.inputs.inputspec.standard = standard
        preproc.inputs.inputspec.config_file = config_file
        preproc.inputs.inputspec.standard_brain_mask_dil = \
                                            standard_brain_mask_dil

        return preproc

    if wf_name.lower() == 'alff':

        preproc = create_alff_preproc(c)
        preproc.inputs.inputspec.standard = standard
        preproc.inputs.hp_input.hp = c.highPassFreqALFF
        preproc.inputs.lp_input.lp = c.lowPassFreqALFF
        preproc.inputs.fwhm_input.fwhm = c.fwhm
        preproc.get_node('hp_input').iterables = ('hp',
                                                    c.highPassFreqALFF)
        preproc.get_node('lp_input').iterables = ('lp',
                                                    c.lowPassFreqALFF)
        preproc.get_node('fwhm_input').iterables = ('fwhm',
                                                    c.fwhm)

        return preproc

    if wf_name.lower() == 'sca':

        preproc = create_sca_preproc(c.correlationSpace)
        preproc.inputs.fwhm_input.fwhm = c.fwhm
        preproc.get_node('fwhm_input').iterables = ('fwhm',
                                                    c.fwhm)
        preproc.inputs.inputspec.standard = standard
        return preproc


    if wf_name.lower() == 'vmhc':

        preproc = create_vmhc_preproc(c)
        preproc.inputs.inputspec.brain_symmetric = \
                                        brain_symmetric
        preproc.inputs.inputspec.symm_standard = \
                                        symm_standard
        preproc.inputs.inputspec.twomm_brain_mask_dil = \
                                        twomm_brain_mask_dil
        preproc.inputs.inputspec.config_file_twomm = \
                                        config_file_twomm
        preproc.inputs.inputspec.standard = \
                                        standard
        return preproc


    if wf_name.lower() == 'sc':

        preproc = create_scrubbing_preproc()
        return preproc

    if wf_name.lower() == 'pm':

        preproc = create_parameters_preproc(c)
        preproc.inputs.threshold_input.threshold = c.scrubbingThreshold
        preproc.get_node('threshold_input').iterables = ('threshold', c.scrubbingThreshold)
        return preproc

    if wf_name.lower() == 'select':

        preproc = selector_wf()
        preproc.inputs.scrubbed_input.scrubbed = c.scrubData
        preproc.get_node('scrubbed_input').iterables = \
                                    ('scrubbed', c.scrubData)
        return preproc

    if wf_name.lower() == 'nuisance':

        preproc = create_nuisance_preproc()
        preproc.inputs.selector_input.selector = c.Corrections
        preproc.inputs.nc_input.nc = c.nComponents
        preproc.inputs.target_angle_deg_input.target_angle_deg = \
                                            c.targetAngleDeg

        preproc.get_node('selector_input').iterables = \
                                            ('selector', c.Corrections)
        preproc.get_node('nc_input').iterables = \
                                            ('nc', c.nComponents)
        preproc.get_node('target_angle_deg_input').iterables = \
                                ('target_angle_deg', c.targetAngleDeg)

        return preproc

    if wf_name.lower() == 'mprage_in_mnioutputs':
        preproc = mprage_in_mnioutputs()
        preproc.inputs.inputspec.standard = standard

        return preproc

    if wf_name.lower() == 'func_in_mnioutputs':
        preproc = func_in_mnioutputs()
        preproc.inputs.inputspec.standard = standard

        return preproc

    if wf_name.lower() == 'freq_filter':

        from base_nuisance import bandpass_voxels
        import nipype.interfaces.utility as util
        preproc = pe.MapNode(util.Function(input_names=['realigned_file',
                                                        'sample_period',
                                                        'bandpass_freqs'],
                                           output_names=['bandpassed_file'],
                                           function=bandpass_voxels),
                                           name='bandpass_filter',
                                           iterfield=['realigned_file', 'bandpass_freqs', 'sample_period'])
        preproc.inputs.bandpass_freqs = c.nuisanceBandpassFreq
        #preproc.inputs.sample_period = c.TR
        return preproc


    if wf_name.lower() == 'ts':

        preproc = create_timeseries_preproc(True, True, True, c.runSurfaceRegistraion)
        preproc.inputs.inputspec.recon_subjects = c.reconSubjectsDirectory
        preproc.inputs.inputspec.standard = standard
        preproc.inputs.inputspec.identity_matrix = identity_matrix
        preproc.inputs.inputspec.unitTSOutputs = [True, True]
        preproc.inputs.inputspec.voxelTSOutputs = [True, True]
        preproc.inputs.inputspec.verticesTSOutputs = [True, True]
        return preproc

    if wf_name.lower() == 'group_analysis':

        preproc = create_group_analysis(c.fTest)
        preproc.inputs.inputspec.z_threshold = c.zThreshold
        preproc.inputs.inputspec.p_threshold = c.pThreshold
        preproc.inputs.inputspec.parameters = (c.FSLDIR,
                                               c.MNI)
        return preproc
def get_workflow(wf_name, c):

    preproc = None
    """
        setup standard file paths
    """
    prior_path = os.path.join(c.priorDirectory, c.standardResolution)
    PRIOR_CSF = os.path.join(prior_path, 'avg152T1_csf_bin.nii.gz')
    PRIOR_GRAY = os.path.join(prior_path, 'avg152T1_gray_bin.nii.gz')
    PRIOR_WHITE = os.path.join(prior_path, 'avg152T1_white_bin.nii.gz')
    standard_res_brain = os.path.join(c.FSLDIR,
            'data/standard/MNI152_T1_%s_brain.nii.gz' % (c.standardResolution))
    standard = os.path.join(c.FSLDIR,
            'data/standard/MNI152_T1_%s.nii.gz' % (c.standardResolution))
    standard_brain_mask_dil = '/home2/ssikka/scripts1/templates/MNI152_T1_%s_brain_mask_dil.nii.gz' % (c.standardResolution)
    config_file = '/home2/ssikka/scripts1/templates/T1_2_MNI152_%s.cnf' % (c.standardResolution)
    brain_symmetric = '/home2/ssikka/scripts1/templates/MNI152_T1_2mm_brain_symmetric.nii.gz'
    symm_standard = '/home2/ssikka/scripts1/templates/MNI152_T1_2mm_symmetric.nii.gz'
    twomm_brain_mask_dil = '/home2/ssikka/scripts1/templates/MNI152_T1_2mm_brain_mask_symmetric_dil.nii.gz'
    config_file_twomm = '/home2/ssikka/scripts1/templates/T1_2_MNI152_2mm.cnf'
    identity_matrix = os.path.join(c.FSLDIR,
            'etc/flirtsch/ident.mat')


    if wf_name.lower() == 'anat':
        preproc = create_anat_preproc()
        return preproc

    if wf_name.lower() == 'func':

        preproc = create_func_preproc()
        preproc.inputs.inputspec.start_idx = c.startIdx
        preproc.inputs.inputspec.stop_idx = c.stopIdx

        return preproc

    if wf_name.lower() == 'seg':

        preproc = create_seg_preproc()
        preproc.inputs.inputspec.PRIOR_CSF = PRIOR_CSF
        preproc.inputs.inputspec.PRIOR_WHITE = PRIOR_WHITE
        preproc.inputs.inputspec.PRIOR_GRAY = PRIOR_GRAY
        preproc.inputs.inputspec.standard_res_brain = standard_res_brain
        preproc.inputs.csf_threshold.csf_threshold = \
                                        c.cerebralSpinalFluidThreshold
        preproc.inputs.wm_threshold.wm_threshold = \
                                        c.whiteMatterThreshold
        preproc.inputs.gm_threshold.gm_threshold = \
                                        c.grayMatterThreshold
        preproc.get_node('csf_threshold').iterables = ('csf_threshold',
                                        c.cerebralSpinalFluidThreshold)
        preproc.get_node('wm_threshold').iterables = ('wm_threshold',
                                        c.whiteMatterThreshold)
        preproc.get_node('gm_threshold').iterables = ('gm_threshold',
                                        c.grayMatterThreshold)

        return preproc

    if wf_name.lower() == 'reg':

        preproc = create_reg_preproc()
        preproc.inputs.inputspec.standard_res_brain = \
                                            standard_res_brain
        preproc.inputs.inputspec.standard = standard
        preproc.inputs.inputspec.config_file = config_file
        preproc.inputs.inputspec.standard_brain_mask_dil = \
                                            standard_brain_mask_dil

        return preproc

    if wf_name.lower() == 'alff':

        preproc = create_alff_preproc()
        preproc.inputs.inputspec.standard = standard
        preproc.inputs.hp_input.hp = c.highPassFreqALFF
        preproc.inputs.lp_input.lp = c.lowPassFreqALFF
        preproc.inputs.fwhm_input.fwhm = c.fwhm
        preproc.get_node('hp_input').iterables = ('hp',
                                                    c.highPassFreqALFF)
        preproc.get_node('lp_input').iterables = ('lp',
                                                    c.lowPassFreqALFF)
        preproc.get_node('fwhm_input').iterables = ('fwhm',
                                                    c.fwhm)

        return preproc

    if wf_name.lower() == 'sca':

        preproc = create_sca_preproc(c.correlationSpace)
        preproc.inputs.fwhm_input.fwhm = c.fwhm
        preproc.get_node('fwhm_input').iterables = ('fwhm',
                                                    c.fwhm)
        preproc.inputs.inputspec.standard = standard
        return preproc


    if wf_name.lower() == 'vmhc':

        preproc = create_vmhc_preproc()
        preproc.inputs.inputspec.brain_symmetric = \
                                        brain_symmetric
        preproc.inputs.inputspec.symm_standard = \
                                        symm_standard
        preproc.inputs.inputspec.twomm_brain_mask_dil = \
                                        twomm_brain_mask_dil
        preproc.inputs.inputspec.config_file_twomm = \
                                        config_file_twomm
        preproc.inputs.inputspec.standard = \
                                        standard
        return preproc

    if wf_name.lower() == 'sc':

        preproc = create_scrubbing_preproc()
        preproc.inputs.threshold_input.threshold = c.scrubbingThreshold
        preproc.get_node('threshold_input').iterables = ('threshold', c.scrubbingThreshold)
        return preproc

    if wf_name.lower() == 'select':

        preproc = selector_wf()
        preproc.inputs.run_scrubbing_input.run_scrubbing = c.scrubData
        preproc.get_node('run_scrubbing_input').iterables = \
                                    ('run_scrubbing', c.scrubData)
        return preproc

    if wf_name.lower() == 'nuisance':

        preproc = create_nuisance_preproc()
        preproc.inputs.selector_input.selector = c.Corrections
        preproc.inputs.nc_input.nc = c.nComponents
        preproc.inputs.target_angle_deg_input.target_angle_deg = \
                                            c.targetAngleDeg

        preproc.get_node('selector_input').iterables = \
                                            ('selector', c.Corrections)
        preproc.get_node('nc_input').iterables = \
                                            ('nc', c.nComponents)
        preproc.get_node('target_angle_deg_input').iterables = \
                                ('target_angle_deg', c.targetAngleDeg)

        return preproc

    if wf_name.lower() == 'mprage_in_mnioutputs':
        preproc = mprage_in_mnioutputs()
        preproc.inputs.inputspec.standard = standard

        return preproc

    if wf_name.lower() == 'func_in_mnioutputs':
        preproc = func_in_mnioutputs()
        preproc.inputs.inputspec.standard = standard

        return preproc

    if wf_name.lower() == 'freq_filter':

        from base_nuisance import bandpass_voxels
        import nipype.interfaces.utility as util
        preproc = pe.MapNode(util.Function(input_names=['realigned_file',
                                                        'sample_period',
                                                        'bandpass_freqs'],
                                           output_names=['bandpassed_file'],
                                           function=bandpass_voxels),
                                           name='bandpass_filter',
                                           iterfield=['realigned_file', 'bandpass_freqs'])
        preproc.inputs.bandpass_freqs = c.nuisanceBandpassFreq
        preproc.inputs.sample_period = c.TR
        return preproc


    if wf_name.lower() == 'ts':

        preproc = create_timeseries_preproc(True, True, True, c.runSurfaceRegistraion)
        preproc.inputs.inputspec.recon_subjects = c.reconSubjectsDirectory
        preproc.inputs.inputspec.standard = standard
        preproc.inputs.inputspec.identity_matrix = identity_matrix
        preproc.inputs.inputspec.unitTSOutputs = [True, True]
        preproc.inputs.inputspec.voxelTSOutputs = [True, True]
        preproc.inputs.inputspec.verticesTSOutputs = [True, True]
        return preproc

    if wf_name.lower() == 'group_analysis':

        preproc = create_group_analysis(c.fTest)
        preproc.inputs.inputspec.z_threshold = c.zThreshold
        preproc.inputs.inputspec.p_threshold = c.pThreshold
        preproc.inputs.inputspec.parameters = (c.FSLDIR,
                                               c.MNI)
        return preproc
Esempio n. 4
0
def get_workflow(wf_name, c):

    preproc = None
    """
        setup standard file paths
    """
    prior_path = os.path.join(c.priorDirectory, c.standardResolution)
    PRIOR_CSF = os.path.join(prior_path, 'avg152T1_csf_bin.nii.gz')
    PRIOR_GRAY = os.path.join(prior_path, 'avg152T1_gray_bin.nii.gz')
    PRIOR_WHITE = os.path.join(prior_path, 'avg152T1_white_bin.nii.gz')
    standard_res_brain = os.path.join(c.FSLDIR,
            'data/standard/MNI152_T1_%s_brain.nii.gz' % (c.standardResolution))
    standard = os.path.join(c.FSLDIR,
            'data/standard/MNI152_T1_%s.nii.gz' % (c.standardResolution))
    standard_brain_mask_dil = os.path.join(c.FSLDIR,
            'data/standard/MNI152_T1_%s_brain_mask_dil.nii.gz' % (c.standardResolution))
    config_file = os.path.join(c.FSLDIR,
            'etc/flirtsch/T1_2_MNI152_%s.cnf' % (c.standardResolution))
    brain_symmetric = os.path.join(c.FSLDIR,
            'data/standard/MNI152_T1_2mm_brain_symmetric.nii.gz')
    symm_standard = os.path.join(c.FSLDIR,
            'data/standard/MNI152_T1_2mm_symmetric.nii.gz')
    twomm_brain_mask_dil = os.path.join(c.FSLDIR,
            'data/standard/MNI152_T1_2mm_brain_mask_symmetric_dil.nii.gz')
    config_file_twomm = os.path.join(c.FSLDIR,
            'etc/flirtsch/T1_2_MNI152_2mm.cnf')
    identity_matrix = os.path.join(c.FSLDIR,
            'etc/flirtsch/ident.mat')

    if wf_name.lower() == 'anat':
        preproc = create_anat_preproc()
        return preproc

    if wf_name.lower() == 'func':

        preproc = create_func_preproc()
        preproc.inputs.inputspec.start_idx = c.startIdx
        preproc.inputs.inputspec.stop_idx = c.stopIdx

        return preproc

    if wf_name.lower() == 'seg':

        preproc = create_seg_preproc()
        preproc.inputs.inputspec.PRIOR_CSF = PRIOR_CSF
        preproc.inputs.inputspec.PRIOR_WHITE = PRIOR_WHITE
        preproc.inputs.inputspec.PRIOR_GRAY = PRIOR_GRAY
        preproc.inputs.inputspec.standard_res_brain = standard_res_brain
        preproc.inputs.csf_threshold.csf_threshold = \
                                        c.cerebralSpinalFluidThreshold
        preproc.inputs.wm_threshold.wm_threshold = \
                                        c.whiteMatterThreshold
        preproc.inputs.gm_threshold.gm_threshold = \
                                        c.grayMatterThreshold
        preproc.get_node('csf_threshold').iterables = ('csf_threshold',
                                        c.cerebralSpinalFluidThreshold)
        preproc.get_node('wm_threshold').iterables = ('wm_threshold',
                                        c.whiteMatterThreshold)
        preproc.get_node('gm_threshold').iterables = ('gm_threshold',
                                        c.grayMatterThreshold)

        return preproc

    if wf_name.lower() == 'reg':

        preproc = create_reg_preproc()
        preproc.inputs.inputspec.standard_res_brain = \
                                            standard_res_brain
        preproc.inputs.inputspec.standard = standard
        preproc.inputs.inputspec.config_file = config_file
        preproc.inputs.inputspec.standard_brain_mask_dil = \
                                            standard_brain_mask_dil

        return preproc

    if wf_name.lower() == 'alff':

        preproc = create_alff_preproc(c)
        preproc.inputs.inputspec.standard = standard
        preproc.inputs.hp_input.hp = c.highPassFreqALFF
        preproc.inputs.lp_input.lp = c.lowPassFreqALFF
        preproc.inputs.fwhm_input.fwhm = c.fwhm
        preproc.get_node('hp_input').iterables = ('hp',
                                                    c.highPassFreqALFF)
        preproc.get_node('lp_input').iterables = ('lp',
                                                    c.lowPassFreqALFF)
        preproc.get_node('fwhm_input').iterables = ('fwhm',
                                                    c.fwhm)

        return preproc

    if wf_name.lower() == 'sca':

        preproc = create_sca_preproc(c.correlationSpace)
        preproc.inputs.fwhm_input.fwhm = c.fwhm
        preproc.get_node('fwhm_input').iterables = ('fwhm',
                                                    c.fwhm)
        preproc.inputs.inputspec.standard = standard
        return preproc


    if wf_name.lower() == 'vmhc':

        preproc = create_vmhc_preproc(c)
        preproc.inputs.inputspec.brain_symmetric = \
                                        brain_symmetric
        preproc.inputs.inputspec.symm_standard = \
                                        symm_standard
        preproc.inputs.inputspec.twomm_brain_mask_dil = \
                                        twomm_brain_mask_dil
        preproc.inputs.inputspec.config_file_twomm = \
                                        config_file_twomm
        preproc.inputs.inputspec.standard = \
                                        standard
        preproc.inputs.fwhm_input.fwhm = c.fwhm
        preproc.get_node('fwhm_input').iterables = ('fwhm',
                                                    c.fwhm)
        return preproc


    if wf_name.lower() == 'sc':

        preproc = create_scrubbing_preproc()
        return preproc

    if wf_name.lower() == 'pm':

        preproc = create_parameters_preproc(c)
        preproc.inputs.threshold_input.threshold = c.scrubbingThreshold
        preproc.get_node('threshold_input').iterables = ('threshold', c.scrubbingThreshold)
        return preproc

    if wf_name.lower() == 'select':

        preproc = selector_wf()
        preproc.inputs.scrubbed_input.scrubbed = c.scrubData
        preproc.get_node('scrubbed_input').iterables = \
                                    ('scrubbed', c.scrubData)
        return preproc

    if wf_name.lower() == 'nuisance':

        preproc = create_nuisance_preproc()
        preproc.inputs.selector_input.selector = c.Corrections
        preproc.inputs.nc_input.nc = c.nComponents
        preproc.inputs.target_angle_deg_input.target_angle_deg = \
                                            c.targetAngleDeg

        preproc.get_node('selector_input').iterables = \
                                            ('selector', c.Corrections)
        preproc.get_node('nc_input').iterables = \
                                            ('nc', c.nComponents)
        preproc.get_node('target_angle_deg_input').iterables = \
                                ('target_angle_deg', c.targetAngleDeg)

        return preproc

    if wf_name.lower() == 'mprage_in_mnioutputs':
        preproc = mprage_in_mnioutputs()
        preproc.inputs.inputspec.standard = standard

        return preproc

    if wf_name.lower() == 'func_in_mnioutputs':
        preproc = func_in_mnioutputs()
        preproc.inputs.inputspec.standard = standard

        return preproc

    if wf_name.lower() == 'freq_filter':
Esempio n. 5
0
datasink.inputs.base_directory = output_path
#datasink.inputs.substitutions = [('session\d_subject_id_', '')]

#st = pe.Node(interface=fsl.SliceTimer(), name='st')
#st.iterables = [('time_repetition', [2.0, 3.0])]

workflow = pe.Workflow(name='wf')
workflow.base_dir = output_path

anatpreproc = create_anat_preproc()

funcpreproc = create_func_preproc()
funcpreproc.inputs.inputspec.start_idx = start_volume
funcpreproc.inputs.inputspec.stop_idx = stop_volume

regpreproc = create_reg_preproc()
regpreproc.inputs.inputspec.standard_res_brain = os.path.abspath(
    '/usr/share/fsl/4.1/data/standard/MNI152_T1_3mm_brain.nii.gz')
regpreproc.inputs.inputspec.standard = os.path.abspath(
    '/usr/share/fsl/4.1/data/standard/MNI152_T1_3mm.nii.gz')
regpreproc.inputs.inputspec.config_file = os.path.abspath(
    '/usr/share/fsl/4.1/etc/flirtsch/T1_2_MNI152_3mm.cnf')
regpreproc.inputs.inputspec.standard_brain_mask_dil = os.path.abspath(
    '/usr/share/fsl/4.1/data/standard/MNI152_T1_3mm_brain_mask_dil.nii.gz')

segpreproc = create_seg_preproc()
segpreproc.inputs.inputspec.PRIOR_CSF = os.path.abspath(
    './tissuepriors/3mm/avg152T1_csf_bin.nii.gz')
segpreproc.inputs.inputspec.PRIOR_WHITE = os.path.abspath(
    './tissuepriors/3mm/avg152T1_white_bin.nii.gz')
segpreproc.inputs.inputspec.PRIOR_GRAY = os.path.abspath(
Esempio n. 6
0
datasink.inputs.base_directory = output_path
#datasink.inputs.substitutions = [('session\d_subject_id_', '')]

#st = pe.Node(interface=fsl.SliceTimer(), name='st')
#st.iterables = [('time_repetition', [2.0, 3.0])]

workflow = pe.Workflow(name='wf')
workflow.base_dir = output_path

anatpreproc=create_anat_preproc()

funcpreproc=create_func_preproc()
funcpreproc.inputs.inputspec.start_idx=start_volume
funcpreproc.inputs.inputspec.stop_idx=stop_volume

regpreproc=create_reg_preproc()
regpreproc.inputs.inputspec.standard_res_brain=os.path.abspath('/usr/share/fsl/4.1/data/standard/MNI152_T1_3mm_brain.nii.gz')
regpreproc.inputs.inputspec.standard=os.path.abspath('/usr/share/fsl/4.1/data/standard/MNI152_T1_3mm.nii.gz')
regpreproc.inputs.inputspec.config_file=os.path.abspath('/usr/share/fsl/4.1/etc/flirtsch/T1_2_MNI152_3mm.cnf')
regpreproc.inputs.inputspec.standard_brain_mask_dil=os.path.abspath('/usr/share/fsl/4.1/data/standard/MNI152_T1_3mm_brain_mask_dil.nii.gz')

segpreproc=create_seg_preproc()
segpreproc.inputs.inputspec.PRIOR_CSF = os.path.abspath('./tissuepriors/3mm/avg152T1_csf_bin.nii.gz')
segpreproc.inputs.inputspec.PRIOR_WHITE = os.path.abspath('./tissuepriors/3mm/avg152T1_white_bin.nii.gz')
segpreproc.inputs.inputspec.PRIOR_GRAY = os.path.abspath('./tissuepriors/3mm/avg152T1_gray_bin_3mm.nii.gz')
segpreproc.inputs.inputspec.standard_res_brain=os.path.abspath('/usr/share/fsl/4.1/data/standard/MNI152_T1_3mm_brain.nii.gz')

nuisancepreproc = create_nuisance_preproc()
nuisancepreproc.inputs.inputspec.selector = [False, False, False, False, False, False, True]
nuisancepreproc.inputs.inputspec.num_components = 5
nuisancepreproc.inputs.inputspec.target_angle_deg = 85