Beispiel #1
0
class BRAINSInitilizedControlPointsInputSpec(CommandLineInputSpec):
    inputVolume = File( exists = True,argstr = "--inputVolume %s")
    outputVolume = traits.Either(traits.Bool, File(), hash_files = False,argstr = "--outputVolume %s")
    splineGridSize = InputMultiPath(traits.Int, sep = ",",argstr = "--splineGridSize %s")
    permuteOrder = InputMultiPath(traits.Int, sep = ",",argstr = "--permuteOrder %s")
    outputLandmarksFile = traits.Str( argstr = "--outputLandmarksFile %s")
Beispiel #2
0
class NwarpApplyPriorsInputSpec(CommandLineInputSpec):
    in_file = traits.Either(File(exists=True),
                            traits.List(File(exists=True)),
                            mandatory=True,
                            argstr='-source %s',
                            desc='the name of the dataset to be warped '
                            'can be multiple datasets')
    warp = traits.String(
        desc='the name of the warp dataset. '
        'multiple warps can be concatenated (make sure they exist)',
        argstr='-nwarp %s',
        mandatory=True)
    inv_warp = traits.Bool(
        desc='After the warp specified in \'-nwarp\' is computed, invert it',
        argstr='-iwarp')
    master = traits.File(
        exists=True,
        desc='the name of the master dataset, which defines the output grid',
        argstr='-master %s')
    interp = traits.Enum(
        'wsinc5',
        'NN',
        'nearestneighbour',
        'nearestneighbor',
        'linear',
        'trilinear',
        'cubic',
        'tricubic',
        'quintic',
        'triquintic',
        desc='defines interpolation method to use during warp',
        argstr='-interp %s',
        usedefault=True)
    ainterp = traits.Enum(
        'NN',
        'nearestneighbour',
        'nearestneighbor',
        'linear',
        'trilinear',
        'cubic',
        'tricubic',
        'quintic',
        'triquintic',
        'wsinc5',
        desc='specify a different interpolation method than might '
        'be used for the warp',
        argstr='-ainterp %s')
    out_file = traits.Either(File(),
                             traits.List(File()),
                             mandatory=True,
                             argstr='-prefix %s',
                             desc='output image file name')
    short = traits.Bool(
        desc='Write output dataset using 16-bit short integers, rather than '
        'the usual 32-bit floats.',
        argstr='-short')
    quiet = traits.Bool(desc='don\'t be verbose :(',
                        argstr='-quiet',
                        xor=['verb'])
    verb = traits.Bool(desc='be extra verbose :)',
                       argstr='-verb',
                       xor=['quiet'])
class CheckerBoardFilterInputSpec(CommandLineInputSpec):
    checkerPattern = InputMultiPath(traits.Int, desc="The pattern of input 1 and input 2 in the output image. The user can specify the number of checkers in each dimension. A checkerPattern of 2,2,1 means that images will alternate in every other checker in the first two dimensions. The same pattern will be used in the 3rd dimension.", sep=",", argstr="--checkerPattern %s")
    inputVolume1 = File(position=-3, desc="First Input volume", exists=True, argstr="%s")
    inputVolume2 = File(position=-2, desc="Second Input volume", exists=True, argstr="%s")
    outputVolume = traits.Either(traits.Bool, File(), position=-1, hash_files=False, desc="Output filtered", argstr="%s")
Beispiel #4
0
class OrientScalarVolumeInputSpec(CommandLineInputSpec):
    inputVolume1 = File(argstr="%s",
                        desc="Input volume 1",
                        position=-2,
                        exists=True)
    outputVolume = traits.Either(traits.Bool,
                                 File(),
                                 argstr="%s",
                                 desc="The oriented volume",
                                 position=-1,
                                 hash_files=False)
    orientation = traits.Enum("Axial",
                              "Coronal",
                              "Sagittal",
                              "RIP",
                              "LIP",
                              "RSP",
                              "LSP",
                              "RIA",
                              "LIA",
                              "RSA",
                              "LSA",
                              "IRP",
                              "ILP",
                              "SRP",
                              "SLP",
                              "IRA",
                              "ILA",
                              "SRA",
                              "SLA",
                              "RPI",
                              "LPI",
                              "RAI",
                              "LAI",
                              "RPS",
                              "LPS",
                              "RAS",
                              "LAS",
                              "PRI",
                              "PLI",
                              "ARI",
                              "ALI",
                              "PRS",
                              "PLS",
                              "ARS",
                              "ALS",
                              "IPR",
                              "SPR",
                              "IAR",
                              "SAR",
                              "IPL",
                              "SPL",
                              "IAL",
                              "SAL",
                              "PIR",
                              "PSR",
                              "AIR",
                              "ASR",
                              "PIL",
                              "PSL",
                              "AIL",
                              "ASL",
                              argstr="--orientation %s",
                              desc="Orientation choices")
Beispiel #5
0
class BIDSSelectOutputSpec(TraitedSpec):
    bold_files = OutputMultiPath(File)
    mask_files = OutputMultiPath(traits.Either(File, None))
    entities = OutputMultiPath(traits.Dict)
Beispiel #6
0
class UploadIQMsOutputSpec(TraitedSpec):
    api_id = traits.Either(None,
                           traits.Str,
                           desc="Id for report returned by the web api")
Beispiel #7
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)')
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")
Beispiel #9
0
class ClusterInputSpec(FSLCommandInputSpec):
    in_file = File(argstr="--in=%s",
                   mandatory=True,
                   exists=True,
                   desc="input volume")
    threshold = traits.Float(argstr="--thresh=%.10f",
                             mandatory=True,
                             desc="threshold for input volume")
    out_index_file = traits.Either(
        traits.Bool,
        File,
        argstr="--oindex=%s",
        desc="output of cluster index (in size order)",
        hash_files=False,
    )
    out_threshold_file = traits.Either(
        traits.Bool,
        File,
        argstr="--othresh=%s",
        desc="thresholded image",
        hash_files=False,
    )
    out_localmax_txt_file = traits.Either(
        traits.Bool,
        File,
        argstr="--olmax=%s",
        desc="local maxima text file",
        hash_files=False,
    )
    out_localmax_vol_file = traits.Either(
        traits.Bool,
        File,
        argstr="--olmaxim=%s",
        desc="output of local maxima volume",
        hash_files=False,
    )
    out_size_file = traits.Either(
        traits.Bool,
        File,
        argstr="--osize=%s",
        desc="filename for output of size image",
        hash_files=False,
    )
    out_max_file = traits.Either(
        traits.Bool,
        File,
        argstr="--omax=%s",
        desc="filename for output of max image",
        hash_files=False,
    )
    out_mean_file = traits.Either(
        traits.Bool,
        File,
        argstr="--omean=%s",
        desc="filename for output of mean image",
        hash_files=False,
    )
    out_pval_file = traits.Either(
        traits.Bool,
        File,
        argstr="--opvals=%s",
        desc="filename for image output of log pvals",
        hash_files=False,
    )
    pthreshold = traits.Float(
        argstr="--pthresh=%.10f",
        requires=["dlh", "volume"],
        desc="p-threshold for clusters",
    )
    peak_distance = traits.Float(
        argstr="--peakdist=%.10f",
        desc="minimum distance between local maxima/minima, in mm (default 0)",
    )
    cope_file = File(argstr="--cope=%s", desc="cope volume")
    volume = traits.Int(argstr="--volume=%d",
                        desc="number of voxels in the mask")
    dlh = traits.Float(argstr="--dlh=%.10f",
                       desc="smoothness estimate = sqrt(det(Lambda))")
    fractional = traits.Bool(
        False,
        usedefault=True,
        argstr="--fractional",
        desc="interprets the threshold as a fraction of the robust range",
    )
    connectivity = traits.Int(argstr="--connectivity=%d",
                              desc="the connectivity of voxels (default 26)")
    use_mm = traits.Bool(False,
                         usedefault=True,
                         argstr="--mm",
                         desc="use mm, not voxel, coordinates")
    find_min = traits.Bool(False,
                           usedefault=True,
                           argstr="--min",
                           desc="find minima instead of maxima")
    no_table = traits.Bool(
        False,
        usedefault=True,
        argstr="--no_table",
        desc="suppresses printing of the table info",
    )
    minclustersize = traits.Bool(
        False,
        usedefault=True,
        argstr="--minclustersize",
        desc="prints out minimum significant cluster size",
    )
    xfm_file = File(
        argstr="--xfm=%s",
        desc=("filename for Linear: input->standard-space "
              "transform. Non-linear: input->highres transform"),
    )
    std_space_file = File(argstr="--stdvol=%s",
                          desc="filename for standard-space volume")
    num_maxima = traits.Int(argstr="--num=%d",
                            desc="no of local maxima to report")
    warpfield_file = File(argstr="--warpvol=%s",
                          desc="file contining warpfield")
    voxthresh = traits.Bool(
        False,
        usedefault=True,
        argstr="--voxthresh",
        desc="voxel-wise thresholding (corrected)",
    )
    resels = traits.Float(
        argstr="--resels=%.10f",
        desc="Size of one resel in voxel units",
    )
