Esempio n. 1
0
class _UniformGridInputSpec(BaseInterfaceInputSpec):
    in_data = InputMultiObject(
        File(exists=True),
        mandatory=True,
        desc="list of input data",
    )
    reference = traits.Int(0, usedefault=True, desc="reference index")
class ResponseSDInputSpec(MRTrix3BaseInputSpec):
    algorithm = traits.Enum(
        "msmt_5tt",
        "dhollander",
        "tournier",
        "tax",
        argstr="%s",
        position=1,
        mandatory=True,
        desc="response estimation algorithm (multi-tissue)",
    )
    in_file = File(
        exists=True, argstr="%s", position=-5, mandatory=True, desc="input DWI image"
    )
    mtt_file = File(argstr="%s", position=-4, desc="input 5tt image")
    wm_file = File(
        "wm.txt",
        argstr="%s",
        position=-3,
        usedefault=True,
        desc="output WM response text file",
    )
    gm_file = File(argstr="%s", position=-2, desc="output GM response text file")
    csf_file = File(argstr="%s", position=-1, desc="output CSF response text file")
    in_mask = File(exists=True, argstr="-mask %s", desc="provide initial mask image")
    max_sh = InputMultiObject(
        traits.Int,
        argstr="-lmax %s",
        sep=",",
        desc=(
            "maximum harmonic degree of response function - single value for "
            "single-shell response, list for multi-shell response"
        ),
    )
Esempio n. 3
0
class IntraModalMergeInputSpec(BaseInterfaceInputSpec):
    in_files = InputMultiObject(File(exists=True),
                                mandatory=True,
                                desc='input files')
    hmc = traits.Bool(True, usedefault=True)
    zero_based_avg = traits.Bool(True, usedefault=True)
    to_lps = traits.Bool(True, usedefault=True)
Esempio n. 4
0
class Phases2FieldmapInputSpec(BaseInterfaceInputSpec):
    phase_files = InputMultiObject(File(exists=True),
                                   mandatory=True,
                                   desc='list of phase1, phase2 files')
    metadatas = traits.List(traits.Dict,
                            mandatory=True,
                            desc='list of phase1, phase2 metadata dicts')
Esempio n. 5
0
class ResampleInputSpec(ApplyTransformsInputSpec):
    input_space = traits.Either("MNI152NLin6Asym",
                                "MNI152NLin2009cAsym",
                                mandatory=True)
    reference_space = traits.Either("MNI152NLin6Asym",
                                    "MNI152NLin2009cAsym",
                                    mandatory=True)
    reference_res = traits.Int(mandatory=False)
    lazy = traits.Bool(default=True,
                       usedefault=True,
                       desc="only resample if necessary")

    # make not mandatory as these inputs will be computed from other inputs
    reference_image = File(
        argstr="--reference-image %s",
        mandatory=False,
        desc="reference image space that you wish to warp INTO",
        exists=True,
    )
    transforms = InputMultiObject(
        traits.Either(File(exists=True), "identity"),
        argstr="%s",
        mandatory=False,
        desc="transform files: will be applied in reverse order. For "
        "example, the last specified transform will be applied first.",
    )
Esempio n. 6
0
class _TemplateDimensionsInputSpec(BaseInterfaceInputSpec):
    t1w_list = InputMultiObject(File(exists=True),
                                mandatory=True,
                                desc="input T1w images")
    max_scale = traits.Float(3.0,
                             usedefault=True,
                             desc="Maximum scaling factor in images to accept")
Esempio n. 7
0
class _SignalExtractionInputSpec(BaseInterfaceInputSpec):
    in_file = File(exists=True, mandatory=True, desc="4-D fMRI nii file")
    label_files = InputMultiObject(
        File(exists=True),
        mandatory=True,
        desc="a 3D label image, with 0 denoting "
        "background, or a list of 3D probability "
        "maps (one per label) or the equivalent 4D "
        "file.",
    )
    prob_thres = traits.Range(
        low=0.0,
        high=1.0,
        value=0.5,
        usedefault=True,
        desc="If label_files are probability masks, threshold "
        "at specified probability.",
    )
    class_labels = traits.List(
        mandatory=True,
        desc="Human-readable labels for each segment "
        "in the label file, in order. The length of "
        "class_labels must be equal to the number of "
        "segments (background excluded). This list "
        "corresponds to the class labels in label_file "
        "in ascending order",
    )
    out_file = File(
        "signals.tsv",
        usedefault=True,
        exists=False,
        desc="The name of the file to output to. "
        "signals.tsv by default",
    )
