Esempio n. 1
0
class param2xfmInterfaceInput(CommandLineInputSpec):
    out_file = File(position=-1, argstr="%s", desc="resampled image")
    transformation = traits.List(desc="Transformation to apply")
Esempio n. 2
0
class EstimateFODInputSpec(MRTrix3BaseInputSpec):

    algorithm = traits.Enum('csd',
                            'msmt_csd',
                            argstr='%s',
                            mandatory=True,
                            position=0,
                            desc="Algorithm used for CSD estimation")

    in_file = File(exists=True,
                   argstr='%s',
                   mandatory=True,
                   position=-3,
                   desc='input diffusion weighted images')
    response = File(
        exists=True,
        argstr='%s',
        mandatory=True,
        position=-2,
        desc=('a text file containing the diffusion-weighted signal response '
              'function coefficients for a single fibre population'))
    out_file = File('fods.mif',
                    argstr='%s',
                    mandatory=True,
                    position=-1,
                    usedefault=True,
                    desc=('the output spherical harmonics coefficients'
                          ' image'))

    # DW Shell selection parameters
    shell = traits.List(traits.Float,
                        sep=',',
                        argstr='-shell %s',
                        desc='specify one or more dw gradient shells')

    # Spherical deconvolution parameters
    max_sh = traits.Int(8,
                        argstr='-lmax %d',
                        desc='maximum harmonic degree of response function')
    in_mask = File(exists=True,
                   argstr='-mask %s',
                   desc='provide initial mask image')
    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.'))
    sh_filter = File(
        exists=True,
        argstr='-filter %s',
        desc=('the linear frequency filtering parameters used for the initial '
              'linear spherical deconvolution step (default = [ 1 1 1 0 0 ]). '
              'These should be supplied as a text file containing the '
              'filtering coefficients for each even harmonic order.'))

    neg_lambda = traits.Float(
        1.0,
        argstr='-neg_lambda %f',
        desc=('the regularisation parameter lambda that controls the strength'
              ' of the non-negativity constraint'))
    thres = traits.Float(
        0.0,
        argstr='-threshold %f',
        desc=('the threshold below which the amplitude of the FOD is assumed '
              'to be zero, expressed as an absolute amplitude'))

    n_iter = traits.Int(50,
                        argstr='-niter %d',
                        desc=('the maximum number of iterations '
                              'to perform for each voxel'))
Esempio n. 3
0
class FilterListInputSpec(DynamicTraitedSpec, BaseInterfaceInputSpec):
    keys = traits.List(traits.Str(), mandatory=True)
    pattern = traits.Str(mandatory=True)
Esempio n. 4
0
class _UnzipJoinedSurfacesInputSpec(BaseInterfaceInputSpec):
    in_files = traits.List(
        InputMultiPath(File(exists=True),
                       mandatory=True,
                       desc='input GIfTI files'))