Beispiel #10
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.",
    )
Beispiel #11
0
 class input_spec(TraitedSpec):
     info_dict = traits.Dict()
     parameterization = traits.Either(traits.Str, traits.Tuple)
Beispiel #12
0
class ExecutionModelTourInputSpec(CommandLineInputSpec):
    integer = traits.Int(argstr="--integer %d",
                         desc="An integer without constraints")
    double = traits.Float(argstr="--double %f",
                          desc="A double with constraints")
    floatVector = InputMultiPath(traits.Float,
                                 argstr="--floatVector %s",
                                 desc="A vector of floats",
                                 sep=",")
    string_vector = InputMultiPath(traits.Str,
                                   argstr="--string_vector %s",
                                   desc="A vector of strings",
                                   sep=",")
    enumeration = traits.Enum("Ron",
                              "Eric",
                              "Bill",
                              "Ross",
                              "Steve",
                              "Will",
                              "árvíztűrő tükörfúrógép",
                              argstr="--enumeration %s",
                              desc="An enumeration of strings")
    boolean1 = traits.Bool(argstr="--boolean1 ", desc="A boolean default true")
    boolean2 = traits.Bool(argstr="--boolean2 ",
                           desc="A boolean default false")
    boolean3 = traits.Bool(
        argstr="--boolean3 ",
        desc="A boolean with no default, should be defaulting to false")
    file1 = File(argstr="--file1 %s", desc="An input file", exists=True)
    files = InputMultiPath(File(exists=True),
                           argstr="--files %s...",
                           desc="Multiple input files")
    outputFile1 = traits.Either(traits.Bool,
                                File(),
                                argstr="--outputFile1 %s",
                                desc="An output file",
                                hash_files=False)
    directory1 = Directory(
        argstr="--directory1 %s",
        desc=
        "An input directory. If no default is specified, the current directory is used,",
        exists=True)
    image1 = File(argstr="--image1 %s", desc="An input image", exists=True)
    image2 = traits.Either(traits.Bool,
                           File(),
                           argstr="--image2 %s",
                           desc="An output image",
                           hash_files=False)
    transformInput = File(argstr="--transformInput %s",
                          desc="A generic input transform",
                          exists=True)
    transform1 = File(argstr="--transform1 %s",
                      desc="A linear input transform",
                      exists=True)
    transformInputNonlinear = File(argstr="--transformInputNonlinear %s",
                                   desc="A nonlinear input transform",
                                   exists=True)
    transformInputBspline = File(argstr="--transformInputBspline %s",
                                 desc="A bspline input transform",
                                 exists=True)
    transformOutput = traits.Either(traits.Bool,
                                    File(),
                                    argstr="--transformOutput %s",
                                    desc="A generic output transform",
                                    hash_files=False)
    transform2 = traits.Either(traits.Bool,
                               File(),
                               argstr="--transform2 %s",
                               desc="A linear output transform",
                               hash_files=False)
    transformOutputNonlinear = traits.Either(
        traits.Bool,
        File(),
        argstr="--transformOutputNonlinear %s",
        desc="A nonlinear output transform",
        hash_files=False)
    transformOutputBspline = traits.Either(
        traits.Bool,
        File(),
        argstr="--transformOutputBspline %s",
        desc="A bspline output transform",
        hash_files=False)
    seed = InputMultiPath(
        traits.List(traits.Float(), minlen=3, maxlen=3),
        argstr="--seed %s...",
        desc="Lists of points in the CLI correspond to slicer fiducial lists")
    seedsFile = File(argstr="--seedsFile %s",
                     desc="Test file of input fiducials, compared to seeds")
    seedsOutFile = File(
        argstr="--seedsOutFile %s",
        desc=
        "Output file to read back in, compare to seeds with flipped settings on first fiducial"
    )
    inputModel = File(argstr="--inputModel %s",
                      desc="Input model",
                      exists=True)
    outputModel = traits.Either(traits.Bool,
                                File(),
                                argstr="--outputModel %s",
                                desc="Output model",
                                hash_files=False)
    modelSceneFile = traits.Either(
        traits.Bool,
        InputMultiPath(File(), ),
        argstr="--modelSceneFile %s...",
        desc=
        "Generated models, under a model hierarchy node. Models are imported into Slicer under a model hierarchy node. The model hierarchy node must be created before running the model maker, by selecting Create New ModelHierarchy from the Models drop down menu.",
        hash_files=False)
    arg0 = File(argstr="%s",
                desc="First index argument is an image",
                position=-2,
                exists=True)
    arg1 = traits.Either(traits.Bool,
                         File(),
                         argstr="%s",
                         desc="Second index argument is an image",
                         position=-1,
                         hash_files=False)
    region = InputMultiPath(traits.List(traits.Float(), minlen=3, maxlen=3),
                            argstr="--region %s...",
                            desc="List of regions to process")
    inputFA = traits.List(argstr="--inputFA %s",
                          desc="Array of FA values to process")
    outputFA = traits.List(argstr="--outputFA %s",
                           desc="Array of processed (output) FA values")
    inputDT = File(argstr="--inputDT %s",
                   desc="Array of Table values to process",
                   exists=True)
    outputDT = traits.Either(traits.Bool,
                             File(),
                             argstr="--outputDT %s",
                             desc="Array of processed (output) Table values",
                             hash_files=False)
    anintegerreturn = traits.Int(argstr="--anintegerreturn %d",
                                 desc="An example of an integer return type")
    abooleanreturn = traits.Bool(argstr="--abooleanreturn ",
                                 desc="An example of a boolean return type")
    afloatreturn = traits.Float(argstr="--afloatreturn %f",
                                desc="An example of a float return type")
    adoublereturn = traits.Float(argstr="--adoublereturn %f",
                                 desc="An example of a double return type")
    astringreturn = traits.Str(argstr="--astringreturn %s",
                               desc="An example of a string return type")
    anintegervectorreturn = InputMultiPath(
        traits.Int,
        argstr="--anintegervectorreturn %s",
        desc="An example of an integer vector return type",
        sep=",")
    astringchoicereturn = traits.Enum(
        "Ron",
        "Eric",
        "Bill",
        "Ross",
        "Steve",
        "Will",
        "árvíztűrő tükörfúrógép",
        argstr="--astringchoicereturn %s",
        desc="An enumeration of strings as a return type")
Beispiel #13
0
class DiffusionTensorMathematicsInputSpec(CommandLineInputSpec):
    inputVolume = File(position=-3, desc="Input DTI volume", exists=True, argstr="%s")
    outputScalar = traits.Either(traits.Bool, File(), position=-1, hash_files=False, desc="Scalar volume derived from tensor", argstr="%s")
    enumeration = traits.Enum("Trace", "Determinant", "RelativeAnisotropy", "FractionalAnisotropy", "Mode", "LinearMeasure", "PlanarMeasure", "SphericalMeasure", "MinEigenvalue", "MidEigenvalue", "MaxEigenvalue", "MaxEigenvalueProjectionX", "MaxEigenvalueProjectionY", "MaxEigenvalueProjectionZ", "RAIMaxEigenvecX", "RAIMaxEigenvecY", "RAIMaxEigenvecZ", "D11", "D22", "D33", "ParallelDiffusivity", "PerpendicularDffusivity", desc="An enumeration of strings", argstr="--enumeration %s")
Beispiel #14
0
class DiffusionWeightedMaskingInputSpec(CommandLineInputSpec):
    inputVolume = File(position=-4, desc="Input DWI volume", exists=True, argstr="%s")
    outputBaseline = traits.Either(traits.Bool, File(), position=-2, hash_files=False, desc="Estimated baseline volume", argstr="%s")
    thresholdMask = traits.Either(traits.Bool, File(), position=-1, hash_files=False, desc="Otsu Threshold Mask", argstr="%s")
    otsuomegathreshold = traits.Float(desc="Control the sharpness of the threshold in the Otsu computation. 0: lower threshold, 1: higher threhold", argstr="--otsuomegathreshold %f")
    removeislands = traits.Bool(desc="Remove Islands in Threshold Mask?", argstr="--removeislands ")
Beispiel #15
0
class ModelSpecLoaderInputSpec(BaseInterfaceInputSpec):
    database_path = Directory(exists=False, desc='Path to bids database')
    model = traits.Either('default',
                          InputMultiPath(File(exists=True)),
                          desc='Model filename')
    selectors = traits.Dict(desc='Limit models to those with matching inputs')
Beispiel #16
0
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",
    )
Beispiel #17
0
class AppendPathOutputSpec(TraitedSpec):
    out_path = traits.Either(
        File, Directory, desc="The first echo of the combined images")