Esempio n. 8
0
class _DerivativesDataSinkInputSpec(DynamicTraitedSpec,
                                    BaseInterfaceInputSpec):
    base_directory = traits.Directory(
        desc='Path to the base directory for storing data.')
    check_hdr = traits.Bool(True,
                            usedefault=True,
                            desc='fix headers of NIfTI outputs')
    compress = traits.Bool(
        desc="force compression (True) or uncompression (False)"
        " of the output file (default: same as input)")
    desc = Str('', usedefault=True, desc='Label for description field')
    extra_values = traits.List(Str)
    in_file = InputMultiObject(File(exists=True),
                               mandatory=True,
                               desc='the object to be saved')
    keep_dtype = traits.Bool(False,
                             usedefault=True,
                             desc='keep datatype suffix')
    meta_dict = traits.DictStrAny(
        desc='an input dictionary containing metadata')
    source_file = File(exists=False,
                       mandatory=True,
                       desc='the input func file')
    space = Str('', usedefault=True, desc='Label for space field')
    suffix = Str('', usedefault=True, desc='suffix appended to source_file')
Esempio n. 9
0
class _BSplineApproxInputSpec(BaseInterfaceInputSpec):
    in_data = File(exists=True, mandatory=True, desc="path to a fieldmap")
    in_mask = File(exists=True, mandatory=True, desc="path to a brain mask")
    bs_spacing = InputMultiObject(
        [DEFAULT_ZOOMS_MM],
        traits.Tuple(traits.Float, traits.Float, traits.Float),
        usedefault=True,
        desc="spacing between B-Spline control points",
    )
    ridge_alpha = traits.Float(0.01,
                               usedefault=True,
                               desc="controls the regularization")
    recenter = traits.Enum(
        "mode",
        "median",
        "mean",
        False,
        usedefault=True,
        desc="strategy to recenter the distribution of the input fieldmap",
    )
    extrapolate = traits.Bool(
        True,
        usedefault=True,
        desc="generate a field, extrapolated outside the brain mask",
    )
Esempio n. 10
0
class DMRISummaryInputSpec(BaseInterfaceInputSpec):
    confounds_file = File(exists=True,
                          desc="BIDS' _confounds.tsv file")
    sliceqc_file = File(exists=True,
                        desc="output from SliceQC")
    sliceqc_mask = File(exists=True, desc='Mask')

    str_or_tuple = traits.Either(
        traits.Str,
        traits.Tuple(traits.Str, traits.Either(None, traits.Str)),
        traits.Tuple(traits.Str, traits.Either(None, traits.Str), traits.Either(None, traits.Str)))
    confounds_list = traits.List(
        str_or_tuple, minlen=1,
        desc='list of headers to extract from the confounds_file')
    bval_files = InputMultiObject(File(exists=True), desc='bvals files')
    orig_bvecs = InputMultiObject(File(exists=True), desc='original bvecs file')
Esempio n. 11
0
class _MergeSeriesInputSpec(BaseInterfaceInputSpec):
    in_files = InputMultiObject(
        File(exists=True, mandatory=True, desc="input list of 3d images"))
    allow_4D = traits.Bool(
        True,
        usedefault=True,
        desc="whether 4D images are allowed to be concatenated")