Esempio n. 5
0
class ProbTrackXInputSpec(FSLCommandInputSpec):
    thsamples = InputMultiPath(File(exists=True), mandatory=True)
    phsamples = InputMultiPath(File(exists=True), mandatory=True)
    fsamples = InputMultiPath(File(exists=True), mandatory=True)
    samples_base_name = traits.Str(
        "merged",
        desc='the rootname/base_name for samples files',
        argstr='--samples=%s',
        usedefault=True)
    mask = File(exists=True,
                desc='bet binary mask file in diffusion space',
                argstr='-m %s',
                mandatory=True)
    seed = traits.Either(
        File(exists=True),
        traits.List(File(exists=True)),
        traits.List(traits.List(traits.Int(), minlen=3, maxlen=3)),
        desc='seed volume(s), or voxel(s)' + 'or freesurfer label file',
        argstr='--seed=%s',
        mandatory=True)
    mode = traits.Enum(
        "simple",
        "two_mask_symm",
        "seedmask",
        desc=
        'options: simple (single seed voxel), seedmask (mask of seed voxels), '
        + 'twomask_symm (two bet binary masks) ',
        argstr='--mode=%s',
        genfile=True)
    target_masks = InputMultiPath(
        File(exits=True),
        desc='list of target masks - ' +
        'required for seeds_to_targets classification',
        argstr='--targetmasks=%s')
    mask2 = File(
        exists=True,
        desc='second bet binary mask (in diffusion space) in twomask_symm mode',
        argstr='--mask2=%s')
    waypoints = File(exists=True,
                     desc='waypoint mask or ascii list of waypoint masks - ' +
                     'only keep paths going through ALL the masks',
                     argstr='--waypoints=%s')
    network = traits.Bool(
        desc='activate network mode - only keep paths going through ' +
        'at least one seed mask (required if multiple seed masks)',
        argstr='--network')
    mesh = File(exists=True,
                desc='Freesurfer-type surface descriptor (in ascii format)',
                argstr='--mesh=%s')
    seed_ref = File(exists=True,
                    desc='reference vol to define seed space in ' +
                    'simple mode - diffusion space assumed if absent',
                    argstr='--seedref=%s')
    out_dir = Directory(exists=True,
                        argstr='--dir=%s',
                        desc='directory to put the final volumes in',
                        genfile=True)
    force_dir = traits.Bool(
        True,
        desc='use the actual directory name given - i.e. ' +
        'do not add + to make a new directory',
        argstr='--forcedir',
        usedefault=True)
    opd = traits.Bool(True,
                      desc='outputs path distributions',
                      argstr='--opd',
                      usedefault=True)
    correct_path_distribution = traits.Bool(
        desc='correct path distribution for the length of the pathways',
        argstr='--pd')
    os2t = traits.Bool(desc='Outputs seeds to targets', argstr='--os2t')
    #paths_file = File('nipype_fdtpaths', usedefault=True, argstr='--out=%s',
    #                 desc='produces an output file (default is fdt_paths)')
    avoid_mp = File(
        exists=True,
        desc='reject pathways passing through locations given by this mask',
        argstr='--avoid=%s')
    stop_mask = File(exists=True,
                     argstr='--stop=%s',
                     desc='stop tracking at locations given by this mask file')
    xfm = File(
        exists=True,
        argstr='--xfm=%s',
        desc='transformation matrix taking seed space to DTI space ' +
        '(either FLIRT matrix or FNIRT warp_field) - default is identity')
    inv_xfm = File(
        argstr='--invxfm=%s',
        desc='transformation matrix taking DTI space to seed' +
        ' space (compulsory when using a warp_field for seeds_to_dti)')
    n_samples = traits.Int(5000,
                           argstr='--nsamples=%d',
                           desc='number of samples - default=5000',
                           usedefault=True)
    n_steps = traits.Int(argstr='--nsteps=%d',
                         desc='number of steps per sample - default=2000')
    dist_thresh = traits.Float(argstr='--distthresh=%.3f',
                               desc='discards samples shorter than ' +
                               'this threshold (in mm - default=0)')
    c_thresh = traits.Float(argstr='--cthr=%.3f',
                            desc='curvature threshold - default=0.2')
    sample_random_points = traits.Bool(
        argstr='--sampvox', desc='sample random points within seed voxels')
    step_length = traits.Float(argstr='--steplength=%.3f',
                               desc='step_length in mm - default=0.5')
    loop_check = traits.Bool(argstr='--loopcheck',
                             desc='perform loop_checks on paths -' +
                             ' slower, but allows lower curvature threshold')
    use_anisotropy = traits.Bool(argstr='--usef',
                                 desc='use anisotropy to constrain tracking')
    rand_fib = traits.Enum(
        0,
        1,
        2,
        3,
        argstr='--randfib=%d',
        desc='options: 0 - default, 1 - to randomly sample' +
        ' initial fibres (with f > fibthresh), 2 - to sample in ' +
        'proportion fibres (with f>fibthresh) to f, 3 - to sample ALL ' +
        'populations at random (even if f<fibthresh)')
    fibst = traits.Int(
        argstr='--fibst=%d',
        desc='force a starting fibre for tracking - ' +
        'default=1, i.e. first fibre orientation. Only works if randfib==0')
    mod_euler = traits.Bool(argstr='--modeuler',
                            desc='use modified euler streamlining')
    random_seed = traits.Bool(argstr='--rseed', desc='random seed')
    s2tastext = traits.Bool(argstr='--s2tastext',
                            desc='output seed-to-target counts as a' +
                            ' text file (useful when seeding from a mesh)')
    verbose = traits.Enum(0,
                          1,
                          2,
                          desc="Verbose level, [0-2]." +
                          "Level 2 is required to output particle files.",
                          argstr="--verbose=%d")