Beispiel #18
0
class BRAINSFitInputSpec(CommandLineInputSpec):
    fixedVolume = File(exists=True, argstr="--fixedVolume %s")
    movingVolume = File(exists=True, argstr="--movingVolume %s")
    bsplineTransform = traits.Either(traits.Bool,
                                     File(),
                                     hash_files=False,
                                     argstr="--bsplineTransform %s")
    linearTransform = traits.Either(traits.Bool,
                                    File(),
                                    hash_files=False,
                                    argstr="--linearTransform %s")
    outputVolume = traits.Either(traits.Bool,
                                 File(),
                                 hash_files=False,
                                 argstr="--outputVolume %s")
    initialTransform = File(exists=True, argstr="--initialTransform %s")
    initializeTransformMode = traits.Enum(
        "Off",
        "useMomentsAlign",
        "useCenterOfHeadAlign",
        "useGeometryAlign",
        "useCenterOfROIAlign",
        argstr="--initializeTransformMode %s")
    useRigid = traits.Bool(argstr="--useRigid ")
    useScaleVersor3D = traits.Bool(argstr="--useScaleVersor3D ")
    useScaleSkewVersor3D = traits.Bool(argstr="--useScaleSkewVersor3D ")
    useAffine = traits.Bool(argstr="--useAffine ")
    useBSpline = traits.Bool(argstr="--useBSpline ")
    useComposite = traits.Bool(argstr="--useComposite ")
    numberOfSamples = traits.Int(argstr="--numberOfSamples %d")
    splineGridSize = InputMultiPath(traits.Int,
                                    sep=",",
                                    argstr="--splineGridSize %s")
    numberOfIterations = InputMultiPath(traits.Int,
                                        sep=",",
                                        argstr="--numberOfIterations %s")
    maskProcessingMode = traits.Enum("NOMASK",
                                     "ROIAUTO",
                                     "ROI",
                                     argstr="--maskProcessingMode %s")
    fixedBinaryVolume = File(exists=True, argstr="--fixedBinaryVolume %s")
    movingBinaryVolume = File(exists=True, argstr="--movingBinaryVolume %s")
    outputFixedVolumeROI = traits.Either(traits.Bool,
                                         File(),
                                         hash_files=False,
                                         argstr="--outputFixedVolumeROI %s")
    outputMovingVolumeROI = traits.Either(traits.Bool,
                                          File(),
                                          hash_files=False,
                                          argstr="--outputMovingVolumeROI %s")
    outputVolumePixelType = traits.Enum("float",
                                        "short",
                                        "ushort",
                                        "int",
                                        "uint",
                                        "uchar",
                                        argstr="--outputVolumePixelType %s")
    backgroundFillValue = traits.Float(argstr="--backgroundFillValue %f")
    maskInferiorCutOffFromCenter = traits.Float(
        argstr="--maskInferiorCutOffFromCenter %f")
    scaleOutputValues = traits.Bool(argstr="--scaleOutputValues ")
    interpolationMode = traits.Enum("NearestNeighbor",
                                    "Linear",
                                    "ResampleInPlace",
                                    "BSpline",
                                    "WindowedSinc",
                                    "Hamming",
                                    "Cosine",
                                    "Welch",
                                    "Lanczos",
                                    "Blackman",
                                    argstr="--interpolationMode %s")
    minimumStepLength = InputMultiPath(traits.Float,
                                       sep=",",
                                       argstr="--minimumStepLength %s")
    translationScale = traits.Float(argstr="--translationScale %f")
    reproportionScale = traits.Float(argstr="--reproportionScale %f")
    skewScale = traits.Float(argstr="--skewScale %f")
    maxBSplineDisplacement = traits.Float(argstr="--maxBSplineDisplacement %f")
    histogramMatch = traits.Bool(argstr="--histogramMatch ")
    numberOfHistogramBins = traits.Int(argstr="--numberOfHistogramBins %d")
    numberOfMatchPoints = traits.Int(argstr="--numberOfMatchPoints %d")
    strippedOutputTransform = traits.Either(
        traits.Bool,
        File(),
        hash_files=False,
        argstr="--strippedOutputTransform %s")
    transformType = InputMultiPath(traits.Str,
                                   sep=",",
                                   argstr="--transformType %s")
    outputTransform = traits.Either(traits.Bool,
                                    File(),
                                    hash_files=False,
                                    argstr="--outputTransform %s")
    fixedVolumeTimeIndex = traits.Int(argstr="--fixedVolumeTimeIndex %d")
    movingVolumeTimeIndex = traits.Int(argstr="--movingVolumeTimeIndex %d")
    medianFilterSize = InputMultiPath(traits.Int,
                                      sep=",",
                                      argstr="--medianFilterSize %s")
    removeIntensityOutliers = traits.Float(
        argstr="--removeIntensityOutliers %f")
    useCachingOfBSplineWeightsMode = traits.Enum(
        "ON", "OFF", argstr="--useCachingOfBSplineWeightsMode %s")
    useExplicitPDFDerivativesMode = traits.Enum(
        "AUTO", "ON", "OFF", argstr="--useExplicitPDFDerivativesMode %s")
    ROIAutoDilateSize = traits.Float(argstr="--ROIAutoDilateSize %f")
    ROIAutoClosingSize = traits.Float(argstr="--ROIAutoClosingSize %f")
    relaxationFactor = traits.Float(argstr="--relaxationFactor %f")
    maximumStepLength = traits.Float(argstr="--maximumStepLength %f")
    failureExitCode = traits.Int(argstr="--failureExitCode %d")
    writeTransformOnFailure = traits.Bool(argstr="--writeTransformOnFailure ")
    numberOfThreads = traits.Int(argstr="--numberOfThreads %d")
    forceMINumberOfThreads = traits.Int(argstr="--forceMINumberOfThreads %d")
    debugLevel = traits.Int(argstr="--debugLevel %d")
    costFunctionConvergenceFactor = traits.Float(
        argstr="--costFunctionConvergenceFactor %f")
    projectedGradientTolerance = traits.Float(
        argstr="--projectedGradientTolerance %f")
    UseDebugImageViewer = traits.Bool(argstr="--gui ")
    PromptAfterImageSend = traits.Bool(argstr="--promptUser ")
    useMomentsAlign = traits.Bool(
        argstr="--NEVER_USE_THIS_FLAG_IT_IS_OUTDATED_00 ")
    useGeometryAlign = traits.Bool(
        argstr="--NEVER_USE_THIS_FLAG_IT_IS_OUTDATED_01 ")
    useCenterOfHeadAlign = traits.Bool(
        argstr="--NEVER_USE_THIS_FLAG_IT_IS_OUTDATED_02 ")
    permitParameterVariation = InputMultiPath(
        traits.Int, sep=",", argstr="--permitParameterVariation %s")
    costMetric = traits.Enum("MMI",
                             "MSE",
                             "NC",
                             "MC",
                             argstr="--costMetric %s")