Esempio n. 12
0
class EstimateFODInputSpec(MRTrix3BaseInputSpec):
    algorithm = traits.Enum(
        'csd',
        'msmt_csd',
        argstr='%s',
        position=-8,
        mandatory=True,
        desc='FOD algorithm')
    in_file = File(
        exists=True,
        argstr='%s',
        position=-7,
        mandatory=True,
        desc='input DWI image')
    wm_txt = File(
        argstr='%s', position=-6, mandatory=True, desc='WM response text file')
    wm_odf = File(
        argstr='%s',
        position=-5,
        genfile=True,
        desc='output WM ODF')
    gm_txt = File(
        argstr='%s',
        position=-4,
        requires=['csf_txt'],
        desc='GM response text file')
    gm_odf = File(
        argstr='%s',
        position=-3,
        genfile=True,
        requires=['gm_txt'],
        desc='output GM ODF')
    csf_txt = File(
        argstr='%s', position=-2, desc='CSF response text file')
    csf_odf = File(
        argstr='%s',
        position=-1,
        genfile=True,
        requires=['csf_txt'],
        desc='output CSF ODF')
    mask_file = File(exists=True, argstr='-mask %s', desc='mask image')
    shell = traits.List(
        traits.Float,
        sep=',',
        argstr='-shell %s',
        desc='specify one or more dw gradient shells')
    max_sh = InputMultiObject(
        traits.Int,
        argstr='-lmax %s',
        sep=',',
        desc='maximum harmonic degree of response function - single value for single-shell '
             'response, list for multi-shell response')
    in_dirs = File(
        exists=True,
        argstr='-directions %s',
        desc=('specify the directions over which to apply the non-negativity '
              'constraint (by default, the built-in 300 direction set is '
              'used). These should be supplied as a text file containing the '
              '[ az el ] pairs for the directions.'))
Esempio n. 13
0
class _TransformCoefficientsInputSpec(BaseInterfaceInputSpec):
    in_coeff = InputMultiObject(File(exist=True),
                                mandatory=True,
                                desc="input coefficients file(s)")
    fmap_ref = File(exists=True, mandatory=True, desc="the fieldmap reference")
    transform = File(exists=True,
                     mandatory=True,
                     desc="rigid-body transform file")
Esempio n. 14
0
class _ConcatenateXFMsInputSpec(BaseInterfaceInputSpec):
    in_xfms = InputMultiObject(File(exists=True), desc="input transform piles")
    inverse = traits.Bool(False, usedefault=True, desc="generate inverse")
    out_fmt = traits.Enum("itk", "fs", usedefault=True, desc="output format")
    reference = File(exists=True, desc="reference file (only for writing LTA format, if not "
                                       "concatenating another LTA).")
    moving = File(exists=True, desc="moving file (only for writing LTA format, if not "
                                    "concatenating another LTA).")
Esempio n. 15
0
class _FixTraitApplyTransformsInputSpec(ApplyTransformsInputSpec):
    transforms = InputMultiObject(
        traits.Either(File(exists=True), 'identity'),
        argstr="%s",
        mandatory=True,
        desc="transform files: will be applied in reverse order. For "
        "example, the last specified transform will be applied first.",
    )
Esempio n. 16
0
class ConcatRPESplitsInputSpec(BaseInterfaceInputSpec):
    dwi_plus = InputMultiObject(File(exists=True), desc='single volume dwis')
    bvec_plus = InputMultiObject(File(exists=True), desc='single volume bvecs')
    bval_plus = InputMultiObject(File(exists=True), desc='single volume bvals')
    b0_images_plus = InputMultiObject(File(exists=True), desc='just the b0s')
    b0_indices_plus = traits.List(desc='list of original indices for each b0 image')
    original_images_plus = InputMultiObject(File(exists=True))

    dwi_minus = InputMultiObject(File(exists=True), desc='single volume dwis')
    bvec_minus = InputMultiObject(File(exists=True), desc='single volume bvecs')
    bval_minus = InputMultiObject(File(exists=True), desc='single volume bvals')
    b0_images_minus = InputMultiObject(File(exists=True), desc='just the b0s')
    b0_indices_minus = traits.List(desc='list of original indices for each b0 image')
    original_images_minus = traits.List()