Esempio n. 6
0
class SegStatsInputSpec(FSTraitedSpec):
    _xor_inputs = ('segmentation_file', 'annot', 'surf_label')
    segmentation_file = File(exists=True,
                             argstr='--seg %s',
                             xor=_xor_inputs,
                             mandatory=True,
                             desc='segmentation volume path')
    annot = traits.Tuple(traits.Str,
                         traits.Enum('lh', 'rh'),
                         traits.Str,
                         argstr='--annot %s %s %s',
                         xor=_xor_inputs,
                         mandatory=True,
                         desc='subject hemi parc : use surface parcellation')
    surf_label = traits.Tuple(traits.Str,
                              traits.Enum('lh', 'rh'),
                              traits.Str,
                              argstr='--slabel %s %s %s',
                              xor=_xor_inputs,
                              mandatory=True,
                              desc='subject hemi label : use surface label')
    summary_file = File(argstr='--sum %s',
                        genfile=True,
                        desc='Segmentation stats summary table file')
    partial_volume_file = File(exists=True,
                               argstr='--pv %f',
                               desc='Compensate for partial voluming')
    in_file = File(exists=True,
                   argstr='--i %s',
                   desc='Use the segmentation to report stats on this volume')
    frame = traits.Int(argstr='--frame %d',
                       desc='Report stats on nth frame of input volume')
    multiply = traits.Float(argstr='--mul %f', desc='multiply input by val')
    calc_snr = traits.Bool(
        argstr='--snr', desc='save mean/std as extra column in output table')
    calc_power = traits.Enum(
        'sqr',
        'sqrt',
        argstr='--%s',
        desc='Compute either the sqr or the sqrt of the input')
    _ctab_inputs = ('color_table_file', 'default_color_table',
                    'gca_color_table')
    color_table_file = File(exists=True,
                            argstr='--ctab %s',
                            xor=_ctab_inputs,
                            desc='color table file with seg id names')
    default_color_table = traits.Bool(
        argstr='--ctab-default',
        xor=_ctab_inputs,
        desc='use $FREESURFER_HOME/FreeSurferColorLUT.txt')
    gca_color_table = File(exists=True,
                           argstr='--ctab-gca %s',
                           xor=_ctab_inputs,
                           desc='get color table from GCA (CMA)')
    segment_id = traits.List(argstr='--id %s...',
                             desc='Manually specify segmentation ids')
    exclude_id = traits.Int(argstr='--excludeid %d',
                            desc='Exclude seg id from report')
    exclude_ctx_gm_wm = traits.Bool(
        argstr='--excl-ctxgmwm', desc='exclude cortical gray and white matter')
    wm_vol_from_surf = traits.Bool(argstr='--surf-wm-vol',
                                   desc='Compute wm volume from surf')
    cortex_vol_from_surf = traits.Bool(argstr='--surf-ctx-vol',
                                       desc='Compute cortex volume from surf')
    non_empty_only = traits.Bool(argstr='--nonempty',
                                 desc='Only report nonempty segmentations')
    mask_file = File(exists=True,
                     argstr='--mask %s',
                     desc='Mask volume (same size as seg')
    mask_thresh = traits.Float(argstr='--maskthresh %f',
                               desc='binarize mask with this threshold <0.5>')
    mask_sign = traits.Enum('abs',
                            'pos',
                            'neg',
                            '--masksign %s',
                            desc='Sign for mask threshold: pos, neg, or abs')
    mask_frame = traits.Int(
        '--maskframe %d',
        requires=['mask_file'],
        desc='Mask with this (0 based) frame of the mask volume')
    mask_invert = traits.Bool(argstr='--maskinvert',
                              desc='Invert binarized mask volume')
    mask_erode = traits.Int(argstr='--maskerode %d',
                            desc='Erode mask by some amount')
    brain_vol = traits.Enum(
        'brain-vol-from-seg',
        'brainmask',
        '--%s',
        desc=
        'Compute brain volume either with ``brainmask`` or ``brain-vol-from-seg``'
    )
    etiv = traits.Bool(argstr='--etiv',
                       desc='Compute ICV from talairach transform')
    etiv_only = traits.Enum(
        'etiv',
        'old-etiv',
        '--%s-only',
        desc='Compute etiv and exit.  Use ``etiv`` or ``old-etiv``')
    avgwf_txt_file = traits.Either(
        traits.Bool,
        File,
        argstr='--avgwf %s',
        desc='Save average waveform into file (bool or filename)')
    avgwf_file = traits.Either(traits.Bool,
                               File,
                               argstr='--avgwfvol %s',
                               desc='Save as binary volume (bool or filename)')
    sf_avg_file = traits.Either(traits.Bool,
                                File,
                                argstr='--sfavg %s',
                                desc='Save mean across space and time')
    vox = traits.List(
        traits.Int,
        argstr='--vox %s',
        desc='Replace seg with all 0s except at C R S (three int inputs)')