Beispiel #19
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)')
class TractographyInputSpec(MRTrix3BaseInputSpec):
    sph_trait = traits.Tuple(traits.Float,
                             traits.Float,
                             traits.Float,
                             traits.Float,
                             argstr='%f,%f,%f,%f')

    in_file = File(exists=True,
                   argstr='%s',
                   mandatory=True,
                   position=-2,
                   desc='input file to be processed')

    out_file = File('tracked.tck',
                    argstr='%s',
                    mandatory=True,
                    position=-1,
                    usedefault=True,
                    desc='output file containing tracks')

    algorithm = traits.Enum('iFOD2',
                            'FACT',
                            'iFOD1',
                            'Nulldist',
                            'SD_Stream',
                            'Tensor_Det',
                            'Tensor_Prob',
                            usedefault=True,
                            argstr='-algorithm %s',
                            desc='tractography algorithm to be used')

    # ROIs processing options
    roi_incl = traits.Either(
        File(exists=True),
        sph_trait,
        argstr='-include %s',
        desc=('specify an inclusion region of interest, streamlines must'
              ' traverse ALL inclusion regions to be accepted'))
    roi_excl = traits.Either(
        File(exists=True),
        sph_trait,
        argstr='-exclude %s',
        desc=('specify an exclusion region of interest, streamlines that'
              ' enter ANY exclude region will be discarded'))
    roi_mask = traits.Either(
        File(exists=True),
        sph_trait,
        argstr='-mask %s',
        desc=('specify a masking region of interest. If defined,'
              'streamlines exiting the mask will be truncated'))

    # Streamlines tractography options
    step_size = traits.Float(
        argstr='-step %f',
        desc=('set the step size of the algorithm in mm (default is 0.1'
              ' x voxelsize; for iFOD2: 0.5 x voxelsize)'))
    angle = traits.Float(
        argstr='-angle %f',
        desc=('set the maximum angle between successive steps (default '
              'is 90deg x stepsize / voxelsize)'))
    n_tracks = traits.Int(
        argstr='-select %d',
        max_ver=0.4,
        desc=('set the desired number of tracks. The program will continue'
              ' to generate tracks until this number of tracks have been '
              'selected and written to the output file'))
    select = traits.Int(
        argstr='-select %d',
        min_ver=3,
        desc=('set the desired number of tracks. The program will continue'
              ' to generate tracks until this number of tracks have been '
              'selected and written to the output file'))
    max_tracks = traits.Int(
        argstr='-maxnum %d',
        desc=('set the maximum number of tracks to generate. The program '
              'will not generate more tracks than this number, even if '
              'the desired number of tracks hasn\'t yet been reached '
              '(default is 100 x number)'))
    max_length = traits.Float(
        argstr='-maxlength %f',
        desc=('set the maximum length of any track in mm (default is '
              '100 x voxelsize)'))
    min_length = traits.Float(
        argstr='-minlength %f',
        desc=('set the minimum length of any track in mm (default is '
              '5 x voxelsize)'))
    cutoff = traits.Float(
        argstr='-cutoff %f',
        desc=('set the FA or FOD amplitude cutoff for terminating '
              'tracks (default is 0.1)'))
    cutoff_init = traits.Float(
        argstr='-initcutoff %f',
        desc=('set the minimum FA or FOD amplitude for initiating '
              'tracks (default is the same as the normal cutoff)'))
    n_trials = traits.Int(
        argstr='-trials %d',
        desc=('set the maximum number of sampling trials at each point'
              ' (only used for probabilistic tracking)'))
    unidirectional = traits.Bool(
        argstr='-unidirectional',
        desc=('track from the seed point in one direction only '
              '(default is to track in both directions)'))
    init_dir = traits.Tuple(
        traits.Float,
        traits.Float,
        traits.Float,
        argstr='-initdirection %f,%f,%f',
        desc=('specify an initial direction for the tracking (this '
              'should be supplied as a vector of 3 comma-separated values'))
    noprecompt = traits.Bool(
        argstr='-noprecomputed',
        desc=('do NOT pre-compute legendre polynomial values. Warning: this '
              'will slow down the algorithm by a factor of approximately 4'))
    power = traits.Int(
        argstr='-power %d',
        desc=('raise the FOD to the power specified (default is 1/nsamples)'))
    n_samples = traits.Int(
        4,
        usedefault=True,
        argstr='-samples %d',
        desc=('set the number of FOD samples to take per step for the 2nd '
              'order (iFOD2) method'))
    use_rk4 = traits.Bool(
        argstr='-rk4',
        desc=('use 4th-order Runge-Kutta integration (slower, but eliminates'
              ' curvature overshoot in 1st-order deterministic methods)'))
    stop = traits.Bool(
        argstr='-stop',
        desc=('stop propagating a streamline once it has traversed all '
              'include regions'))
    downsample = traits.Float(
        argstr='-downsample %f',
        desc='downsample the generated streamlines to reduce output file size')

    # Anatomically-Constrained Tractography options
    act_file = File(
        exists=True,
        argstr='-act %s',
        desc=('use the Anatomically-Constrained Tractography framework during'
              ' tracking; provided image must be in the 5TT '
              '(five - tissue - type) format'))
    backtrack = traits.Bool(argstr='-backtrack',
                            desc='allow tracks to be truncated')

    crop_at_gmwmi = traits.Bool(
        argstr='-crop_at_gmwmi',
        desc=('crop streamline endpoints more '
              'precisely as they cross the GM-WM interface'))

    # Tractography seeding options
    seed_sphere = traits.Tuple(traits.Float,
                               traits.Float,
                               traits.Float,
                               traits.Float,
                               argstr='-seed_sphere %f,%f,%f,%f',
                               desc='spherical seed')
    seed_image = File(exists=True,
                      argstr='-seed_image %s',
                      desc='seed streamlines entirely at random within mask')
    seed_rnd_voxel = traits.Tuple(
        File(exists=True),
        traits.Int(),
        argstr='-seed_random_per_voxel %s %d',
        xor=['seed_image', 'seed_grid_voxel'],
        desc=('seed a fixed number of streamlines per voxel in a mask '
              'image; random placement of seeds in each voxel'))
    seed_grid_voxel = traits.Tuple(
        File(exists=True),
        traits.Int(),
        argstr='-seed_grid_per_voxel %s %d',
        xor=['seed_image', 'seed_rnd_voxel'],
        desc=('seed a fixed number of streamlines per voxel in a mask '
              'image; place seeds on a 3D mesh grid (grid_size argument '
              'is per axis; so a grid_size of 3 results in 27 seeds per'
              ' voxel)'))
    seed_rejection = File(
        exists=True,
        argstr='-seed_rejection %s',
        desc=('seed from an image using rejection sampling (higher '
              'values = more probable to seed from'))
    seed_gmwmi = File(
        exists=True,
        argstr='-seed_gmwmi %s',
        requires=['act_file'],
        desc=('seed from the grey matter - white matter interface (only '
              'valid if using ACT framework)'))
    seed_dynamic = File(
        exists=True,
        argstr='-seed_dynamic %s',
        desc=('determine seed points dynamically using the SIFT model '
              '(must not provide any other seeding mechanism). Note that'
              ' while this seeding mechanism improves the distribution of'
              ' reconstructed streamlines density, it should NOT be used '
              'as a substitute for the SIFT method itself.'))
    max_seed_attempts = traits.Int(
        argstr='-max_seed_attempts %d',
        desc=('set the maximum number of times that the tracking '
              'algorithm should attempt to find an appropriate tracking'
              ' direction from a given seed point'))
    out_seeds = File(
        'out_seeds.nii.gz',
        usedefault=True,
        argstr='-output_seeds %s',
        desc=('output the seed location of all successful streamlines to'
              ' a file'))
Beispiel #21
0
class CreateDICOMSeriesInputSpec(CommandLineInputSpec):
    patientName = traits.Str(argstr="--patientName %s",
                             desc="The name of the patient (0010,0010)")
    patientID = traits.Str(argstr="--patientID %s",
                           desc="The patient ID (0010,0020)")
    patientBirthDate = traits.Str(argstr="--patientBirthDate %s",
                                  desc="Patient birth date (0010,0030)")
    patientSex = traits.Str(argstr="--patientSex %s",
                            desc="Patient sex (0010,0040)")
    patientComments = traits.Str(argstr="--patientComments %s",
                                 desc="Patient comments (0010,4000)")
    studyID = traits.Str(argstr="--studyID %s",
                         desc="The study ID (0020,0010)")
    studyDate = traits.Str(argstr="--studyDate %s",
                           desc="The date of the study (0008,0020)")
    studyTime = traits.Str(argstr="--studyTime %s",
                           desc="The time of the study (0008,0030)")
    studyComments = traits.Str(argstr="--studyComments %s",
                               desc="Study comments (0032,4000)")
    studyDescription = traits.Str(argstr="--studyDescription %s",
                                  desc="Study description (0008,1030)")
    modality = traits.Str(argstr="--modality %s", desc="Modality (0008,0060)")
    manufacturer = traits.Str(argstr="--manufacturer %s",
                              desc="Manufacturer (0008,0070)")
    model = traits.Str(argstr="--model %s", desc="model (0008,1090)")
    seriesNumber = traits.Str(argstr="--seriesNumber %s",
                              desc="The series number (0020,0011)")
    seriesDescription = traits.Str(argstr="--seriesDescription %s",
                                   desc="Series description (0008,103E)")
    seriesDate = traits.Str(argstr="--seriesDate %s",
                            desc="The date of the series (0008,0021)")
    seriesTime = traits.Str(argstr="--seriesTime %s",
                            desc="The time of the series (0008,0031)")
    rescaleIntercept = traits.Float(
        argstr="--rescaleIntercept %f",
        desc=
        "Rescale interscept (0028,1052). Converts pixel values on disk to pixel values in memory. (Pixel value in memory) = (Pixel value on disk) * rescaleSlope + rescaleIntercept.  Default is 0.0. Data values are converted on write (the data is scaled and shifted so that the slope and interscept will bring it back to the current intensity range)."
    )
    rescaleSlope = traits.Float(
        argstr="--rescaleSlope %f",
        desc=
        "Rescale slope (0028,1053). Converts pixel values on disk to pixel values in memory. (Pixel value in memory) = (Pixel value on disk) * rescaleSlope + rescaleInterscept.  Default is 1.0. Data values are converted on write (the data is scaled and shifted so that the slope and interscept will bring it back to the current intensity range)."
    )
    contentDate = traits.Str(argstr="--contentDate %s",
                             desc="The date of the image content (0008,0023)")
    contentTime = traits.Str(argstr="--contentTime %s",
                             desc="The time of the image content (0008,0033)")
    studyInstanceUID = traits.Str(argstr="--studyInstanceUID %s",
                                  desc="The study instance UID (0020,000d)")
    seriesInstanceUID = traits.Str(argstr="--seriesInstanceUID %s",
                                   desc="The series instance UID (0020,000e)")
    frameOfReferenceInstanceUID = traits.Str(
        argstr="--frameOfReferenceInstanceUID %s",
        desc="The frame of reference instance UID (0020,0052)")
    inputVolume = File(argstr="%s",
                       desc="Input volume to be resampled",
                       position=-1,
                       exists=True)
    dicomDirectory = traits.Either(
        traits.Bool,
        Directory(),
        argstr="--dicomDirectory %s",
        desc="The directory to contain the DICOM series.",
        hash_files=False)
    dicomPrefix = traits.Str(argstr="--dicomPrefix %s",
                             desc="The prefix of the DICOM filename.")
    dicomNumberFormat = traits.Str(
        argstr="--dicomNumberFormat %s",
        desc=
        "The printf-style format to be used when creating the per-slice DICOM filename."
    )
    reverseImages = traits.Bool(argstr="--reverseImages ",
                                desc="Reverse the slices.")
    useCompression = traits.Bool(argstr="--useCompression ",
                                 desc="Compress the output pixel data.")
    type = traits.Enum("UnsignedChar",
                       "Char",
                       "UnsignedChar",
                       "Short",
                       "UnsignedShort",
                       "Int",
                       "UnsignedInt",
                       argstr="--type %s",
                       desc="Type for the new output volume.")