Esempio n. 17
0
class MergeDWIsInputSpec(BaseInterfaceInputSpec):
    dwi_files = InputMultiObject(File(),
                                 mandatory=True,
                                 desc='list of dwi files')
    bids_dwi_files = InputMultiObject(File(),
                                      mandatory=True,
                                      desc='list of original (BIDS) dwi files')
    bval_files = InputMultiObject(File(exists=True),
                                  mandatory=True,
                                  desc='list of bval files')
    bvec_files = InputMultiObject(File(exists=True),
                                  mandatory=True,
                                  desc='list of bvec files')
    b0_threshold = traits.Int(100, usedefault=True, desc='Maximum b=0 value')
    denoising_confounds = InputMultiObject(
        File(exists=True,
             desc='list of confound files associated with each input dwi'))
    harmonize_b0_intensities = traits.Bool(
        True,
        usedefault=True,
        desc='Force scans to have the same mean b=0 intensity')
    raw_concatenated_files = InputMultiObject(
        File(), mandatory=False, desc='list of raw concatenated images')
    b0_refs = InputMultiObject(File(),
                               mandatory=False,
                               desc='list of b=0 reference images')
Esempio n. 18
0
class _IntraModalMergeInputSpec(BaseInterfaceInputSpec):
    in_files = InputMultiObject(File(exists=True),
                                mandatory=True,
                                desc="input files")
    in_mask = File(exists=True, desc="input mask for grand mean scaling")
    hmc = traits.Bool(True, usedefault=True)
    zero_based_avg = traits.Bool(True, usedefault=True)
    to_ras = traits.Bool(True, usedefault=True)
    grand_mean_scaling = traits.Bool(False, usedefault=True)
Esempio n. 19
0
class BIDSGrabInputSpec(BaseInterfaceInputSpec):
    bids_dir = Directory(exists=True,
                         mandatory=True,
                         desc='BIDS dataset root directory')
    derivatives = traits.Either(traits.Str,
                                traits.List(Str),
                                default='fmriprep',
                                usedefault=True,
                                mandatory=False,
                                desc='Specifies which derivatives to to index')
    task = InputMultiObject(Str,
                            mandatory=False,
                            desc='Names of tasks to denoise')
    session = InputMultiObject(Str,
                               mandatory=False,
                               desc='Names of sessions to denoise')
    subject = InputMultiObject(Str,
                               mandatory=False,
                               desc='Labels of subjects to denoise')
    ica_aroma = traits.Bool(mandatory=False, desc='ICA-Aroma files')
Esempio n. 20
0
class _MCFLIRT2ITKInputSpec(BaseInterfaceInputSpec):
    in_files = InputMultiObject(
        File(exists=True), mandatory=True, desc="list of MAT files from MCFLIRT"
    )
    in_reference = File(
        exists=True, mandatory=True, desc="input image for spatial reference"
    )
    in_source = File(exists=True, mandatory=True, desc="input image for spatial source")
    num_threads = traits.Int(
        1, usedefault=True, nohash=True, desc="number of parallel processes"
    )
Esempio n. 21
0
class _aCompCorMasksInputSpec(BaseInterfaceInputSpec):
    in_vfs = InputMultiObject(File(exists=True),
                              desc="Input volume fractions.")
    is_aseg = traits.Bool(
        False,
        usedefault=True,
        desc="Whether the input volume fractions come from FS' aseg.")
    bold_zooms = traits.Tuple(traits.Float,
                              traits.Float,
                              traits.Float,
                              mandatory=True,
                              desc="BOLD series zooms")