Esempio n. 7
0
class ComputeTDIInputSpec(CommandLineInputSpec):
    in_file = File(exists=True,
                   argstr='%s',
                   mandatory=True,
                   position=-2,
                   desc='input tractography')
    out_file = File('tdi.mif',
                    argstr='%s',
                    usedefault=True,
                    position=-1,
                    desc='output TDI file')
    reference = File(exists=True,
                     argstr='-template %s',
                     desc='a reference'
                     'image to be used as template')
    vox_size = traits.List(traits.Int,
                           argstr='-vox %s',
                           sep=',',
                           desc='voxel dimensions')
    data_type = traits.Enum('float',
                            'unsigned int',
                            argstr='-datatype %s',
                            desc='specify output image data type')
    use_dec = traits.Bool(argstr='-dec', desc='perform mapping in DEC space')
    dixel = File(argstr='-dixel %s',
                 desc='map streamlines to'
                 'dixels within each voxel. Directions are stored as'
                 'azimuth elevation pairs.')
    max_tod = traits.Int(argstr='-tod %d',
                         desc='generate a Track Orientation '
                         'Distribution (TOD) in each voxel.')

    contrast = traits.Enum('tdi',
                           'length',
                           'invlength',
                           'scalar_map',
                           'scalar_map_conut',
                           'fod_amp',
                           'curvature',
                           argstr='-constrast %s',
                           desc='define the desired '
                           'form of contrast for the output image')
    in_map = File(exists=True,
                  argstr='-image %s',
                  desc='provide the'
                  'scalar image map for generating images with '
                  '\'scalar_map\' contrasts, or the SHs image for fod_amp')

    stat_vox = traits.Enum('sum',
                           'min',
                           'mean',
                           'max',
                           argstr='-stat_vox %s',
                           desc='define the statistic for choosing the final'
                           'voxel intesities for a given contrast')
    stat_tck = traits.Enum(
        'mean',
        'sum',
        'min',
        'max',
        'median',
        'mean_nonzero',
        'gaussian',
        'ends_min',
        'ends_mean',
        'ends_max',
        'ends_prod',
        argstr='-stat_tck %s',
        desc='define the statistic for choosing '
        'the contribution to be made by each streamline as a function of'
        ' the samples taken along their lengths.')

    fwhm_tck = traits.Float(
        argstr='-fwhm_tck %f',
        desc='define the statistic for choosing the'
        ' contribution to be made by each streamline as a function of the '
        'samples taken along their lengths')

    map_zero = traits.Bool(
        argstr='-map_zero',
        desc='if a streamline has zero contribution based '
        'on the contrast & statistic, typically it is not mapped; use this '
        'option to still contribute to the map even if this is the case '
        '(these non-contributing voxels can then influence the mean value in '
        'each voxel of the map)')

    upsample = traits.Int(argstr='-upsample %d',
                          desc='upsample the tracks by'
                          ' some ratio using Hermite interpolation before '
                          'mappping')

    precise = traits.Bool(
        argstr='-precise',
        desc='use a more precise streamline mapping '
        'strategy, that accurately quantifies the length through each voxel '
        '(these lengths are then taken into account during TWI calculation)')
    ends_only = traits.Bool(argstr='-ends_only',
                            desc='only map the streamline'
                            ' endpoints to the image')

    tck_weights = File(exists=True,
                       argstr='-tck_weights_in %s',
                       desc='specify'
                       ' a text scalar file containing the streamline weights')
    nthreads = traits.Int(argstr='-nthreads %d',
                          desc='number of threads. if zero, the number'
                          ' of available cpus will be used',
                          nohash=True)
Esempio n. 8
0
class _AddTPMsInputSpec(BaseInterfaceInputSpec):
    in_files = InputMultiPath(File(exists=True),
                              mandatory=True,
                              desc="input list of ROIs")
    indices = traits.List(traits.Int, desc="select specific maps")
Esempio n. 9
0
class _AddTSVHeaderInputSpec(BaseInterfaceInputSpec):
    in_file = File(exists=True, mandatory=True, desc="input file")
    columns = traits.List(traits.Str,
                          mandatory=True,
                          desc="header for columns")
Esempio n. 10
0
class MaskCoilsOutputSpec(BaseMaskOutputSpec):

    out_files = traits.List(File(exists=True), desc="Output files")
Esempio n. 11
0
class DialateMaskInputSpec(BaseMaskInputSpec):

    in_file = File(exists=True, desc="Mask to dialate")
    dialation = traits.List((traits.Float(), traits.Float(), traits.Float),
                            desc="Size of the dialation")
Esempio n. 12
0
class MRCalcInputSpec(CommandLineInputSpec):

    operands = traits.List(traits.Any(),
                           argstr='%s',
                           mandatory=True,
                           position=-3,
                           desc="Diffusion weighted images with graident info")

    out_file = File(genfile=True,
                    argstr='%s',
                    position=-1,
                    desc="Extracted DW or b-zero images")
    out_ext = traits.Str(desc='Extention of the output file.')

    operation = traits.Enum('abs',
                            'neg',
                            'sqrt',
                            'exp',
                            'log',
                            'log10',
                            'cos',
                            'sin',
                            'tan',
                            'cosh',
                            'sinh',
                            'tanh',
                            'acos',
                            'asin',
                            'atan',
                            'acosh',
                            'asinh',
                            'atanh',
                            'round',
                            'ceil',
                            'floor',
                            'isnan',
                            'isinf',
                            'finite',
                            'real',
                            'imag',
                            'phase',
                            'conj',
                            'add',
                            'subtract',
                            'multiply',
                            'divide',
                            'pow',
                            'min',
                            'max',
                            'lt',
                            'gt',
                            'le',
                            'ge',
                            'eq',
                            'neq',
                            'complex',
                            'if',
                            mandatory=True,
                            argstr='-%s',
                            position=-2,
                            desc=("Operation to apply to the files"))

    quiet = traits.Bool(mandatory=False,
                        argstr="-quiet",
                        desc="Don't display output during operation")