Beispiel #22
0
class dtiprocessInputSpec(CommandLineInputSpec):
    verbose = traits.Bool(desc="produce verbose output", argstr="--verbose ")
    mask = File(
        desc=
        "Mask tensors. Specify --outmask if you want to save the masked tensor field, otherwise the mask is applied just for the current processing ",
        exists=True,
        argstr="--mask %s")
    outmask = File(desc="Name of the masked tensor field.",
                   exists=True,
                   argstr="--outmask %s")
    fa_output = traits.Either(traits.Bool,
                              File(),
                              hash_files=False,
                              desc="FA output file",
                              argstr="--fa_output %s")
    md_output = traits.Either(traits.Bool,
                              File(),
                              hash_files=False,
                              desc="MD output file",
                              argstr="--md_output %s")
    fa_gradient_output = traits.Either(traits.Bool,
                                       File(),
                                       hash_files=False,
                                       desc="FA Gradient output file",
                                       argstr="--fa_gradient_output %s")
    sigma = traits.Float(desc="Scale of gradients", argstr="--sigma %f")
    fa_gradmag_output = traits.Either(traits.Bool,
                                      File(),
                                      hash_files=False,
                                      desc="FA Gradient Magnitude output file",
                                      argstr="--fa_gradmag_output %s")
    color_fa_output = traits.Either(traits.Bool,
                                    File(),
                                    hash_files=False,
                                    desc="Color FA output file",
                                    argstr="--color_fa_output %s")
    principal_eigenvector_output = traits.Either(
        traits.Bool,
        File(),
        hash_files=False,
        desc="Principal Eigenvectors Output",
        argstr="--principal_eigenvector_output %s")
    negative_eigenvector_output = traits.Either(
        traits.Bool,
        File(),
        hash_files=False,
        desc=
        "Negative Eigenvectors Output: create a binary image where if any of the eigen value is below zero, the voxel is set to 1, otherwise 0.",
        argstr="--negative_eigenvector_output %s")
    frobenius_norm_output = traits.Either(traits.Bool,
                                          File(),
                                          hash_files=False,
                                          desc="Frobenius Norm Output",
                                          argstr="--frobenius_norm_output %s")
    lambda1_output = traits.Either(traits.Bool,
                                   File(),
                                   hash_files=False,
                                   desc="Lambda 1 (largest eigenvalue) output",
                                   argstr="--lambda1_output %s")
    lambda2_output = traits.Either(traits.Bool,
                                   File(),
                                   hash_files=False,
                                   desc="Lambda 2 (middle eigenvalue) output",
                                   argstr="--lambda2_output %s")
    lambda3_output = traits.Either(
        traits.Bool,
        File(),
        hash_files=False,
        desc="Lambda 3 (smallest eigenvalue) output",
        argstr="--lambda3_output %s")
    RD_output = traits.Either(
        traits.Bool,
        File(),
        hash_files=False,
        desc="RD (radial diffusivity 1/2*(lambda2+lambda3)) output",
        argstr="--RD_output %s")
    scalar_float = traits.Bool(
        desc=
        "Write scalar [FA,MD] as unscaled float (with their actual values, otherwise scaled by 10 000).  Also causes FA to be unscaled [0..1].",
        argstr="--scalar_float ")
    rot_output = traits.Either(
        traits.Bool,
        File(),
        hash_files=False,
        desc="Rotated tensor output file.  Must also specify the dof file.",
        argstr="--rot_output %s")
    dof_file = traits.Either(
        traits.Bool,
        File(),
        hash_files=False,
        desc=
        "Transformation file for affine transformation.  This can be ITK format (or the outdated RView).",
        argstr="--dof_file %s")
    deformation_output = traits.Either(
        traits.Bool,
        File(),
        hash_files=False,
        desc=
        "Warped tensor field based on a deformation field.  This option requires the --forward,-F transformation to be specified.",
        argstr="--deformation_output %s")
    forward = traits.Either(
        traits.Bool,
        File(),
        hash_files=False,
        desc=
        "Forward transformation.  Assumed to be a deformation field in world coordinates, unless the --h-field option is specified.",
        argstr="--forward %s")
    hField = traits.Bool(
        desc=
        "forward and inverse transformations are h-fields instead of displacement fields",
        argstr="--hField ")
    interpolation = traits.Enum(
        "nearestneighbor",
        "linear",
        "cubic",
        desc="Interpolation type (nearestneighbor, linear, cubic)",
        argstr="--interpolation %s")
    reorientation = traits.Enum("fs",
                                "ppd",
                                desc="Reorientation type (fs, ppd)",
                                argstr="--reorientation %s")
    dti_image = File(desc="DTI tensor volume",
                     exists=True,
                     argstr="--dti_image %s")
    newdof_file = File(
        desc=
        "Transformation file for affine transformation.  RView NEW format. (txt file output of dof2mat)",
        exists=True,
        argstr="--newdof_file %s")
    affineitk_file = File(
        desc="Transformation file for affine transformation.  ITK format.",
        exists=True,
        argstr="--affineitk_file %s")