Esempio n. 22
0
class ComposeTransformsInputSpec(ApplyTransformsInputSpec):
    input_image = File(mandatory=False)
    dwi_files = InputMultiObject(File(exists=True),
                                 mandatory=True,
                                 desc='list of dwi files')
    reference_image = File(exists=True, mandatory=True, desc='output grid')
    # Transforms to apply
    hmc_affines = InputMultiObject(File(exists=True),
                                   desc='head motion correction affines')
    fieldwarps = InputMultiObject(File(exists=True),
                                  mandtory=False,
                                  desc='SDC unwarping transform')
    b0_to_intramodal_template_transforms = InputMultiObject(
        File(exists=True),
        mandtory=False,
        desc='list of transforms to register the b=0 to '
        'the intramodal template.')
    intramodal_template_to_t1_affine = File(
        exists=True, desc='affine from the intramodal template to t1')
    intramodal_template_to_t1_warp = File(
        exists=True, desc='warp from the intramodal template to t1')
    hmcsdc_dwi_ref_to_t1w_affine = File(exists=True,
                                        desc='affine from dwi ref to t1w')
    t1_2_mni_forward_transform = InputMultiObject(
        File(exists=True),
        mandatory=False,
        desc='composite (h5) transform to mni')
    save_cmd = traits.Bool(
        True,
        usedefault=True,
        desc='write a log of command lines that were applied')
    copy_dtype = traits.Bool(False,
                             usedefault=True,
                             desc='copy dtype from inputs to outputs')
    num_threads = traits.Int(1,
                             usedefault=True,
                             nohash=True,
                             desc='number of parallel processes')
    transforms = File(mandatory=False)
Esempio n. 23
0
class Dwi2ResponseInputSpec(ResponseSDInputSpec):
    wm_file = File(
        argstr='%s',
        position=-3,
        genfile=True,
        desc='output WM response text file')
    gm_file = File(
        argstr='%s', genfile=True, position=-2, desc='output GM response text file')
    csf_file = File(
        argstr='%s', position=-1, genfile=True, desc='output CSF response text file')
    max_sh = InputMultiObject(
        traits.Int,
        argstr='-lmax %s',
        sep=',',
        desc=('maximum harmonic degree of response function - single value for '
              'single-shell response, list for multi-shell response'))
Esempio n. 24
0
class _MultiApplyTransformsInputSpec(_FixTraitApplyTransformsInputSpec):
    input_image = InputMultiObject(
        File(exists=True),
        mandatory=True,
        desc="input time-series as a list of volumes after splitting"
        " through the fourth dimension",
    )
    num_threads = traits.Int(
        1, usedefault=True, nohash=True, desc="number of parallel processes"
    )
    save_cmd = traits.Bool(
        True, usedefault=True, desc="write a log of command lines that were applied"
    )
    copy_dtype = traits.Bool(
        False, usedefault=True, desc="copy dtype from inputs to outputs"
    )
Esempio n. 25
0
class _TOPUPCoeffReorientInputSpec(BaseInterfaceInputSpec):
    in_coeff = InputMultiObject(
        File(exist=True), mandatory=True, desc="input coefficients file(s) from TOPUP"
    )
    fmap_ref = File(exists=True, mandatory=True, desc="the fieldmap reference")
    pe_dir = traits.Enum(
        "+",
        "-",
        "i",
        "i-",
        "j",
        "j-",
        "k",
        "k-",
        usedefault=True,
        desc="the polarity of the phase-encoding direction corresponding to fmap_ref",
    )
Esempio n. 26
0
    def init_default_traits(self):
        """Automatically initialise necessary parameters for nipype or capsul"""
        if 'output_directory' not in self.user_traits():
            self.add_trait(
                "output_directory",
                traits.Directory(output=False, optional=True, userlevel=1))

        if self.requirement is not None and 'spm' in self.requirement:

            if 'use_mcr' not in self.user_traits():
                self.add_trait("use_mcr",
                               traits.Bool(optional=True, userlevel=1))

            if 'paths' not in self.user_traits():
                self.add_trait(
                    "paths",
                    InputMultiObject(traits.Directory(),
                                     optional=True,
                                     userlevel=1))

            if 'matlab_cmd' not in self.user_traits():
                self.add_trait(
                    "matlab_cmd",
                    traits_extension.Str(optional=True, userlevel=1))

            if 'mfile' not in self.user_traits():
                self.add_trait("mfile", traits.Bool(optional=True,
                                                    userlevel=1))

            if 'spm_script_file' not in self.user_traits():
                spm_script_file_desc = (
                    'The location of the output SPM matlab '
                    'script automatically generated at the '
                    'run step time (a string representing '
                    'a file).')
                self.add_trait(
                    "spm_script_file",
                    File(output=True,
                         optional=True,
                         input_filename=True,
                         userlevel=1,
                         desc=spm_script_file_desc))