Esempio n. 13
0
class InverseSolutionConnInputSpec(BaseInterfaceInputSpec):
    """Input specification for InverseSolution."""

    sbj_id = traits.String(desc='subject id', mandatory=True)
    subjects_dir = traits.Directory(
        exists=True,
        desc='Freesurfer main directory',  # noqa
        mandatory=True)
    raw_filename = traits.File(exists=True,
                               desc='raw filename',
                               mandatory=True)
    cov_filename = traits.File(exists=True,
                               desc='Noise Covariance matrix',
                               mandatory=True)
    fwd_filename = traits.File(exists=True, desc='LF matrix', mandatory=True)
    is_epoched = traits.Bool(False,
                             usedefault=True,
                             desc='if true raw data will be epoched',
                             mandatory=False)
    is_fixed = traits.Bool(False,
                           usedefault=True,
                           desc='if true we use fixed orientation',
                           mandatory=False)
    events_id = traits.Dict({},
                            desc='the id of all events to consider.',
                            usedefault=True,
                            mandatory=False)
    condition = traits.List(desc='list of conditions', mandatory=False)
    t_min = traits.Float(None, desc='start time before event', mandatory=False)
    t_max = traits.Float(None, desc='end time after event', mandatory=False)
    is_evoked = traits.Bool(desc='if true if we want to create evoked data',
                            mandatory=False)
    is_ave = traits.Bool(False,
                         desc='if true if we have already evoked data',
                         mandatory=False)
    inv_method = traits.String('MNE',
                               desc='possible inverse methods are \
                               sLORETA, MNE, dSPM',
                               usedefault=True,
                               mandatory=True)
    snr = traits.Float(1.0,
                       usedefault=True,
                       desc='use smaller SNR for \
                       raw data',
                       mandatory=False)
    parc = traits.String('aparc',
                         usedefault=True,
                         desc='the parcellation to use: aparc vs aparc.a2009s',
                         mandatory=False)
    aseg = traits.Bool(desc='if true sub structures will be considered',
                       mandatory=False)
    aseg_labels = traits.List(desc='list of substructures in the src space',
                              mandatory=False)
    all_src_space = traits.Bool(False,
                                desc='if true compute inverse on all \
                                source space',
                                usedefault=True,
                                mandatory=False)
    ROIs_mean = traits.Bool(True,
                            desc='if true compute mean on ROIs',
                            usedefault=True,
                            mandatory=False)
Esempio n. 14
0
class ResultdictsOutputSpec(TraitedSpec):
    resultdicts = traits.List(traits.Dict(traits.Str(), traits.Any()))
Esempio n. 15
0
class MRISPreprocInputSpec(FSTraitedSpec):
    out_file = File(argstr='--out %s', genfile=True, desc='output filename')
    target = traits.Str(argstr='--target %s',
                        mandatory=True,
                        desc='target subject name')
    hemi = traits.Enum('lh',
                       'rh',
                       argstr='--hemi %s',
                       mandatory=True,
                       desc='hemisphere for source and target')
    surf_measure = traits.Str(
        argstr='--meas %s',
        xor=('surf_measure', 'surf_measure_file', 'surf_area'),
        desc='Use subject/surf/hemi.surf_measure as input')
    surf_area = traits.Str(
        argstr='--area %s',
        xor=('surf_measure', 'surf_measure_file', 'surf_area'),
        desc=
        'Extract vertex area from subject/surf/hemi.surfname to use as input.')
    subjects = traits.List(argstr='--s %s...',
                           xor=('subjects', 'fsgd_file', 'subject_file'),
                           desc='subjects from who measures are calculated')
    fsgd_file = File(exists=True,
                     argstr='--fsgd %s',
                     xor=('subjects', 'fsgd_file', 'subject_file'),
                     desc='specify subjects using fsgd file')
    subject_file = File(
        exists=True,
        argstr='--f %s',
        xor=('subjects', 'fsgd_file', 'subject_file'),
        desc='file specifying subjects separated by white space')
    surf_measure_file = InputMultiPath(
        File(exists=True),
        argstr='--is %s...',
        xor=('surf_measure', 'surf_measure_file', 'surf_area'),
        desc='file alternative to surfmeas, still requires list of subjects')
    source_format = traits.Str(argstr='--srcfmt %s', desc='source format')
    surf_dir = traits.Str(argstr='--surfdir %s',
                          desc='alternative directory (instead of surf)')
    vol_measure_file = InputMultiPath(
        traits.Tuple(File(exists=True), File(exists=True)),
        argstr='--iv %s %s...',
        desc='list of volume measure and reg file tuples')
    proj_frac = traits.Float(argstr='--projfrac %s',
                             desc='projection fraction for vol2surf')
    fwhm = traits.Float(argstr='--fwhm %f',
                        xor=['num_iters'],
                        desc='smooth by fwhm mm on the target surface')
    num_iters = traits.Int(
        argstr='--niters %d',
        xor=['fwhm'],
        desc='niters : smooth by niters on the target surface')
    fwhm_source = traits.Float(argstr='--fwhm-src %f',
                               xor=['num_iters_source'],
                               desc='smooth by fwhm mm on the source surface')
    num_iters_source = traits.Int(
        argstr='--niterssrc %d',
        xor=['fwhm_source'],
        desc='niters : smooth by niters on the source surface')
    smooth_cortex_only = traits.Bool(
        argstr='--smooth-cortex-only',
        desc='only smooth cortex (ie, exclude medial wall)')
Esempio n. 16
0
class _JoinTSVColumnsInputSpec(BaseInterfaceInputSpec):
    in_file = File(exists=True, mandatory=True, desc="input file")
    join_file = File(exists=True, mandatory=True, desc="file to be adjoined")
    side = traits.Enum("right", "left", usedefault=True, desc="where to join")
    columns = traits.List(traits.Str, desc="header for columns")