Beispiel #23
0
class BRAINSFitInputSpec(CommandLineInputSpec):
    fixedVolume = File(
        desc=
        "The fixed image for registration by mutual information optimization.",
        exists=True,
        argstr="--fixedVolume %s")
    movingVolume = File(
        desc=
        "The moving image for registration by mutual information optimization.",
        exists=True,
        argstr="--movingVolume %s")
    bsplineTransform = traits.Either(
        traits.Bool,
        File(),
        hash_files=False,
        desc=
        "(optional) Filename to which save the estimated transform. NOTE: You must set at least one output object (either a deformed image or a transform.  NOTE: USE THIS ONLY IF THE FINAL TRANSFORM IS BSpline",
        argstr="--bsplineTransform %s")
    linearTransform = traits.Either(
        traits.Bool,
        File(),
        hash_files=False,
        desc=
        "(optional) Filename to which save the estimated transform. NOTE: You must set at least one output object (either a deformed image or a transform.  NOTE: USE THIS ONLY IF THE FINAL TRANSFORM IS ---NOT--- BSpline",
        argstr="--linearTransform %s")
    outputVolume = traits.Either(
        traits.Bool,
        File(),
        hash_files=False,
        desc=
        "(optional) Output image for registration. NOTE: You must select either the outputTransform or the outputVolume option.",
        argstr="--outputVolume %s")
    initialTransform = File(
        desc=
        "Filename of transform used to initialize the registration.  This CAN NOT be used with either CenterOfHeadLAlign, MomentsAlign, GeometryAlign, or initialTransform file.",
        exists=True,
        argstr="--initialTransform %s")
    initializeTransformMode = traits.Enum(
        "Off",
        "useMomentsAlign",
        "useCenterOfHeadAlign",
        "useGeometryAlign",
        "useCenterOfROIAlign",
        desc=
        "Determine how to initialize the transform center.  GeometryAlign on assumes that the center of the voxel lattice of the images represent similar structures.  MomentsAlign assumes that the center of mass of the images represent similar structures.  useCenterOfHeadAlign attempts to use the top of head and shape of neck to drive a center of mass estimate.  Off assumes that the physical space of the images are close, and that centering in terms of the image Origins is a good starting point.  This flag is mutually exclusive with the initialTransform flag.",
        argstr="--initializeTransformMode %s")
    useRigid = traits.Bool(
        desc=
        "Perform a rigid registration as part of the sequential registration steps.  This family of options superceeds the use of transformType if any of them are set.",
        argstr="--useRigid ")
    useScaleVersor3D = traits.Bool(
        desc=
        "Perform a ScaleVersor3D registration as part of the sequential registration steps.  This family of options superceeds the use of transformType if any of them are set.",
        argstr="--useScaleVersor3D ")
    useScaleSkewVersor3D = traits.Bool(
        desc=
        "Perform a ScaleSkewVersor3D registration as part of the sequential registration steps.  This family of options superceeds the use of transformType if any of them are set.",
        argstr="--useScaleSkewVersor3D ")
    useAffine = traits.Bool(
        desc=
        "Perform an Affine registration as part of the sequential registration steps.  This family of options superceeds the use of transformType if any of them are set.",
        argstr="--useAffine ")
    useBSpline = traits.Bool(
        desc=
        "Perform a BSpline registration as part of the sequential registration steps.  This family of options superceeds the use of transformType if any of them are set.",
        argstr="--useBSpline ")
    numberOfSamples = traits.Int(
        desc=
        "The number of voxels sampled for mutual information computation.  Increase this for a slower, more careful fit.  You can also limit the sampling focus with ROI masks and ROIAUTO mask generation.",
        argstr="--numberOfSamples %d")
    splineGridSize = InputMultiPath(
        traits.Int,
        desc=
        "The number of subdivisions of the BSpline Grid to be centered on the image space.  Each dimension must have at least 3 subdivisions for the BSpline to be correctly computed. ",
        sep=",",
        argstr="--splineGridSize %s")
    numberOfIterations = InputMultiPath(
        traits.Int,
        desc=
        "The maximum number of iterations to try before failing to converge.  Use an explicit limit like 500 or 1000 to manage risk of divergence",
        sep=",",
        argstr="--numberOfIterations %s")
    maskProcessingMode = traits.Enum(
        "NOMASK",
        "ROIAUTO",
        "ROI",
        desc=
        "What mode to use for using the masks.  If ROIAUTO is choosen, then the mask is implicitly defined using a otsu forground and hole filling algorithm. The Region Of Interest mode (choose ROI) uses the masks to define what parts of the image should be used for computing the transform.",
        argstr="--maskProcessingMode %s")
    fixedBinaryVolume = File(
        desc="Fixed Image binary mask volume, ONLY FOR MANUAL ROI mode.",
        exists=True,
        argstr="--fixedBinaryVolume %s")
    movingBinaryVolume = File(
        desc="Moving Image binary mask volume, ONLY FOR MANUAL ROI mode.",
        exists=True,
        argstr="--movingBinaryVolume %s")
    outputFixedVolumeROI = traits.Either(
        traits.Bool,
        File(),
        hash_files=False,
        desc=
        "The ROI automatically found in fixed image, ONLY FOR ROIAUTO mode.",
        argstr="--outputFixedVolumeROI %s")
    outputMovingVolumeROI = traits.Either(
        traits.Bool,
        File(),
        hash_files=False,
        desc=
        "The ROI automatically found in moving image, ONLY FOR ROIAUTO mode.",
        argstr="--outputMovingVolumeROI %s")
    outputVolumePixelType = traits.Enum(
        "float",
        "short",
        "ushort",
        "int",
        "uint",
        "uchar",
        desc=
        "The output image Pixel Type is the scalar datatype for representation of the Output Volume.",
        argstr="--outputVolumePixelType %s")
    backgroundFillValue = traits.Float(
        desc="Background fill value for output image.",
        argstr="--backgroundFillValue %f")
    maskInferiorCutOffFromCenter = traits.Float(
        desc=
        "For use with --useCenterOfHeadAlign (and --maskProcessingMode ROIAUTO): the cut-off below the image centers, in millimeters, ",
        argstr="--maskInferiorCutOffFromCenter %f")
    scaleOutputValues = traits.Bool(
        desc=
        "If true, and the voxel values do not fit within the minimum and maximum values of the desired outputVolumePixelType, then linearly scale the min/max output image voxel values to fit within the min/max range of the outputVolumePixelType.",
        argstr="--scaleOutputValues ")
    interpolationMode = traits.Enum(
        "NearestNeighbor",
        "Linear",
        "ResampleInPlace",
        "BSpline",
        "WindowedSinc",
        "Hamming",
        "Cosine",
        "Welch",
        "Lanczos",
        "Blackman",
        desc=
        "Type of interpolation to be used when applying transform to moving volume.  Options are Linear, NearestNeighbor, BSpline, WindowedSinc, or ResampleInPlace.  The ResampleInPlace option will create an image with the same discrete voxel values and will adjust the origin and direction of the physical space interpretation.",
        argstr="--interpolationMode %s")
    minimumStepLength = InputMultiPath(
        traits.Float,
        desc=
        "Each step in the optimization takes steps at least this big.  When none are possible, registration is complete.",
        sep=",",
        argstr="--minimumStepLength %s")
    translationScale = traits.Float(
        desc=
        "How much to scale up changes in position compared to unit rotational changes in radians -- decrease this to put more rotation in the search pattern.",
        argstr="--translationScale %f")
    reproportionScale = traits.Float(
        desc=
        "ScaleVersor3D 'Scale' compensation factor.  Increase this to put more rescaling in a ScaleVersor3D or ScaleSkewVersor3D search pattern.  1.0 works well with a translationScale of 1000.0",
        argstr="--reproportionScale %f")
    skewScale = traits.Float(
        desc=
        "ScaleSkewVersor3D Skew compensation factor.  Increase this to put more skew in a ScaleSkewVersor3D search pattern.  1.0 works well with a translationScale of 1000.0",
        argstr="--skewScale %f")
    maxBSplineDisplacement = traits.Float(
        desc=
        " Sets the maximum allowed displacements in image physical coordinates for BSpline control grid along each axis.  A value of 0.0 indicates that the problem should be unbounded.  NOTE:  This only constrains the BSpline portion, and does not limit the displacement from the associated bulk transform.  This can lead to a substantial reduction in computation time in the BSpline optimizer.,       ",
        argstr="--maxBSplineDisplacement %f")
    histogramMatch = traits.Bool(
        desc=
        "Histogram Match the input images.  This is suitable for images of the same modality that may have different absolute scales, but the same overall intensity profile. Do NOT use if registering images from different modailties.",
        argstr="--histogramMatch ")
    numberOfHistogramBins = traits.Int(desc="The number of histogram levels",
                                       argstr="--numberOfHistogramBins %d")
    numberOfMatchPoints = traits.Int(desc="the number of match points",
                                     argstr="--numberOfMatchPoints %d")
    strippedOutputTransform = traits.Either(
        traits.Bool,
        File(),
        hash_files=False,
        desc=
        "File name for the rigid component of the estimated affine transform. Can be used to rigidly register the moving image to the fixed image. NOTE:  This value is overwritten if either bsplineTransform or linearTransform is set.",
        argstr="--strippedOutputTransform %s")
    transformType = InputMultiPath(
        traits.Str,
        desc=
        "Specifies a list of registration types to be used.  The valid types are, Rigid, ScaleVersor3D, ScaleSkewVersor3D, Affine, and BSpline.  Specifiying more than one in a comma separated list will initialize the next stage with the previous results. If registrationClass flag is used, it overrides this parameter setting.",
        sep=",",
        argstr="--transformType %s")
    outputTransform = traits.Either(
        traits.Bool,
        File(),
        hash_files=False,
        desc=
        "(optional) Filename to which save the (optional) estimated transform. NOTE: You must select either the outputTransform or the outputVolume option.",
        argstr="--outputTransform %s")
    fixedVolumeTimeIndex = traits.Int(
        desc=
        "The index in the time series for the 3D fixed image to fit, if 4-dimensional.",
        argstr="--fixedVolumeTimeIndex %d")
    movingVolumeTimeIndex = traits.Int(
        desc=
        "The index in the time series for the 3D moving image to fit, if 4-dimensional.",
        argstr="--movingVolumeTimeIndex %d")
    medianFilterSize = InputMultiPath(
        traits.Int,
        desc=
        "The radius for the optional MedianImageFilter preprocessing in all 3 directions.",
        sep=",",
        argstr="--medianFilterSize %s")
    removeIntensityOutliers = traits.Float(
        desc=
        "The half percentage to decide outliers of image intensities. The default value is zero, which means no outlier removal. If the value of 0.005 is given, the moduel will throw away 0.005 % of both tails, so 0.01% of intensities in total would be ignored in its statistic calculation. ",
        argstr="--removeIntensityOutliers %f")
    useCachingOfBSplineWeightsMode = traits.Enum(
        "ON",
        "OFF",
        desc=
        "This is a 5x speed advantage at the expense of requiring much more memory.  Only relevant when transformType is BSpline.",
        argstr="--useCachingOfBSplineWeightsMode %s")
    useExplicitPDFDerivativesMode = traits.Enum(
        "AUTO",
        "ON",
        "OFF",
        desc=
        "Using mode AUTO means OFF for BSplineDeformableTransforms and ON for the linear transforms.  The ON alternative uses more memory to sometimes do a better job.",
        argstr="--useExplicitPDFDerivativesMode %s")
    ROIAutoDilateSize = traits.Float(
        desc=
        "This flag is only relavent when using ROIAUTO mode for initializing masks.  It defines the final dilation size to capture a bit of background outside the tissue region.  At setting of 10mm has been shown to help regularize a BSpline registration type so that there is some background constraints to match the edges of the head better.",
        argstr="--ROIAutoDilateSize %f")
    ROIAutoClosingSize = traits.Float(
        desc=
        "This flag is only relavent when using ROIAUTO mode for initializing masks.  It defines the hole closing size in mm.  It is rounded up to the nearest whole pixel size in each direction. The default is to use a closing size of 9mm.  For mouse data this value may need to be reset to 0.9 or smaller.",
        argstr="--ROIAutoClosingSize %f")
    relaxationFactor = traits.Float(
        desc=
        "Internal debugging parameter, and should probably never be used from the command line.  This will be removed in the future.",
        argstr="--relaxationFactor %f")
    maximumStepLength = traits.Float(
        desc=
        "Internal debugging parameter, and should probably never be used from the command line.  This will be removed in the future.",
        argstr="--maximumStepLength %f")
    failureExitCode = traits.Int(
        desc=
        "If the fit fails, exit with this status code.  (It can be used to force a successfult exit status of (0) if the registration fails due to reaching the maximum number of iterations.",
        argstr="--failureExitCode %d")
    writeTransformOnFailure = traits.Bool(
        desc=
        "Flag to save the final transform even if the numberOfIterations are reached without convergence. (Intended for use when --failureExitCode 0 )",
        argstr="--writeTransformOnFailure ")
    numberOfThreads = traits.Int(
        desc=
        "Explicitly specify the maximum number of threads to use. (default is auto-detected)",
        argstr="--numberOfThreads %d")
    forceMINumberOfThreads = traits.Int(
        desc=
        "Force the the maximum number of threads to use for non thread safe MI metric.  CAUTION: Inconsistent results my arise!",
        argstr="--forceMINumberOfThreads %d")
    debugLevel = traits.Int(
        desc=
        "Display debug messages, and produce debug intermediate results.  0=OFF, 1=Minimal, 10=Maximum debugging.",
        argstr="--debugLevel %d")
    costFunctionConvergenceFactor = traits.Float(
        desc=
        " From itkLBFGSBOptimizer.h: Set/Get the CostFunctionConvergenceFactor. Algorithm terminates when the reduction in cost function is less than (factor * epsmcj) where epsmch is the machine precision. Typical values for factor: 1e+12 for low accuracy; 1e+7 for moderate accuracy and 1e+1 for extremely high accuracy.  1e+9 seems to work well.,       ",
        argstr="--costFunctionConvergenceFactor %f")
    projectedGradientTolerance = traits.Float(
        desc=
        " From itkLBFGSBOptimizer.h: Set/Get the ProjectedGradientTolerance. Algorithm terminates when the project gradient is below the tolerance. Default lbfgsb value is 1e-5, but 1e-4 seems to work well.,       ",
        argstr="--projectedGradientTolerance %f")
    gui = traits.Bool(
        desc=
        "Display intermediate image volumes for debugging.  NOTE:  This is not part of the standard build sytem, and probably does nothing on your installation.",
        argstr="--gui ")
    promptUser = traits.Bool(
        desc=
        "Prompt the user to hit enter each time an image is sent to the DebugImageViewer",
        argstr="--promptUser ")
    NEVER_USE_THIS_FLAG_IT_IS_OUTDATED_00 = traits.Bool(
        desc="DO NOT USE THIS FLAG",
        argstr="--NEVER_USE_THIS_FLAG_IT_IS_OUTDATED_00 ")
    NEVER_USE_THIS_FLAG_IT_IS_OUTDATED_01 = traits.Bool(
        desc="DO NOT USE THIS FLAG",
        argstr="--NEVER_USE_THIS_FLAG_IT_IS_OUTDATED_01 ")
    NEVER_USE_THIS_FLAG_IT_IS_OUTDATED_02 = traits.Bool(
        desc="DO NOT USE THIS FLAG",
        argstr="--NEVER_USE_THIS_FLAG_IT_IS_OUTDATED_02 ")
    permitParameterVariation = InputMultiPath(
        traits.Int,
        desc=
        "A bit vector to permit linear transform parameters to vary under optimization.  The vector order corresponds with transform parameters, and beyond the end ones fill in as a default.  For instance, you can choose to rotate only in x (pitch) with 1,0,0;  this is mostly for expert use in turning on and off individual degrees of freedom in rotation, translation or scaling without multiplying the number of transform representations; this trick is probably meaningless when tried with the general affine transform.",
        sep=",",
        argstr="--permitParameterVariation %s")
    costMetric = traits.Enum(
        "MMI",
        "MSE",
        "NC",
        "MC",
        desc=
        "The cost metric to be used during fitting. Defaults to MMI. Options are MMI (Mattes Mutual Information), MSE (Mean Square Error), NC (Normalized Correlation), MC (Match Cardinality for binary images)",
        argstr="--costMetric %s")
    writeOutputTransformInFloat = traits.Bool(
        desc=
        "By default, the output registration transforms (either the output composite transform or each transform component) are written to the disk in double precision. If this flag is ON, the output transforms will be written in single (float) precision. It is especially important if the output transform is a displacement field transform, or it is a composite transform that includes several displacement fields.",
        argstr="--writeOutputTransformInFloat ")