Esempio n. 27
0
class DerivativesDataSinkInputSpec(BaseInterfaceInputSpec):
    base_directory = traits.Directory(
        desc='Path to the base directory for storing data.')
    in_file = InputMultiObject(File(exists=True),
                               mandatory=True,
                               desc='the object to be saved')
    source_file = File(mandatory=True,
                       desc='the original file or name of merged files')
    space = traits.Str('', usedefault=True, desc='Label for space field')
    desc = traits.Str('', usedefault=True, desc='Label for description field')
    suffix = traits.Str('',
                        usedefault=True,
                        desc='suffix appended to source_file')
    keep_dtype = traits.Bool(False,
                             usedefault=True,
                             desc='keep datatype suffix')
    extra_values = traits.List(traits.Str)
    compress = traits.Bool(
        desc="force compression (True) or uncompression (False)"
        " of the output file (default: same as input)")
    extension = traits.Str()
Esempio n. 28
0
class _Coefficients2WarpInputSpec(BaseInterfaceInputSpec):
    in_target = File(exist=True,
                     mandatory=True,
                     desc="input EPI data to be corrected")
    in_coeff = InputMultiObject(
        File(exists=True),
        mandatory=True,
        desc="input coefficients, after alignment to the EPI data",
    )
    ro_time = traits.Float(mandatory=True, desc="EPI readout time (s).")
    pe_dir = traits.Enum(
        "i",
        "i-",
        "j",
        "j-",
        "k",
        "k-",
        mandatory=True,
        desc="the phase-encoding direction corresponding to in_target",
    )
    low_mem = traits.Bool(False,
                          usedefault=True,
                          desc="perform on low-mem fingerprint regime")
Esempio n. 29
0
class ResponseSDInputSpec(MRTrix3BaseInputSpec):
    algorithm = traits.Enum(
        'msmt_5tt',
        'dhollander',
        'tournier',
        'tax',
        argstr='%s',
        position=1,
        mandatory=True,
        desc='response estimation algorithm (multi-tissue)')
    in_file = File(exists=True,
                   argstr='%s',
                   position=-5,
                   mandatory=True,
                   desc='input DWI image')
    mtt_file = File(argstr='%s', position=-4, desc='input 5tt image')
    wm_file = File('wm.txt',
                   argstr='%s',
                   position=-3,
                   usedefault=True,
                   desc='output WM response text file')
    gm_file = File(argstr='%s',
                   position=-2,
                   desc='output GM response text file')
    csf_file = File(argstr='%s',
                    position=-1,
                    desc='output CSF response text file')
    in_mask = File(exists=True,
                   argstr='-mask %s',
                   desc='provide initial mask image')
    max_sh = InputMultiObject(
        traits.Int,
        argstr='-lmax %s',
        sep=',',
        desc=(
            'maximum harmonic degree of response function - single value for '
            'single-shell response, list for multi-shell response'))
Esempio n. 30
0
class DiffusionSummaryInputSpec(BaseInterfaceInputSpec):
    distortion_correction = traits.Str(
        desc='Susceptibility distortion correction method', mandatory=True)
    pe_direction = traits.Enum(None,
                               'i',
                               'i-',
                               'j',
                               'j-',
                               mandatory=True,
                               desc='Phase-encoding direction detected')
    distortion_correction = traits.Str(mandatory=True,
                                       desc='Method used for SDC')
    impute_slice_threshold = traits.CFloat(
        desc='threshold for imputing a slice')
    hmc_transform = traits.Str(mandatory=True,
                               desc='transform used during HMC')
    hmc_model = traits.Str(desc='model used for hmc')
    b0_to_t1w_transform = traits.Enum("Rigid",
                                      "Affine",
                                      desc='Transform type for coregistration')
    dwi_denoise_window = traits.Int(desc='window size for dwidenoise')
    output_spaces = traits.List(desc='Target spaces')
    confounds_file = File(exists=True, desc='Confounds file')
    validation_reports = InputMultiObject(File(exists=True))