Esempio n. 17
0
class BinarizeInputSpec(FSTraitedSpec):
    in_file = File(exists=True,
                   argstr='--i %s',
                   mandatory=True,
                   copyfile=False,
                   desc='input volume')
    min = traits.Float(argstr='--min %f',
                       xor=['wm_ven_csf'],
                       desc='min thresh')
    max = traits.Float(argstr='--max %f',
                       xor=['wm_ven_csf'],
                       desc='max thresh')
    rmin = traits.Float(argstr='--rmin %f',
                        desc='compute min based on rmin*globalmean')
    rmax = traits.Float(argstr='--rmax %f',
                        desc='compute max based on rmax*globalmean')
    match = traits.List(traits.Int,
                        argstr='--match %d...',
                        desc='match instead of threshold')
    wm = traits.Bool(argstr='--wm',
                     desc='set match vals to 2 and 41 (aseg for cerebral WM)')
    ventricles = traits.Bool(
        argstr='--ventricles',
        desc='set match vals those for aseg ventricles+choroid (not 4th)')
    wm_ven_csf = traits.Bool(
        argstr='--wm+vcsf',
        xor=['min', 'max'],
        desc='WM and ventricular CSF, including choroid (not 4th)')
    binary_file = File(argstr='--o %s',
                       genfile=True,
                       desc='binary output volume')
    out_type = traits.Enum('nii',
                           'nii.gz',
                           'mgz',
                           argstr='',
                           desc='output file type')
    count_file = traits.Either(
        traits.Bool,
        File,
        argstr='--count %s',
        desc='save number of hits in ascii file (hits, ntotvox, pct)')
    bin_val = traits.Int(argstr='--binval %d',
                         desc='set vox within thresh to val (default is 1)')
    bin_val_not = traits.Int(
        argstr='--binvalnot %d',
        desc='set vox outside range to val (default is 0)')
    invert = traits.Bool(argstr='--inv', desc='set binval=0, binvalnot=1')
    frame_no = traits.Int(argstr='--frame %s',
                          desc='use 0-based frame of input (default is 0)')
    merge_file = File(exists=True,
                      argstr='--merge %s',
                      desc='merge with mergevol')
    mask_file = File(exists=True,
                     argstr='--mask maskvol',
                     desc='must be within mask')
    mask_thresh = traits.Float(argstr='--mask-thresh %f',
                               desc='set thresh for mask')
    abs = traits.Bool(argstr='--abs',
                      desc='take abs of invol first (ie, make unsigned)')
    bin_col_num = traits.Bool(
        argstr='--bincol',
        desc='set binarized voxel value to its column number')
    zero_edges = traits.Bool(argstr='--zero-edges',
                             desc='zero the edge voxels')
    zero_slice_edge = traits.Bool(argstr='--zero-slice-edges',
                                  desc='zero the edge slice voxels')
    dilate = traits.Int(argstr='--dilate %d',
                        desc='niters: dilate binarization in 3D')
    erode = traits.Int(
        argstr='--erode  %d',
        desc='nerode: erode binarization in 3D (after any dilation)')
    erode2d = traits.Int(
        argstr='--erode2d %d',
        desc='nerode2d: erode binarization in 2D (after any 3D erosion)')
Esempio n. 18
0
class _DictMergeInputSpec(BaseInterfaceInputSpec):
    in_dicts = traits.List(
        traits.Either(traits.Dict, traits.Instance(OrderedDict)),
        desc="Dictionaries to be merged. In the event of a collision, values "
        "from dictionaries later in the list receive precedence.",
    )
Esempio n. 19
0
class IteratorToFileInputSpec(TraitedSpec):
    ids = traits.List(traits.Str(), desc="ID of the iterable")
    out_file = File(genfile=True, desc="The name of the generated file")
Esempio n. 20
0
class ReadSidecarJSONInputSpec(BaseInterfaceInputSpec):
    in_file = File(exists=True, mandatory=True, desc='the input nifti file')
    fields = traits.List(traits.Str, desc='get only certain fields')