Beispiel #24
0
class MultivariateTemplateConstruction2InputSpec(CommandLineInputSpec):
    dimension = traits.Enum(2,
                            3,
                            4,
                            default=3,
                            usedefault=True,
                            argstr='-d %d')
    input_file = File(desc="txt or csv file with images",
                      exists=True,
                      position=-1)
    input_images = InputMultiObject(traits.Either(
        File(exists=True), InputMultiObject(File(exists=True))),
                                    desc='list of images or lists of images',
                                    xor=('input_file', ),
                                    argstr='%s',
                                    position=-1,
                                    copyfile=False)
    image_statistic = traits.Enum(
        0,
        1,
        2,
        default=1,
        usedefault=True,
        desc='statistic used to summarize '
        'images. 0=mean, 1= mean of normalized intensities, 2=median')
    iteration_limit = traits.Int(4,
                                 usedefault=True,
                                 argstr='-i %d',
                                 desc='maximum number of iterations')
    backup_images = traits.Bool(False, argstr='-b %d')
    parallel_control = traits.Enum(0,
                                   1,
                                   2,
                                   3,
                                   4,
                                   5,
                                   desc='Control for parallel computation '
                                   '0 = run serially, '
                                   '1 = SGE qsub, '
                                   '2 = use PEXEC (localhost), '
                                   '3 = Apple XGrid, '
                                   '4 = PBS qsub, '
                                   '5 = SLURM',
                                   argstr='-c %d',
                                   usedefault=True,
                                   hash_files=False)
    num_cores = traits.Int(default=1,
                           usedefault=True,
                           argstr='-j %d',
                           hash_files=False)
    num_modalities = traits.Int(
        1,
        usedefault=True,
        desc='Number of modalities used '
        'to construct the template (default 1):  For example, '
        'if one wanted to create a multimodal template consisting of T1,T2,and FA '
        'components ("-k 3")',
        argstr='-k %d')
    modality_weights = traits.List([1], usedefault=True)
    n4_bias_correct = traits.Bool(True, usedefault=True, argstr='-n %d')
    metric = traits.Str('CC', usedefault=True, argstr='-m %s', mandatory=True)
    transform = traits.Enum('BSplineSyN',
                            'SyN',
                            'Affine',
                            usedefault=True,
                            argstr='-t %s',
                            mandatory=True)
    output_prefix = traits.Str('antsBTP')
    gradient_step = traits.Float(0.25,
                                 usedefault=True,
                                 mandatory=True,
                                 argstr='-g %.3f')
    use_full_affine = traits.Bool(False, usedefault=True, argstr='-y %d')
    usefloat = traits.Bool(True, argstr='-e %d', usedefault=True)
Beispiel #25
0
class BSplineToDeformationFieldInputSpec(CommandLineInputSpec):
    tfm = File(exists=True, argstr="--tfm %s")
    refImage = File(exists=True, argstr="--refImage %s")
    defImage = traits.Either(traits.Bool, File(), hash_files=False, argstr="--defImage %s")
Beispiel #26
0
class _BIDSBaseInputSpec(BaseInterfaceInputSpec):
    bids_dir = traits.Either(
        (None, Directory(exists=True)), usedefault=True,
        desc='optional bids directory to initialize a new layout')
    bids_validate = traits.Bool(True, usedefault=True, desc='enable BIDS validator')
Beispiel #27
0
class NwarpApplyPriorsOutputSpec(AFNICommandOutputSpec):
    out_file = traits.Either(File(), traits.List(File()))
class N4ITKBiasFieldCorrectionInputSpec(CommandLineInputSpec):
    inputImageName = File(
        argstr="%s",
        desc="Input image where you observe signal inhomegeneity",
        position=-2,
        exists=True)
    maskimage = File(
        argstr="--maskimage %s",
        desc=
        "Binary mask that defines the structure of your interest. NOTE: This parameter is OPTIONAL. If the mask is not specified, the module will use internally Otsu thresholding to define this mask. Better processing results can often be obtained when a meaningful mask is defined.",
        exists=True)
    outputImageName = traits.Either(traits.Bool,
                                    File(),
                                    argstr="%s",
                                    desc="Result of processing",
                                    position=-1,
                                    hash_files=False)
    outputbiasfield = traits.Either(traits.Bool,
                                    File(),
                                    argstr="--outputbiasfield %s",
                                    desc="Recovered bias field (OPTIONAL)",
                                    hash_files=False)
    meshresolution = InputMultiPath(
        traits.Float,
        argstr="--meshresolution %s",
        desc=
        "Resolution of the initial bspline grid defined as a sequence of three numbers. The actual resolution will be defined by adding the bspline order (default is 3) to the resolution in each dimension specified here. For example, 1,1,1 will result in a 4x4x4 grid of control points. This parameter may need to be adjusted based on your input image. In the multi-resolution N4 framework, the resolution of the bspline grid at subsequent iterations will be doubled. The number of resolutions is implicitly defined by Number of iterations parameter (the size of this list is the number of resolutions)",
        sep=",")
    splinedistance = traits.Float(
        argstr="--splinedistance %f",
        desc=
        "An alternative means to define the spline grid, by setting the distance between the control points. This parameter is used only if the grid resolution is not specified."
    )
    bffwhm = traits.Float(
        argstr="--bffwhm %f",
        desc=
        "Bias field Full Width at Half Maximum. Zero implies use of the default value."
    )
    iterations = InputMultiPath(
        traits.Int,
        argstr="--iterations %s",
        desc=
        "Maximum number of iterations at each level of resolution. Larger values will increase execution time, but may lead to better results.",
        sep=",")
    convergencethreshold = traits.Float(
        argstr="--convergencethreshold %f",
        desc=
        "Stopping criterion for the iterative bias estimation. Larger values will lead to smaller execution time."
    )
    bsplineorder = traits.Int(
        argstr="--bsplineorder %d",
        desc=
        "Order of B-spline used in the approximation. Larger values will lead to longer execution times, may result in overfitting and poor result."
    )
    shrinkfactor = traits.Int(
        argstr="--shrinkfactor %d",
        desc=
        "Defines how much the image should be upsampled before estimating the inhomogeneity field. Increase if you want to reduce the execution time. 1 corresponds to the original resolution. Larger values will significantly reduce the computation time."
    )
    weightimage = File(argstr="--weightimage %s",
                       desc="Weight Image",
                       exists=True)
    wienerfilternoise = traits.Float(
        argstr="--wienerfilternoise %f",
        desc="Wiener filter noise. Zero implies use of the default value.")
    nhistogrambins = traits.Int(
        argstr="--nhistogrambins %d",
        desc="Number of histogram bins. Zero implies use of the default value."
    )
Beispiel #29
0
class DWIConvertInputSpec(CommandLineInputSpec):
    conversionMode = traits.Enum(
        "DicomToNrrd",
        "DicomToFSL",
        "NrrdToFSL",
        "FSLToNrrd",
        argstr="--conversionMode %s",
        desc=
        "Determine which conversion to perform. DicomToNrrd (default): Convert DICOM series to NRRD DicomToFSL: Convert DICOM series to NIfTI File + gradient/bvalue text files NrrdToFSL: Convert DWI NRRD file to NIfTI File + gradient/bvalue text files FSLToNrrd: Convert NIfTI File + gradient/bvalue text files to NRRD file."
    )
    inputVolume = File(
        argstr="--inputVolume %s",
        desc="Input DWI volume -- not used for DicomToNrrd mode.",
        exists=True)
    outputVolume = traits.Either(traits.Bool,
                                 File(),
                                 argstr="--outputVolume %s",
                                 desc="Output filename (.nhdr or .nrrd)",
                                 hash_files=False)
    inputDicomDirectory = Directory(argstr="--inputDicomDirectory %s",
                                    desc="Directory holding Dicom series",
                                    exists=True)
    fslNIFTIFile = File(argstr="--fslNIFTIFile %s",
                        desc="4D NIfTI file containing gradient volumes",
                        exists=True)
    inputBValues = File(
        argstr="--inputBValues %s",
        desc="The B Values are stored in FSL .bval text file format",
        exists=True)
    inputBVectors = File(
        argstr="--inputBVectors %s",
        desc="The Gradient Vectors are stored in FSL .bvec text file format",
        exists=True)
    outputNiftiFile = traits.Either(
        traits.Bool,
        File(),
        argstr="--outputNiftiFile %s",
        desc="Nifti output filename (for Slicer GUI use).",
        hash_files=False)
    outputBValues = traits.Either(
        traits.Bool,
        File(),
        argstr="--outputBValues %s",
        desc=
        "The B Values are stored in FSL .bval text file format (defaults to <outputVolume>.bval)",
        hash_files=False)
    outputBVectors = traits.Either(
        traits.Bool,
        File(),
        argstr="--outputBVectors %s",
        desc=
        "The Gradient Vectors are stored in FSL .bvec text file format (defaults to <outputVolume>.bvec)",
        hash_files=False)
    writeProtocolGradientsFile = traits.Bool(
        argstr="--writeProtocolGradientsFile ",
        desc=
        "Write the protocol gradients to a file suffixed by \'.txt\' as they were specified in the procol by multiplying each diffusion gradient direction by the measurement frame.  This file is for debugging purposes only, the format is not fixed, and will likely change as debugging of new dicom formats is necessary."
    )
    useIdentityMeaseurementFrame = traits.Bool(
        argstr="--useIdentityMeaseurementFrame ",
        desc=
        "Adjust all the gradients so that the measurement frame is an identity matrix."
    )
    useBMatrixGradientDirections = traits.Bool(
        argstr="--useBMatrixGradientDirections ",
        desc=
        "Fill the nhdr header with the gradient directions and bvalues computed out of the BMatrix. Only changes behavior for Siemens data.  In some cases the standard public gradients are not properly computed.  The gradients can emperically computed from the private BMatrix fields.  In some cases the private BMatrix is consistent with the public grandients, but not in all cases, when it exists BMatrix is usually most robust."
    )
    outputDirectory = traits.Either(
        traits.Bool,
        Directory(),
        argstr="--outputDirectory %s",
        desc="Directory holding the output NRRD file",
        hash_files=False)
    smallGradientThreshold = traits.Float(
        argstr="--smallGradientThreshold %f",
        desc=
        "If a gradient magnitude is greater than 0 and less than smallGradientThreshold, then DWIConvert will display an error message and quit, unless the useBMatrixGradientDirections option is set."
    )
    transposeInputBVectors = traits.Bool(
        argstr="--transposeInputBVectors ",
        desc=
        "FSL input BVectors are expected to be encoded in the input file as one vector per line. If it is not the case, use this option to transpose the file as it is read"
    )
    allowLossyConversion = traits.Bool(
        argstr="--allowLossyConversion ",
        desc=
        "The only supported output type is 'short'. Conversion from images of a different type may cause data loss due to rounding or truncation. Use with caution!\'"
    )
    gradientVectorFile = traits.Either(
        traits.Bool,
        File(),
        argstr="--gradientVectorFile %s",
        desc=
        "DEPRECATED:  Use --inputBVector --inputBValue files Text file giving gradient vectors",
        hash_files=False)
    fMRI = traits.Bool(
        argstr="--fMRI ",
        desc=
        "DEPRECATED:  No support or testing.  Output a NRRD file, but without gradients"
    )
Beispiel #30
0
class GaussianBlurImageFilterInputSpec(CommandLineInputSpec):
    sigma = traits.Float(desc="Sigma value in physical units (e.g., mm) of the Gaussian kernel", argstr="--sigma %f")
    inputVolume = File(position=-2, desc="Input volume", exists=True, argstr="%s")
    outputVolume = traits.Either(traits.Bool, File(), position=-1, hash_files=False, desc="Blurred Volume", argstr="%s")