Esempio n. 21
0
class ANTSInputSpec(ANTSCommandInputSpec):
    dimension = traits.Enum(3,
                            2,
                            argstr='%d',
                            usedefault=False,
                            position=1,
                            desc='image dimension (2 or 3)')
    fixed_image = InputMultiPath(
        File(exists=True),
        mandatory=True,
        desc=('image to apply transformation to (generally a coregistered '
              'functional)'))
    moving_image = InputMultiPath(
        File(exists=True),
        argstr='%s',
        mandatory=True,
        desc=('image to apply transformation to (generally a coregistered '
              'functional)'))

    metric = traits.List(traits.Enum('CC', 'MI', 'SMI', 'PR', 'SSD', 'MSQ',
                                     'PSE'),
                         mandatory=True,
                         desc='')

    metric_weight = traits.List(traits.Float(), requires=['metric'], desc='')
    radius = traits.List(traits.Int(), requires=['metric'], desc='')

    output_transform_prefix = traits.Str('out',
                                         usedefault=True,
                                         argstr='--output-naming %s',
                                         mandatory=True,
                                         desc='')
    transformation_model = traits.Enum('Diff',
                                       'Elast',
                                       'Exp',
                                       'Greedy Exp',
                                       'SyN',
                                       argstr='%s',
                                       mandatory=True,
                                       desc='')
    gradient_step_length = traits.Int(requires=['transformation_model'],
                                      desc='')
    number_of_time_steps = traits.Int(requires=['gradient_step_length'],
                                      desc='')
    delta_time = traits.Float(requires=['number_of_time_steps'], desc='')
    symmetry_type = traits.Float(requires=['delta_time'], desc='')

    use_histogram_matching = traits.Bool(argstr='%s',
                                         default=True,
                                         usedefault=True)
    number_of_iterations = traits.List(traits.Int(),
                                       argstr='--number-of-iterations %s',
                                       sep='x')
    smoothing_sigmas = traits.List(traits.Int(),
                                   argstr='--gaussian-smoothing-sigmas %s',
                                   sep='x')
    subsampling_factors = traits.List(traits.Int(),
                                      argstr='--subsampling-factors %s',
                                      sep='x')
    affine_gradient_descent_option = traits.List(traits.Float(), argstr='%s')

    mi_option = traits.List(traits.Int(), argstr='--MI-option %s', sep='x')
    regularization = traits.Enum('Gauss', 'DMFFD', argstr='%s', desc='')
    regularization_gradient_field_sigma = traits.Float(
        requires=['regularization'], desc='')
    regularization_deformation_field_sigma = traits.Float(
        requires=['regularization'], desc='')
    number_of_affine_iterations = traits.List(
        traits.Int(), argstr='--number-of-affine-iterations %s', sep='x')
Esempio n. 22
0
class ScanTimesInfoInputSpec(BaseInterfaceInputSpec):

    dicom_infos = traits.List(desc='List of dicoms to calculate the difference'
                              ' between consecutive scan start times.')
Esempio n. 23
0
class _UnzipJoinedSurfacesOutputSpec(TraitedSpec):
    out_files = traits.List(
        OutputMultiPath(File(exists=True),
                        desc='output pointcloud in PLY format'))
    surf_keys = traits.List(traits.Str, desc='surface identifier keys')
Esempio n. 24
0
class Nii2DicomInputSpec(TraitedSpec):
    in_file = File(mandatory=True, desc='input nifti file')
    reference_dicom = traits.List(mandatory=True, desc='original umap')
Esempio n. 25
0
class ProjThreshOuputSpec(TraitedSpec):
    out_files = traits.List(
        File,
        exists=True,
        desc='path/name of output volume after thresholding')
Esempio n. 26
0
class LOGISMOSBInputSpec(CommandLineInputSpec):
    t1_file = File(exists=True,
                   desc='T1 scan output by BAW',
                   argstr='--inputT1 %s',
                   mandatory=True)
    t2_file = File(exists=True,
                   genfile=True,
                   desc='T2 scan output by BAW',
                   argstr='--inputT2 %s',
                   mandatory=False)
    mesh_file = File(
        exists=True,
        desc=
        'final mesh of the white matter surface (must have a genus equal to 0)',
        argstr='-m %s',
        mandatory=True)
    wm_file = File(
        exists=True,
        desc=
        'final binary image of the white matter surface (must have a genus equal to 0)',
        argstr='-b %s',
        mandatory=True)
    atlas_file = File(
        exists=True,
        desc=
        'hcnma atlas to define brain regions. If different atlas is used, thick '
        + 'regions must be defined',
        argstr='-z %s',
        mandatory=False)
    brainlabels_file = File(exists=True,
                            desc='skullstripped brainlabels file',
                            argstr='--inputABCLabels %s',
                            mandatory=True)
    smoothnessConstraint = traits.Int(desc='smoothness constraint',
                                      argstr='--smoothnessConstraint %d',
                                      mandatory=True)
    nColumns = traits.Int(desc="number of vertices",
                          argstr="--nColumns %d",
                          Mandatory=False)
    columnChoice = traits.String(desc="some parameter",
                                 argstr="--columnChoice %s",
                                 Mandatory=False)
    columnHeight = traits.Int(desc="column height",
                              argstr="--columnHeight %d",
                              Mandatory=False)
    nodeSpacing = traits.Float(desc="node spacing",
                               argstr="--nodeSpacing %.2f",
                               Mandatory=False)
    w = traits.Float(desc="w", argstr="-w %.2f", Mandatory=False)
    a = traits.Float(desc="a", argstr="-a %.2f", Mandatory=False)
    nPropagate = traits.Int(desc="number of propagations",
                            argstr="--nPropagate %d",
                            Mandatory=False)
    basename = traits.String(desc="basename for output files",
                             argstr="--outputBase %s",
                             Mandatory=True)
    thick_regions = traits.List(
        traits.Int(),
        argstr="-r %s",
        mandatory=False,
        sep=',',
        desc="List of regions in the atlas file to that will be thicker")
    useHNCMALabels = traits.Bool(
        argstr="--useHNCMALabels",
        desc="Uses HCNMA label map to define thick regions")
    wm_proba_file = File(exist=True,
                         argstr='--wmProbaMap %s',
                         desc="White matter pobability map.")
    gm_proba_file = File(exist=True,
                         argstr='--gmProbaMap %s',
                         desc="Gray matter pobability map.")
Esempio n. 27
0
class QDecOutputSpec(TraitedSpec):

    stats_directory = Directory(desc="stat_tables directory", mandatory=True)
    stdout = traits.List(traits.Str(), desc="stdout messages")
    stderr = traits.List(traits.Str(), desc="stderr messages")
Esempio n. 28
0
class MaskCoverageOutputSpec(DynamicTraitedSpec):
    out_files = OutputMultiPath(File(exists=True))
    coverage = traits.List(traits.Float)
class ResampleScalarVectorDWIVolumeInputSpec(CommandLineInputSpec):
    inputVolume = File(position=-2,
                       desc="Input Volume to be resampled",
                       exists=True,
                       argstr="%s")
    outputVolume = traits.Either(traits.Bool,
                                 File(),
                                 position=-1,
                                 hash_files=False,
                                 desc="Resampled Volume",
                                 argstr="%s")
    Reference = File(desc="Reference Volume (spacing,size,orientation,origin)",
                     exists=True,
                     argstr="--Reference %s")
    transformationFile = File(exists=True, argstr="--transformationFile %s")
    defField = File(
        desc=
        "File containing the deformation field (3D vector image containing vectors with 3 components)",
        exists=True,
        argstr="--defField %s")
    hfieldtype = traits.Enum("displacement",
                             "h-Field",
                             desc="Set if the deformation field is an h-Field",
                             argstr="--hfieldtype %s")
    interpolation = traits.Enum(
        "linear",
        "nn",
        "ws",
        "bs",
        desc=
        "Sampling algorithm (linear or nn (nearest neighborhoor), ws (WindowedSinc), bs (BSpline) )",
        argstr="--interpolation %s")
    transform_order = traits.Enum(
        "input-to-output",
        "output-to-input",
        desc="Select in what order the transforms are read",
        argstr="--transform_order %s")
    notbulk = traits.Bool(
        desc=
        "The transform following the BSpline transform is not set as a bulk transform for the BSpline transform",
        argstr="--notbulk ")
    spaceChange = traits.Bool(
        desc=
        "Space Orientation between transform and image is different (RAS/LPS) (warning: if the transform is a Transform Node in Slicer3, do not select)",
        argstr="--spaceChange ")
    rotation_point = traits.List(
        desc=
        "Rotation Point in case of rotation around a point (otherwise useless)",
        argstr="--rotation_point %s")
    centered_transform = traits.Bool(
        desc=
        "Set the center of the transformation to the center of the input image",
        argstr="--centered_transform ")
    image_center = traits.Enum(
        "input",
        "output",
        desc=
        "Image to use to center the transform (used only if \'Centered Transform\' is selected)",
        argstr="--image_center %s")
    Inverse_ITK_Transformation = traits.Bool(
        desc=
        "Inverse the transformation before applying it from output image to input image",
        argstr="--Inverse_ITK_Transformation ")
    spacing = InputMultiPath(
        traits.Float,
        desc="Spacing along each dimension (0 means use input spacing)",
        sep=",",
        argstr="--spacing %s")
    size = InputMultiPath(
        traits.Float,
        desc="Size along each dimension (0 means use input size)",
        sep=",",
        argstr="--size %s")
    origin = traits.List(desc="Origin of the output Image",
                         argstr="--origin %s")
    direction_matrix = InputMultiPath(
        traits.Float,
        desc=
        "9 parameters of the direction matrix by rows (ijk to LPS if LPS transform, ijk to RAS if RAS transform)",
        sep=",",
        argstr="--direction_matrix %s")
    number_of_thread = traits.Int(
        desc="Number of thread used to compute the output image",
        argstr="--number_of_thread %d")
    default_pixel_value = traits.Float(
        desc=
        "Default pixel value for samples falling outside of the input region",
        argstr="--default_pixel_value %f")
    window_function = traits.Enum(
        "h",
        "c",
        "w",
        "l",
        "b",
        desc=
        "Window Function , h = Hamming , c = Cosine , w = Welch , l = Lanczos , b = Blackman",
        argstr="--window_function %s")
    spline_order = traits.Int(desc="Spline Order", argstr="--spline_order %d")
    transform_matrix = InputMultiPath(
        traits.Float,
        desc=
        "12 parameters of the transform matrix by rows ( --last 3 being translation-- )",
        sep=",",
        argstr="--transform_matrix %s")
    transform = traits.Enum(
        "rt",
        "a",
        desc="Transform algorithm, rt = Rigid Transform, a = Affine Transform",
        argstr="--transform %s")
Esempio n. 30
0
class ContrastsInputSpec(BaseInterfaceInputSpec):
    in_list = traits.List(traits.Any, mandatory=True, desc='list of contrasts')
    design = File(exists=True, desc="design file to be used in GLM")