class BRAINSResampleInputSpec(CommandLineInputSpec):
    inputVolume = File(desc="Image To Warp",
                       exists=True,
                       argstr="--inputVolume %s")
    referenceVolume = File(
        desc=
        "Reference image used only to define the output space. If not specified, the warping is done in the same space as the image to warp.",
        exists=True,
        argstr="--referenceVolume %s",
    )
    outputVolume = traits.Either(
        traits.Bool,
        File(),
        hash_files=False,
        desc="Resulting deformed image",
        argstr="--outputVolume %s",
    )
    pixelType = traits.Enum(
        "float",
        "short",
        "ushort",
        "int",
        "uint",
        "uchar",
        "binary",
        desc=
        "Specifies the pixel type for the input/output images.  The 'binary' pixel type uses a modified algorithm whereby the image is read in as unsigned char, a signed distance map is created, signed distance map is resampled, and then a thresholded image of type unsigned char is written to disk.",
        argstr="--pixelType %s",
    )
    deformationVolume = File(
        desc="Displacement Field to be used to warp the image",
        exists=True,
        argstr="--deformationVolume %s",
    )
    warpTransform = File(
        desc=
        "Filename for the BRAINSFit transform used in place of the deformation field",
        exists=True,
        argstr="--warpTransform %s",
    )
    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, ResampleInPlace, NearestNeighbor, BSpline, or WindowedSinc",
        argstr="--interpolationMode %s",
    )
    inverseTransform = traits.Bool(
        desc=
        "True/False is to compute inverse of given transformation. Default is false",
        argstr="--inverseTransform ",
    )
    defaultValue = traits.Float(desc="Default voxel value",
                                argstr="--defaultValue %f")
    gridSpacing = InputMultiPath(
        traits.Int,
        desc=
        "Add warped grid to output image to help show the deformation that occured with specified spacing.   A spacing of 0 in a dimension indicates that grid lines should be rendered to fall exactly (i.e. do not allow displacements off that plane).  This is useful for makeing a 2D image of grid lines from the 3D space ",
        sep=",",
        argstr="--gridSpacing %s",
    )
    numberOfThreads = traits.Int(
        desc="Explicitly specify the maximum number of threads to use.",
        argstr="--numberOfThreads %d",
    )
Esempio n. 2
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")
Esempio n. 3
0
class _ReconAllInputSpec(fs.preprocess.ReconAllInputSpec):
    directive = traits.Enum(
        'all',
        'autorecon1',
        # autorecon2 variants
        'autorecon2',
        'autorecon2-volonly',
        'autorecon2-perhemi',
        'autorecon2-inflate1',
        'autorecon2-cp',
        'autorecon2-wm',
        # autorecon3 variants
        'autorecon3',
        'autorecon3-T2pial',
        # Mix of autorecon2 and autorecon3 steps
        'autorecon-pial',
        'autorecon-hemi',
        # Not "multi-stage flags"
        'localGI',
        'qcache',
        argstr='-%s',
        desc='process directive',
        usedefault=True,
        xor=['steps'],
        position=0)
    steps = InputMultiObject(
        traits.Enum(
            # autorecon1
            'motioncor',
            'talairach',
            'nuintensitycor',
            'normalization',
            'skullstrip',
            # autorecon2-volonly
            'gcareg',
            'canorm',
            'careg',
            'careginv',  # 5.3
            'rmneck',  # 5.3
            'skull-lta',  # 5.3
            'calabel',
            'normalization2',
            'maskbfs',
            'segmentation',
            # autorecon2 per-hemi
            'tessellate',
            'smooth1',
            'inflate1',
            'qsphere',
            'fix',
            'white',
            'smooth2',
            'inflate2',
            'curvHK',  # 6.0
            'curvstats',
            # autorecon3 per-hemi
            'sphere',
            'surfreg',
            'jacobian_white',
            'avgcurv',
            'cortparc',
            'pial',
            'pctsurfcon',
            'parcstats',
            'cortparc2',
            'parcstats2',
            'cortparc3',
            'parcstats3',
            'label-exvivo-ec',
            # autorecon vol
            'cortribbon',
            'hyporelabel',  # 6.0
            'segstats',
            'aparc2aseg',
            'apas2aseg',  # 6.0
            'wmparc',
            'balabels',
        ),
        desc='specific process directives',
        xor=['directive'],
        position=0)
class mapped_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.File(exists=True,
                       desc='seed volume(s)',
                       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')
    network = traits.Bool(
        desc='activate network mode - only keep paths going through ' +
        'at least one seed mask (required if multiple seed masks)',
        argstr='--network')
    opd = traits.Bool(True,
                      desc='outputs path distributions',
                      argstr='--opd',
                      usedefault=True)
    os2t = traits.Bool(desc='Outputs seeds to targets', argstr='--os2t')
    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')
    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')
    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')
    s2tastext = traits.Bool(argstr='--s2tastext',
                            desc='output seed-to-target counts as a' +
                            ' text file (useful when seeding from a mesh)')
    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)
Esempio n. 5
0
class BfcInputSpec(CommandLineInputSpec):
    inputMRIFile = File(mandatory=True,
                        desc='input skull-stripped MRI volume',
                        argstr='-i %s')
    inputMaskFile = File(desc='mask file', argstr='-m %s', hash_files=False)
    outputMRIVolume = File(desc='output bias-corrected MRI volume.'
                           'If unspecified, output file name'
                           'will be auto generated.',
                           argstr='-o %s',
                           hash_files=False,
                           genfile=True)
    outputBiasField = File(desc='save bias field estimate',
                           argstr='--bias %s',
                           hash_files=False)
    outputMaskedBiasField = File(desc='save bias field estimate (masked)',
                                 argstr='--maskedbias %s',
                                 hash_files=False)
    histogramRadius = traits.Int(desc='histogram radius (voxels)',
                                 argstr='-r %d')
    biasEstimateSpacing = traits.Int(desc='bias sample spacing (voxels)',
                                     argstr='-s %d')
    controlPointSpacing = traits.Int(desc='control point spacing (voxels)',
                                     argstr='-c %d')
    splineLambda = traits.Float(desc='spline stiffness weighting parameter',
                                argstr='-w %f')
    histogramType = traits.Enum('ellipse',
                                'block',
                                desc='Options for type of histogram\nellipse:'
                                'use ellipsoid for ROI histogram\nblock'
                                ':use block for ROI histogram',
                                argstr='%s')
    iterativeMode = traits.Bool(desc='iterative mode (overrides -r, -s, -c,'
                                '-w settings)',
                                argstr='--iterate')
    correctionScheduleFile = File(desc='list of parameters ',
                                  argstr='--schedule %s')
    biasFieldEstimatesOutputPrefix = traits.Str(desc='save iterative bias'
                                                'field estimates as'
                                                '<prefix>.n.field.nii.gz',
                                                argstr='--biasprefix %s')
    correctedImagesOutputPrefix = traits.Str(desc='save iterative corrected'
                                             'images as'
                                             '<prefix>.n.bfc.nii.gz',
                                             argstr='--prefix %s')
    correctWholeVolume = traits.Bool(desc='apply correction field to entire'
                                     'volume',
                                     argstr='--extrapolate')
    minBias = traits.Float(0.5,
                           usedefault=True,
                           desc='minimum allowed bias'
                           'value',
                           argstr='-L %f')
    maxBias = traits.Float(1.5,
                           usedefault=True,
                           desc='maximum allowed bias'
                           ''
                           'value',
                           argstr='-U %f')
    biasRange = traits.Enum("low",
                            "medium",
                            "high",
                            desc='Preset options for bias_model\n'
                            'low: small bias model [0.95,1.05]\n'
                            'medium: medium bias model [0.90,1.10]\n'
                            'high: high bias model [0.80,1.20]',
                            argstr='%s')
    intermediate_file_type = traits.Enum("analyze",
                                         "nifti",
                                         "gzippedAnalyze",
                                         "gzippedNifti",
                                         desc='Options for the format in'
                                         'which intermediate files are'
                                         ""
                                         'generated',
                                         argstr='%s')
    convergenceThreshold = traits.Float(desc='convergence threshold',
                                        argstr='--eps %f')
    biasEstimateConvergenceThreshold = traits.Float(
        desc='bias estimate convergence threshold (values > 0.1 disable)',
        argstr='--beps %f')
    verbosityLevel = traits.Int(desc='verbosity level (0=silent)',
                                argstr='-v %d')
    timer = traits.Bool(desc='display timing information', argstr='--timer')
Esempio n. 6
0
class TrackBayesDiracInputSpec(TrackInputSpec):
    scheme_file = File(
        argstr='-schemefile %s',
        mandatory=True,
        exist=True,
        desc='The scheme file corresponding to the data being processed.')

    iterations = traits.Int(
        argstr='-iterations %d',
        units='NA',
        desc=
        "Number of streamlines to generate at each seed point. The default is 5000."
    )

    pdf = traits.Enum(
        'bingham',
        'watson',
        'acg',
        argstr='-pdf %s',
        desc=
        'Specifies the model for PICo priors (not the curvature priors). The default is "bingham".'
    )

    pointset = traits.Int(
        argstr='-pointset %s',
        desc=
        'Index to the point set to use for Bayesian likelihood calculation. The index specifies a set of evenly distributed points on the unit sphere, where each point x defines two possible step directions (x or -x) for the streamline path. A larger number indexes a larger point set, which gives higher angular resolution at the expense of computation time. The default is index 1, which gives 1922 points, index 0 gives 1082 points, index 2 gives 3002 points.'
    )

    datamodel = traits.Enum(
        'cylsymmdt',
        'ballstick',
        argstr='-datamodel %s',
        desc=
        'Model of the data for Bayesian tracking. The default model is "cylsymmdt", a diffusion tensor with cylindrical symmetry about e_1, ie L1 >= L_2 = L_3. The other model is "ballstick", the partial volume model (see ballstickfit).'
    )

    curvepriork = traits.Float(
        argstr='-curvepriork %s',
        desc=
        'Concentration parameter for the prior distribution on fibre orientations given the fibre orientation at the previous step. Larger values of k make curvature less likely.'
    )

    curvepriorg = traits.Float(
        argstr='-curvepriorg %s',
        desc=
        'Concentration parameter for the prior distribution on fibre orientations given the fibre orientation at the previous step. Larger values of g make curvature less likely.'
    )

    extpriorfile = File(
        exists=True,
        argstr='-extpriorfile %s',
        desc=
        'Path to a PICo image produced by picopdfs. The PDF in each voxel is used as a prior for the fibre orientation in Bayesian tracking. The prior image must be in the same space as the diffusion data.'
    )

    extpriordatatype = traits.Enum(
        'float',
        'double',
        argstr='-extpriordatatype %s',
        desc='Datatype of the prior image. The default is "double".')
Esempio n. 7
0
class RF12BRAINSCutWrapperCLInputSpec(CommandLineInputSpec):
    ### subject specific
    inputSubjectT1Filename = File(desc="Subject T1 Volume",
                                  exists=True,
                                  mandatory=True,
                                  argstr="--inputSubjectT1Filename %s")
    inputSubjectT2Filename = File(desc="Subject T2 Volume",
                                  exists=True,
                                  mandatory=False,
                                  argstr="--inputSubjectT2Filename %s")
    candidateRegion = File(desc="Valid region for finding GM structures",
                           exists=True,
                           mandatory=True,
                           argstr="--candidateRegion %s")
    inputSubjectGadSGFilename = File(desc="Subject SG Volume",
                                     exists=True,
                                     mandatory=False,
                                     argstr="--inputSubjectGadSGFilename %s")
    vectorNormalization = traits.Enum(
        "IQR",
        "Linear",
        "Sigmoid_Q01",
        "Sigmoid_Q05",
        "ZScore",
        "NONE",
        desc="The type of intensity normalization to use",
        exists=True,
        mandatory=True,
        argstr="--vectorNormalization %s")

    ### model specific
    modelFilename = File(desc="modelFilename",
                         exists=True,
                         mandatory=True,
                         argstr="--modelFilename %s")
    trainingVectorFilename = File(desc="training vectof file name",
                                  exists=False,
                                  mandatory=False,
                                  argstr="--trainingVectorFilename %s")
    inputTemplateT1 = File(desc="Atlas Template T1 image",
                           exists=False,
                           mandatory=False,
                           argstr="--inputTemplateT1 %s")
    inputTemplateRhoFilename = File(desc="Atlas Template rho image",
                                    exists=False,
                                    mandatory=False,
                                    argstr="--inputTemplateRhoFilename %s")
    inputTemplatePhiFilename = File(desc="Atlas Template phi image",
                                    exists=False,
                                    mandatory=False,
                                    argstr="--inputTemplatePhiFilename %s")
    inputTemplateThetaFilename = File(desc="Atlas Template theta image",
                                      exists=False,
                                      mandatory=False,
                                      argstr="--inputTemplateThetaFilename %s")
    deformationFromTemplateToSubject = File(
        desc="Atlas To subject Deformation",
        exists=False,
        mandatory=False,
        argstr="--deformationFromTemplateToSubject %s")

    ### probability maps
    probabilityMapsLeftAccumben = File(
        desc="Spatial probability map of left accumben",
        exists=True,
        mandatory=True,
        argstr="--probabilityMapsLeftAccumben %s")
    probabilityMapsRightAccumben = File(
        desc="Spatial probability map of right accumben",
        exists=True,
        mandatory=True,
        argstr="--probabilityMapsRightAccumben %s")

    probabilityMapsLeftCaudate = File(
        desc="Spatial probability map of left caudate",
        exists=True,
        mandatory=True,
        argstr="--probabilityMapsLeftCaudate %s")
    probabilityMapsRightCaudate = File(
        desc="Spatial probability map of right caudate",
        exists=True,
        mandatory=True,
        argstr="--probabilityMapsRightCaudate %s")

    probabilityMapsLeftGlobus = File(
        desc="Spatial probability map of left globus",
        exists=True,
        mandatory=True,
        argstr="--probabilityMapsLeftGlobus %s")
    probabilityMapsRightGlobus = File(
        desc="Spatial probability map of right globus",
        exists=True,
        mandatory=True,
        argstr="--probabilityMapsRightGlobus %s")

    probabilityMapsLeftHippocampus = File(
        desc="Spatial probability map of left hippocampus",
        exists=True,
        mandatory=True,
        argstr="--probabilityMapsLeftHippocampus %s")
    probabilityMapsRightHippocampus = File(
        desc="Spatial probability map of right hippocampus",
        exists=True,
        mandatory=True,
        argstr="--probabilityMapsRightHippocampus %s")

    probabilityMapsLeftPutamen = File(
        desc="Spatial probability map of left putamen",
        exists=True,
        mandatory=True,
        argstr="--probabilityMapsLeftPutamen %s")
    probabilityMapsRightPutamen = File(
        desc="Spatial probability map of right putamen",
        exists=True,
        mandatory=True,
        argstr="--probabilityMapsRightPutamen %s")

    probabilityMapsLeftThalamus = File(
        desc="Spatial probability map of left thalamus",
        exists=True,
        mandatory=True,
        argstr="--probabilityMapsLeftThalamus %s")
    probabilityMapsRightThalamus = File(
        desc="Spatial probability map of right thalamus",
        exists=True,
        mandatory=True,
        argstr="--probabilityMapsRightThalamus %s")

    xmlFilename = File(desc="Net configuration xml file",
                       exists=False,
                       mandatory=False,
                       argstr="--xmlFilename %s")

    outputBinaryLeftAccumben = File(desc="Output binary file of left accumben",
                                    exists=False,
                                    mandatory=True,
                                    argstr="--outputBinaryLeftAccumben %s")
    outputBinaryRightAccumben = File(
        desc="Output binary file of right accumben",
        exists=False,
        mandatory=True,
        argstr="--outputBinaryRightAccumben %s")

    outputBinaryLeftCaudate = File(desc="Output binary file of left caudate",
                                   exists=False,
                                   mandatory=True,
                                   argstr="--outputBinaryLeftCaudate %s")
    outputBinaryRightCaudate = File(desc="Output binary file of right caudate",
                                    exists=False,
                                    mandatory=True,
                                    argstr="--outputBinaryRightCaudate %s")

    outputBinaryLeftGlobus = File(desc="Output binary file of left globus",
                                  exists=False,
                                  mandatory=True,
                                  argstr="--outputBinaryLeftGlobus %s")
    outputBinaryRightGlobus = File(desc="Output binary file of right globus",
                                   exists=False,
                                   mandatory=True,
                                   argstr="--outputBinaryRightGlobus %s")

    outputBinaryLeftHippocampus = File(
        desc="Output binary file of left hippocampus",
        exists=False,
        mandatory=True,
        argstr="--outputBinaryLeftHippocampus %s")
    outputBinaryRightHippocampus = File(
        desc="Output binary file of right hippocampus",
        exists=False,
        mandatory=True,
        argstr="--outputBinaryRightHippocampus %s")

    outputBinaryLeftPutamen = File(desc="Output binary file of left putamen",
                                   exists=False,
                                   mandatory=True,
                                   argstr="--outputBinaryLeftPutamen %s")
    outputBinaryRightPutamen = File(desc="Output binary file of right putamen",
                                    exists=False,
                                    mandatory=True,
                                    argstr="--outputBinaryRightPutamen %s")

    outputBinaryLeftThalamus = File(desc="Output binary file of left thalamus",
                                    exists=False,
                                    mandatory=True,
                                    argstr="--outputBinaryLeftThalamus %s")
    outputBinaryRightThalamus = File(
        desc="Output binary file of right thalamus",
        exists=False,
        mandatory=True,
        argstr="--outputBinaryRightThalamus %s")
Esempio n. 8
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")
Esempio n. 9
0
class JoinTSVColumnsInputSpec(BaseInterfaceInputSpec):
    in_file = File(exists=True, mandatory=True, desc='input file')
    join_file = File(exists=True, mandatory=True, desc='file to be adjoined')
    side = traits.Enum('right', 'left', usedefault=True, desc='where to join')
    columns = traits.List(traits.Str, desc='header for columns')
Esempio n. 10
0
class StackConfoundsInputSpec(BaseInterfaceInputSpec):
    in_files = InputMultiObject(File(exists=True), mandatory=True)
    axis = traits.Enum(0, 1, default=0, usedefault=True)
    out_file = File()
Esempio n. 11
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 ",
    )
Esempio n. 12
0
class MergeInputSpec(FSLCommandInputSpec):
    in_files = traits.List(File(exists=True), argstr="%s", position=2, mandatory=True)
    dimension = traits.Enum('t', 'x', 'y', 'z', argstr="-%s", position=0,
                            desc="dimension along which the file will be merged",
                            mandatory=True)
    merged_file = File(argstr="%s", position=1, genfile=True, hash_files=False)
class BlockmatchingInputSpec(CommandLineInputSpec):

    reference = File(
        exists=True,
        desc='Reference image',
        argstr='-reference %s',
        mandatory=True,
    )

    floating = File(
        exists=True,
        desc='Floating image',
        argstr='-floating %s',
        mandatory=True,
    )

    result = File(
        exists=False,
        desc='Resampled image',
        argstr='-result %s',
        mandatory=False,
    )

    result_trsf = File(
        exists=False,
        desc='Result transform',
        argstr='-result-transformation %s',
        mandatory=False,
    )

    initial_trsf = File(
        exists=False,
        desc='Initial transform',
        argstr='-initial-transformation %s',
        mandatory=False,
    )

    trsf_type = traits.Enum(
        'translation2D',
        'translation3D',
        'translation-scaling2D',
        'translation-scaling3D',
        'rigid2D',
        'rigid3D',
        'rigid',
        'similitude2D',
        'similitude3D',
        'similitude',
        'affine2D',
        'affine3D',
        'affine',
        'vectorfield2D',
        'vectorfield3D',
        'vectorfield',
        'vector',
        desc='Transformation type',
        argstr='-transformation-type %s',
    )

    pyramid_lowest = traits.Int(
        0,  # original dimension
        desc="Pyramid lowest level",
        argstr='-pyramid-lowest-level %d',
    )

    pyramid_highest = traits.Int(
        3,
        desc="Pyramid highest level",
        argstr='-pyramid-highest-level %d',
    )

    pyramid_gaussian_filtering = traits.Bool(
        desc='Gaussian smoothing before subsampling',
        argstr='-pyramid-gaussian-filtering',
        usedefault=True,
    )
Esempio n. 14
0
class MRCalcInputSpec(CommandLineInputSpec):

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

    out_file = File(genfile=True,
                    argstr='%s',
                    position=-1,
                    desc="Extracted DW or b-zero images")

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

    quiet = traits.Bool(mandatory=False,
                        argstr="-quiet",
                        desc="Don't display output during operation")
Esempio n. 15
0
class BuildConnectomeInputSpec(CommandLineInputSpec):
    in_file = File(exists=True,
                   argstr='%s',
                   mandatory=True,
                   position=-3,
                   desc='input tractography')
    in_parc = File(exists=True,
                   argstr='%s',
                   position=-2,
                   desc='parcellation file')
    out_file = File('connectome.csv',
                    argstr='%s',
                    mandatory=True,
                    position=-1,
                    usedefault=True,
                    desc='output file after processing')
    out_assignments = File(argstr='-out_assignments %s',
                           desc='file with streamline assignments')
    nthreads = traits.Int(argstr='-nthreads %d',
                          desc='number of threads. if zero, the number'
                          ' of available cpus will be used',
                          nohash=True)
    vox_lookup = traits.Bool(
        argstr='-assignment_voxel_lookup',
        desc='use a simple voxel lookup value at each streamline endpoint')
    search_radius = traits.Float(
        argstr='-assignment_radial_search %f',
        desc='perform a radial search from each streamline endpoint to locate '
        'the nearest node. Argument is the maximum radius in mm; if no node is'
        ' found within this radius, the streamline endpoint is not assigned to'
        ' any node.')
    search_reverse = traits.Float(
        argstr='-assignment_reverse_search %f',
        desc='traverse from each streamline endpoint inwards along the '
        'streamline, in search of the last node traversed by the streamline. '
        'Argument is the maximum traversal length in mm (set to 0 to allow '
        'search to continue to the streamline midpoint).')
    search_forward = traits.Float(
        argstr='-assignment_forward_search %f',
        desc='project the streamline forwards from the endpoint in search of a'
        'parcellation node voxel. Argument is the maximum traversal length in '
        'mm.')
    stat_edge = traits.Enum("sum",
                            "mean",
                            "min",
                            "max",
                            argstr='-stat_edge %s',
                            usedefault=True)
    length_scale = traits.Enum("None", "length", "invlength", argstr='%s')
    scale_invnodevol = traits.Bool(False, argstr="-scale_invnodevol")
    in_scalar = File(exists=True,
                     argstr='-scale_file %s',
                     desc='provide the associated image '
                     'for the mean_scalar metric')
    in_weights = File(exists=True,
                      argstr='-tck_weights_in %s',
                      desc='specify a text scalar '
                      'file containing the streamline weights')
    keep_unassigned = traits.Bool(
        argstr='-keep_unassigned',
        desc='By default, the program discards the'
        ' information regarding those streamlines that are not successfully '
        'assigned to a node pair. Set this option to keep these values (will '
        'be the first row/column in the output matrix)')
    zero_diagonal = traits.Bool(
        argstr='-zero_diagonal',
        desc='set all diagonal entries in the matrix '
        'to zero (these represent streamlines that connect to the same node at'
        ' both ends)')
    symmetric = traits.Bool(argstr='-symmetric',
                            desc='Make matrices symmetric on output')
Esempio n. 16
0
class TOPUPInputSpec(FSLCommandInputSpec):
    in_file = File(exists=True,
                   mandatory=True,
                   desc='name of 4D file with images',
                   argstr='--imain=%s')
    encoding_file = File(exists=True,
                         mandatory=True,
                         xor=['encoding_direction'],
                         desc='name of text file with PE directions/times',
                         argstr='--datain=%s')
    encoding_direction = traits.List(traits.Enum('y', 'x', 'z', 'x-', 'y-',
                                                 'z-'),
                                     mandatory=True,
                                     xor=['encoding_file'],
                                     requires=['readout_times'],
                                     argstr='--datain=%s',
                                     desc=('encoding direction for automatic '
                                           'generation of encoding_file'))
    readout_times = InputMultiPath(traits.Float,
                                   requires=['encoding_direction'],
                                   xor=['encoding_file'],
                                   mandatory=True,
                                   desc=('readout times (dwell times by # '
                                         'phase-encode steps minus 1)'))
    out_base = File(desc=('base-name of output files (spline '
                          'coefficients (Hz) and movement parameters)'),
                    name_source=['in_file'],
                    name_template='%s_base',
                    argstr='--out=%s',
                    hash_files=False)
    out_field = File(argstr='--fout=%s',
                     hash_files=False,
                     name_source=['in_file'],
                     name_template='%s_field',
                     desc='name of image file with field (Hz)')
    out_corrected = File(argstr='--iout=%s',
                         hash_files=False,
                         name_source=['in_file'],
                         name_template='%s_corrected',
                         desc='name of 4D image file with unwarped images')
    out_logfile = File(argstr='--logout=%s',
                       desc='name of log-file',
                       name_source=['in_file'],
                       name_template='%s_topup.log',
                       keep_extension=True,
                       hash_files=False)

    # TODO: the following traits admit values separated by commas, one value
    # per registration level inside topup.
    warp_res = traits.Float(10.0,
                            argstr='--warpres=%f',
                            desc=('(approximate) resolution (in mm) of warp '
                                  'basis for the different sub-sampling levels'
                                  '.'))
    subsamp = traits.Int(1, argstr='--subsamp=%d', desc='sub-sampling scheme')
    fwhm = traits.Float(8.0,
                        argstr='--fwhm=%f',
                        desc='FWHM (in mm) of gaussian smoothing kernel')
    config = traits.String('b02b0.cnf',
                           argstr='--config=%s',
                           usedefault=True,
                           desc=('Name of config file specifying command line '
                                 'arguments'))
    max_iter = traits.Int(5,
                          argstr='--miter=%d',
                          desc='max # of non-linear iterations')
    reg_lambda = traits.Float(1.0,
                              argstr='--miter=%0.f',
                              desc=('lambda weighting value of the '
                                    'regularisation term'))
    ssqlambda = traits.Enum(1,
                            0,
                            argstr='--ssqlambda=%d',
                            desc=('Weight lambda by the current value of the '
                                  'ssd. If used (=1), the effective weight of '
                                  'regularisation term becomes higher for the '
                                  'initial iterations, therefore initial steps'
                                  ' are a little smoother than they would '
                                  'without weighting. This reduces the '
                                  'risk of finding a local minimum.'))
    regmod = traits.Enum('bending_energy',
                         'membrane_energy',
                         argstr='--regmod=%s',
                         desc=('Regularisation term implementation. Defaults '
                               'to bending_energy. Note that the two functions'
                               ' have vastly different scales. The membrane '
                               'energy is based on the first derivatives and '
                               'the bending energy on the second derivatives. '
                               'The second derivatives will typically be much '
                               'smaller than the first derivatives, so input '
                               'lambda will have to be larger for '
                               'bending_energy to yield approximately the same'
                               ' level of regularisation.'))
    estmov = traits.Enum(1,
                         0,
                         argstr='--estmov=%d',
                         desc='estimate movements if set')
    minmet = traits.Enum(0,
                         1,
                         argstr='--minmet=%d',
                         desc=('Minimisation method 0=Levenberg-Marquardt, '
                               '1=Scaled Conjugate Gradient'))
    splineorder = traits.Int(3,
                             argstr='--splineorder=%d',
                             desc=('order of spline, 2->Qadratic spline, '
                                   '3->Cubic spline'))
    numprec = traits.Enum('double',
                          'float',
                          argstr='--numprec=%s',
                          desc=('Precision for representing Hessian, double '
                                'or float.'))
    interp = traits.Enum('spline',
                         'linear',
                         argstr='--interp=%s',
                         desc='Image interpolation model, linear or spline.')
    scale = traits.Enum(0,
                        1,
                        argstr='--scale=%d',
                        desc=('If set (=1), the images are individually scaled'
                              ' to a common mean'))
    regrid = traits.Enum(1,
                         0,
                         argstr='--regrid=%d',
                         desc=('If set (=1), the calculations are done in a '
                               'different grid'))
Esempio n. 17
0
class TrackInputSpec(CommandLineInputSpec):
    in_file = File(exists=True,
                   argstr='-inputfile %s',
                   mandatory=True,
                   position=1,
                   desc='input data file')

    seed_file = File(exists=True,
                     argstr='-seedfile %s',
                     mandatory=False,
                     position=2,
                     desc='seed file')

    inputmodel = traits.Enum('dt',
                             'multitensor',
                             'pds',
                             'pico',
                             'bootstrap',
                             'ballstick',
                             'bayesdirac',
                             argstr='-inputmodel %s',
                             desc='input model type',
                             usedefault=True)

    inputdatatype = traits.Enum('float',
                                'double',
                                argstr='-inputdatatype %s',
                                desc='input file type')

    gzip = traits.Bool(argstr='-gzip',
                       desc="save the output image in gzip format")

    maxcomponents = traits.Int(
        argstr='-maxcomponents %d',
        units='NA',
        desc=
        "The maximum number of tensor components in a voxel. This determines the size of the input file and does not say anything about the voxel classification. The default is 2 if the input model is multitensor and 1 if the input model is dt."
    )

    data_dims = traits.List(traits.Int,
                            desc='data dimensions in voxels',
                            argstr='-datadims %s',
                            minlen=3,
                            maxlen=3,
                            units='voxels')

    voxel_dims = traits.List(traits.Float,
                             desc='voxel dimensions in mm',
                             argstr='-voxeldims %s',
                             minlen=3,
                             maxlen=3,
                             units='mm')

    ipthresh = traits.Float(
        argstr='-ipthresh %s',
        desc=
        'Curvature threshold for tracking, expressed as the minimum dot product between two streamline orientations calculated over the length of a voxel. If the dot product between the previous and current directions is less than this threshold, then the streamline terminates. The default setting will terminate fibres that curve by more than 80 degrees. Set this to -1.0 to disable curvature checking completely.'
    )

    curvethresh = traits.Float(
        argstr='-curvethresh %s',
        desc=
        'Curvature threshold for tracking, expressed as the maximum angle (in degrees) between between two streamline orientations calculated over the length of a voxel. If the angle is greater than this, then the streamline terminates.'
    )

    anisthresh = traits.Float(
        argstr='-anisthresh %s',
        desc=
        'Terminate fibres that enter a voxel with lower anisotropy than the threshold.'
    )

    anisfile = File(
        argstr='-anisfile %s',
        exists=True,
        desc=
        'File containing the anisotropy map. This is required to apply an anisotropy threshold with non tensor data. If the map issupplied it is always used, even in tensor data.'
    )

    outputtracts = traits.Enum('float',
                               'double',
                               'oogl',
                               argstr='-outputtracts %s',
                               desc='output tract file type')

    out_file = File(argstr='-outputfile %s',
                    position=-1,
                    genfile=True,
                    desc='output data file')

    output_root = File(exists=False,
                       argstr='-outputroot %s',
                       mandatory=False,
                       position=-1,
                       desc='root directory for output')
Esempio n. 18
0
class EddyInputSpec(FSLCommandInputSpec):
    in_file = File(exists=True,
                   mandatory=True,
                   argstr='--imain=%s',
                   desc=('File containing all the images to estimate '
                         'distortions for'))
    in_mask = File(exists=True,
                   mandatory=True,
                   argstr='--mask=%s',
                   desc='Mask to indicate brain')
    in_index = File(exists=True,
                    mandatory=True,
                    argstr='--index=%s',
                    desc=('File containing indices for all volumes in --imain '
                          'into --acqp and --topup'))
    in_acqp = File(exists=True,
                   mandatory=True,
                   argstr='--acqp=%s',
                   desc='File containing acquisition parameters')
    in_bvec = File(exists=True,
                   mandatory=True,
                   argstr='--bvecs=%s',
                   desc=('File containing the b-vectors for all volumes in '
                         '--imain'))
    in_bval = File(exists=True,
                   mandatory=True,
                   argstr='--bvals=%s',
                   desc=('File containing the b-values for all volumes in '
                         '--imain'))
    out_base = traits.Unicode('eddy_corrected',
                              argstr='--out=%s',
                              usedefault=True,
                              desc=('basename for output (warped) image'))
    session = File(exists=True,
                   argstr='--session=%s',
                   desc=('File containing session indices for all volumes in '
                         '--imain'))
    in_topup_fieldcoef = File(exists=True,
                              argstr="--topup=%s",
                              requires=['in_topup_movpar'],
                              desc=('topup file containing the field '
                                    'coefficients'))
    in_topup_movpar = File(exists=True,
                           requires=['in_topup_fieldcoef'],
                           desc='topup movpar.txt file')

    flm = traits.Enum('linear',
                      'quadratic',
                      'cubic',
                      argstr='--flm=%s',
                      desc='First level EC model')

    fwhm = traits.Float(desc=('FWHM for conditioning filter when estimating '
                              'the parameters'),
                        argstr='--fwhm=%s')

    niter = traits.Int(5, argstr='--niter=%s', desc='Number of iterations')

    method = traits.Enum('jac',
                         'lsr',
                         argstr='--resamp=%s',
                         desc=('Final resampling method (jacobian/least '
                               'squares)'))
    repol = traits.Bool(False,
                        argstr='--repol',
                        desc='Detect and replace outlier slices')
    num_threads = traits.Int(1,
                             usedefault=True,
                             nohash=True,
                             desc="Number of openmp threads to use")
Esempio n. 19
0
class ModelFitInputSpec(StdOutCommandLineInputSpec):
    def _gen_model_options():  #@NoSelf
        """
        Generate all possible permutations of < multi - tensor > < single - tensor > options
        """

        single_tensor = [
            'dt', 'restore', 'algdt', 'nldt_pos', 'nldt', 'ldt_wtd'
        ]
        multi_tensor = [
            'cylcyl', 'cylcyl_eq', 'pospos', 'pospos_eq', 'poscyl',
            'poscyl_eq', 'cylcylcyl', 'cylcylcyl_eq', 'pospospos',
            'pospospos_eq', 'posposcyl', 'posposcyl_eq', 'poscylcyl',
            'poscylcyl_eq'
        ]
        other = ['adc', 'ball_stick']

        model_list = single_tensor
        model_list.extend(other)
        model_list.extend([
            multi + ' ' + single for multi in multi_tensor
            for single in single_tensor
        ])
        return model_list

    model = traits.Enum(_gen_model_options(),
                        argstr='-model %s',
                        mandatory=True,
                        desc='Specifies the model to be fit to the data.')

    in_file = File(exists=True,
                   argstr='-inputfile %s',
                   mandatory=True,
                   desc='voxel-order data filename')

    inputdatatype = traits.Enum(
        'float',
        'char',
        'short',
        'int',
        'long',
        'double',
        argstr='-inputdatatype %s',
        desc=
        'Specifies the data type of the input file: "char", "short", "int", "long", "float" or "double". The input file must have BIG-ENDIAN ordering. By default, the input type is "float".'
    )

    scheme_file = File(
        exists=True,
        argstr='-schemefile %s',
        mandatory=True,
        desc='Camino scheme file (b values / vectors, see camino.fsl2scheme)')

    outputfile = File(argstr='-outputfile %s',
                      desc='Filename of the output file.')

    outlier = File(
        argstr='-outliermap %s',
        exists=True,
        desc=
        'Specifies the name of the file to contain the outlier map generated by the RESTORE algorithm.'
    )

    noisemap = File(
        argstr='-noisemap %s',
        exists=True,
        desc=
        'Specifies the name of the file to contain the estimated noise variance on the diffusion-weighted signal, generated by a weighted tensor fit. The data type of this file is big-endian double.'
    )

    residualmap = File(
        argstr='-residualmap %s',
        exists=True,
        desc=
        'Specifies the name of the file to contain the weighted residual errors after computing a weighted linear tensor fit. One value is produced per measurement, in voxel order.The data type of this file is big-endian double. Images of the residuals for each measurement can be extracted with shredder.'
    )

    sigma = traits.Float(
        argstr='-sigma %s',
        desc=
        'Specifies the standard deviation of the noise in the data. Required by the RESTORE algorithm.'
    )

    bgthresh = traits.Float(
        argstr='-bgthresh %s',
        desc=
        'Sets a threshold on the average q=0 measurement to separate foreground and background. The program does not process background voxels, but outputs the same number of values in background voxels and foreground voxels. Each value is zero in background voxels apart from the exit code which is -1.'
    )

    bgmask = File(
        argstr='-bgmask %s',
        exists=True,
        desc=
        'Provides the name of a file containing a background mask computed using, for example, FSL\'s bet2 program. The mask file contains zero in background voxels and non-zero in foreground.'
    )

    cfthresh = traits.Float(
        argstr='-csfthresh %s',
        desc=
        'Sets a threshold on the average q=0 measurement to determine which voxels are CSF. This program does not treat CSF voxels any different to other voxels.'
    )

    fixedmodq = traits.List(
        traits.Float,
        argstr='-fixedmod %s',
        minlen=4,
        maxlen=4,
        desc=
        'Specifies <M> <N> <Q> <tau> a spherical acquisition scheme with M measurements with q=0 and N measurements with |q|=Q and diffusion time tau. The N measurements with |q|=Q have unique directions. The program reads in the directions from the files in directory PointSets.'
    )

    fixedbvalue = traits.List(
        traits.Float,
        argstr='-fixedbvalue %s',
        minlen=3,
        maxlen=3,
        desc=
        'As above, but specifies <M> <N> <b>. The resulting scheme is the same whether you specify b directly or indirectly using -fixedmodq.'
    )

    tau = traits.Float(
        argstr='-tau %s',
        desc=
        'Sets the diffusion time separately. This overrides the diffusion time specified in a scheme file or by a scheme index for both the acquisition scheme and in the data synthesis.'
    )
Esempio n. 20
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")
class ProbTrackXInputSpec(FSLCommandInputSpec):
    thsamples = InputMultiPath(File(exists=True), mandatory=True)
    phsamples = InputMultiPath(File(exists=True), mandatory=True)
    fsamples = InputMultiPath(File(exists=True), mandatory=True)
    samples_base_name = traits.Str(
        "merged",
        desc='the rootname/base_name for samples files',
        argstr='--samples=%s',
        usedefault=True)
    mask = File(exists=True,
                desc='bet binary mask file in diffusion space',
                argstr='-m %s',
                mandatory=True)
    seed = traits.Either(
        File(exists=True),
        traits.List(File(exists=True)),
        traits.List(traits.List(traits.Int(), minlen=3, maxlen=3)),
        desc='seed volume(s), or voxel(s)' + 'or freesurfer label file',
        argstr='--seed=%s',
        mandatory=True)
    mode = traits.Enum(
        "simple",
        "two_mask_symm",
        "seedmask",
        desc=
        'options: simple (single seed voxel), seedmask (mask of seed voxels), '
        + 'twomask_symm (two bet binary masks) ',
        argstr='--mode=%s',
        genfile=True)
    target_masks = InputMultiPath(
        File(exits=True),
        desc='list of target masks - ' +
        'required for seeds_to_targets classification',
        argstr='--targetmasks=%s')
    mask2 = File(
        exists=True,
        desc='second bet binary mask (in diffusion space) in twomask_symm mode',
        argstr='--mask2=%s')
    waypoints = File(exists=True,
                     desc='waypoint mask or ascii list of waypoint masks - ' +
                     'only keep paths going through ALL the masks',
                     argstr='--waypoints=%s')
    network = traits.Bool(
        desc='activate network mode - only keep paths going through ' +
        'at least one seed mask (required if multiple seed masks)',
        argstr='--network')
    mesh = File(exists=True,
                desc='Freesurfer-type surface descriptor (in ascii format)',
                argstr='--mesh=%s')
    seed_ref = File(exists=True,
                    desc='reference vol to define seed space in ' +
                    'simple mode - diffusion space assumed if absent',
                    argstr='--seedref=%s')
    out_dir = Directory(exists=True,
                        argstr='--dir=%s',
                        desc='directory to put the final volumes in',
                        genfile=True)
    force_dir = traits.Bool(
        True,
        desc='use the actual directory name given - i.e. ' +
        'do not add + to make a new directory',
        argstr='--forcedir',
        usedefault=True)
    opd = traits.Bool(True,
                      desc='outputs path distributions',
                      argstr='--opd',
                      usedefault=True)
    correct_path_distribution = traits.Bool(
        desc='correct path distribution for the length of the pathways',
        argstr='--pd')
    os2t = traits.Bool(desc='Outputs seeds to targets', argstr='--os2t')
    #paths_file = File('nipype_fdtpaths', usedefault=True, argstr='--out=%s',
    #                 desc='produces an output file (default is fdt_paths)')
    avoid_mp = File(
        exists=True,
        desc='reject pathways passing through locations given by this mask',
        argstr='--avoid=%s')
    stop_mask = File(exists=True,
                     argstr='--stop=%s',
                     desc='stop tracking at locations given by this mask file')
    xfm = File(
        exists=True,
        argstr='--xfm=%s',
        desc='transformation matrix taking seed space to DTI space ' +
        '(either FLIRT matrix or FNIRT warp_field) - default is identity')
    inv_xfm = File(
        argstr='--invxfm=%s',
        desc='transformation matrix taking DTI space to seed' +
        ' space (compulsory when using a warp_field for seeds_to_dti)')
    n_samples = traits.Int(5000,
                           argstr='--nsamples=%d',
                           desc='number of samples - default=5000',
                           usedefault=True)
    n_steps = traits.Int(argstr='--nsteps=%d',
                         desc='number of steps per sample - default=2000')
    dist_thresh = traits.Float(argstr='--distthresh=%.3f',
                               desc='discards samples shorter than ' +
                               'this threshold (in mm - default=0)')
    c_thresh = traits.Float(argstr='--cthr=%.3f',
                            desc='curvature threshold - default=0.2')
    sample_random_points = traits.Bool(
        argstr='--sampvox', desc='sample random points within seed voxels')
    step_length = traits.Float(argstr='--steplength=%.3f',
                               desc='step_length in mm - default=0.5')
    loop_check = traits.Bool(argstr='--loopcheck',
                             desc='perform loop_checks on paths -' +
                             ' slower, but allows lower curvature threshold')
    use_anisotropy = traits.Bool(argstr='--usef',
                                 desc='use anisotropy to constrain tracking')
    rand_fib = traits.Enum(
        0,
        1,
        2,
        3,
        argstr='--randfib %d',
        desc='options: 0 - default, 1 - to randomly sample' +
        ' initial fibres (with f > fibthresh), 2 - to sample in ' +
        'proportion fibres (with f>fibthresh) to f, 3 - to sample ALL ' +
        'populations at random (even if f<fibthresh)')
    fibst = traits.Int(
        argstr='--fibst=%d',
        desc='force a starting fibre for tracking - ' +
        'default=1, i.e. first fibre orientation. Only works if randfib==0')
    mod_euler = traits.Bool(argstr='--modeuler',
                            desc='use modified euler streamlining')
    random_seed = traits.Bool(argstr='--rseed', desc='random seed')
    s2tastext = traits.Bool(argstr='--s2tastext',
                            desc='output seed-to-target counts as a' +
                            ' text file (useful when seeding from a mesh)')
    verbose = traits.Enum(0,
                          1,
                          2,
                          desc="Verbose level, [0-2]." +
                          "Level 2 is required to output particle files.",
                          argstr="--verbose=%d")
Esempio n. 22
0
class _JoinTSVColumnsInputSpec(BaseInterfaceInputSpec):
    in_file = File(exists=True, mandatory=True, desc="input file")
    join_file = File(exists=True, mandatory=True, desc="file to be adjoined")
    side = traits.Enum("right", "left", usedefault=True, desc="where to join")
    columns = traits.List(traits.Str, desc="header for columns")
Esempio n. 23
0
class RegistrationInput(BaseInterfaceInputSpec):

    means = InputMultiPath(File(exists=True))
    masks = InputMultiPath(File(exists=True))
    rigids = InputMultiPath(File(exists=True))
    method = traits.Enum("ants", "fsl")
Esempio n. 24
0
class ProcStreamlinesInputSpec(StdOutCommandLineInputSpec):
    inputmodel = traits.Enum('raw',
                             'voxels',
                             argstr='-inputmodel %s',
                             desc='input model type (raw or voxels)',
                             usedefault=True)

    in_file = File(exists=True,
                   argstr='-inputfile %s',
                   mandatory=True,
                   position=1,
                   desc='data file')

    maxtractpoints = traits.Int(argstr='-maxtractpoints %d',
                                units='NA',
                                desc="maximum number of tract points")
    mintractpoints = traits.Int(argstr='-mintractpoints %d',
                                units='NA',
                                desc="minimum number of tract points")
    maxtractlength = traits.Int(argstr='-maxtractlength %d',
                                units='mm',
                                desc="maximum length of tracts")
    mintractlength = traits.Int(argstr='-mintractlength %d',
                                units='mm',
                                desc="minimum length of tracts")
    datadims = traits.List(traits.Int,
                           desc='data dimensions in voxels',
                           argstr='-datadims %s',
                           minlen=3,
                           maxlen=3,
                           units='voxels')
    voxeldims = traits.List(traits.Int,
                            desc='voxel dimensions in mm',
                            argstr='-voxeldims %s',
                            minlen=3,
                            maxlen=3,
                            units='mm')
    seedpointmm = traits.List(
        traits.Int,
        desc='The coordinates of a single seed point for tractography in mm',
        argstr='-seedpointmm %s',
        minlen=3,
        maxlen=3,
        units='mm')
    seedpointvox = traits.List(
        traits.Int,
        desc=
        'The coordinates of a single seed point for tractography in voxels',
        argstr='-seedpointvox %s',
        minlen=3,
        maxlen=3,
        units='voxels')
    seedfile = File(exists=False,
                    argstr='-seedfile %s',
                    desc='Image Containing Seed Points')
    regionindex = traits.Int(argstr='-regionindex %d',
                             units='mm',
                             desc="index of specific region to process")
    iterations = traits.Float(
        argstr='-iterations %d',
        units='NA',
        desc=
        "Number of streamlines generated for each seed. Not required when outputting streamlines, but needed to create PICo images. The default is 1 if the output is streamlines, and 5000 if the output is connection probability images."
    )
    targetfile = File(exists=False,
                      argstr='-targetfile %s',
                      desc='Image containing target volumes.')
    allowmultitargets = traits.Bool(
        argstr='-allowmultitargets',
        desc="Allows streamlines to connect to multiple target volumes.")
    directional = traits.List(
        traits.Int,
        desc=
        'Splits the streamlines at the seed point and computes separate connection probabilities for each segment. Streamline segments are grouped according to their dot product with the vector (X, Y, Z). The ideal vector will be tangential to the streamline trajectory at the seed, such that the streamline projects from the seed along (X, Y, Z) and -(X, Y, Z). However, it is only necessary for the streamline trajectory to not be orthogonal to (X, Y, Z).',
        argstr='-directional %s',
        minlen=3,
        maxlen=3,
        units='NA')
    waypointfile = File(
        exists=False,
        argstr='-waypointfile %s',
        desc=
        'Image containing waypoints. Waypoints are defined as regions of the image with the same intensity, where 0 is background and any value > 0 is a waypoint.'
    )
    truncateloops = traits.Bool(
        argstr='-truncateloops',
        desc=
        "This option allows streamlines to enter a waypoint exactly once. After the streamline leaves the waypoint, it is truncated upon a second entry to the waypoint."
    )
    discardloops = traits.Bool(
        argstr='-discardloops',
        desc=
        "This option allows streamlines to enter a waypoint exactly once. After the streamline leaves the waypoint, the entire streamline is discarded upon a second entry to the waypoint."
    )
    exclusionfile = File(
        exists=False,
        argstr='-exclusionfile %s',
        desc=
        'Image containing exclusion ROIs. This should be an Analyze 7.5 header / image file.hdr and file.img.'
    )
    truncateinexclusion = traits.Bool(
        argstr='-truncateinexclusion',
        desc="Retain segments of a streamline before entry to an exclusion ROI."
    )

    endpointfile = File(
        exists=False,
        argstr='-endpointfile %s',
        desc=
        'Image containing endpoint ROIs. This should be an Analyze 7.5 header / image file.hdr and file.img.'
    )

    resamplestepsize = traits.Float(
        argstr='-resamplestepsize %d',
        units='NA',
        desc=
        "Each point on a streamline is tested for entry into target, exclusion or waypoint volumes. If the length between points on a tract is not much smaller than the voxel length, then streamlines may pass through part of a voxel without being counted. To avoid this, the program resamples streamlines such that the step size is one tenth of the smallest voxel dimension in the image. This increases the size of raw or oogl streamline output and incurs some performance penalty. The resample resolution can be controlled with this option or disabled altogether by passing a negative step size or by passing the -noresample option."
    )

    noresample = traits.Bool(
        argstr='-noresample',
        desc=
        "Disables resampling of input streamlines. Resampling is automatically disabled if the input model is voxels."
    )

    outputtracts = traits.Bool(argstr='-outputtracts',
                               desc="Output streamlines in raw binary format.")

    outputroot = File(exists=False,
                      argstr='-outputroot %s',
                      desc='Prepended onto all output file names.')

    gzip = traits.Bool(argstr='-gzip',
                       desc="save the output image in gzip format")
    outputcp = traits.Bool(
        argstr='-outputcp',
        desc="output the connection probability map (Analyze image, float)",
        requires=['outputroot', 'seedfile'])
    outputsc = traits.Bool(
        argstr='-outputsc',
        desc="output the connection probability map (raw streamlines, int)",
        requires=['outputroot', 'seedfile'])
    outputacm = traits.Bool(
        argstr='-outputacm',
        desc=
        "output all tracts in a single connection probability map (Analyze image)",
        requires=['outputroot', 'seedfile'])
    outputcbs = traits.Bool(
        argstr='-outputcbs',
        desc=
        "outputs connectivity-based segmentation maps; requires target outputfile",
        requires=['outputroot', 'targetfile', 'seedfile'])
Esempio n. 25
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",
    )
Esempio n. 26
0
class AnalyzeHeaderInputSpec(StdOutCommandLineInputSpec):
    in_file = File(exists=True,
                   argstr='< %s',
                   mandatory=True,
                   position=1,
                   desc='Tensor-fitted data filename')

    scheme_file = File(exists=True,
                       argstr='%s',
                       position=2,
                       desc=('Camino scheme file (b values / vectors, '
                             'see camino.fsl2scheme)'))

    readheader = File(
        exists=True,
        argstr='-readheader %s',
        position=3,
        desc=('Reads header information from file and prints to '
              'stdout. If this option is not specified, then the '
              'program writes a header based on the other '
              'arguments.'))

    printimagedims = File(exists=True,
                          argstr='-printimagedims %s',
                          position=3,
                          desc=('Prints image data and voxel dimensions as '
                                'Camino arguments and exits.'))

    # How do we implement both file and enum (for the program) in one argument?
    # Is this option useful anyway?
    #-printprogargs <file> <prog>
    #Prints data dimension (and type, if relevant) arguments for a specific
    # Camino program, where prog is one of shredder, scanner2voxel,
    # vcthreshselect, pdview, track.
    printprogargs = File(
        exists=True,
        argstr='-printprogargs %s',
        position=3,
        desc=('Prints data dimension (and type, if relevant) '
              'arguments for a specific Camino program, where '
              'prog is one of shredder, scanner2voxel, '
              'vcthreshselect, pdview, track.'))

    printintelbyteorder = File(
        exists=True,
        argstr='-printintelbyteorder %s',
        position=3,
        desc=('Prints 1 if the header is little-endian, '
              '0 otherwise.'))

    printbigendian = File(exists=True,
                          argstr='-printbigendian %s',
                          position=3,
                          desc=('Prints 1 if the header is big-endian, 0 '
                                'otherwise.'))

    initfromheader = File(exists=True,
                          argstr='-initfromheader %s',
                          position=3,
                          desc=('Reads header information from file and '
                                'intializes a new header with the values read '
                                'from the file. You may replace any '
                                'combination of fields in the new header by '
                                'specifying subsequent options.'))

    data_dims = traits.List(traits.Int,
                            desc='data dimensions in voxels',
                            argstr='-datadims %s',
                            minlen=3,
                            maxlen=3,
                            units='voxels')

    voxel_dims = traits.List(traits.Float,
                             desc='voxel dimensions in mm',
                             argstr='-voxeldims %s',
                             minlen=3,
                             maxlen=3,
                             units='mm')

    centre = traits.List(traits.Int,
                         argstr='-centre %s',
                         minlen=3,
                         maxlen=3,
                         units='mm',
                         desc=('Voxel specifying origin of Talairach '
                               'coordinate system for SPM, default [0 0 0].'))

    picoseed = traits.List(traits.Int,
                           argstr='-picoseed %s',
                           minlen=3,
                           maxlen=3,
                           desc=('Voxel specifying the seed (for PICo maps), '
                                 'default [0 0 0].'),
                           units='mm')

    nimages = traits.Int(argstr='-nimages %d',
                         units='NA',
                         desc="Number of images in the img file. Default 1.")

    datatype = traits.Enum('byte',
                           'char',
                           '[u]short',
                           '[u]int',
                           'float',
                           'complex',
                           'double',
                           argstr='-datatype %s',
                           desc=('The char datatype is 8 bit (not the 16 bit '
                                 'char of Java), as specified by the Analyze '
                                 '7.5 standard. The byte, ushort and uint '
                                 'types are not part of the Analyze '
                                 'specification but are supported by SPM.'),
                           mandatory=True)

    offset = traits.Int(argstr='-offset %d',
                        units='NA',
                        desc=('According to the Analyze 7.5 standard, this is '
                              'the byte offset in the .img file at which '
                              'voxels start. This value can be negative to '
                              'specify that the absolute value is applied for '
                              'every image in the file.'))

    greylevels = traits.List(traits.Int,
                             argstr='-gl %s',
                             minlen=2,
                             maxlen=2,
                             desc=('Minimum and maximum greylevels. Stored as '
                                   'shorts in the header.'),
                             units='NA')

    scaleslope = traits.Float(
        argstr='-scaleslope %d',
        units='NA',
        desc=('Intensities in the image are scaled by '
              'this factor by SPM and MRICro. Default is '
              '1.0.'))

    scaleinter = traits.Float(
        argstr='-scaleinter %d',
        units='NA',
        desc=('Constant to add to the image intensities. '
              'Used by SPM and MRIcro.'))

    description = traits.String(argstr='-description %s',
                                desc=('Short description - No spaces, max '
                                      'length 79 bytes. Will be null '
                                      'terminated automatically.'))

    intelbyteorder = traits.Bool(argstr='-intelbyteorder',
                                 desc=("Write header in intel byte order "
                                       "(little-endian)."))

    networkbyteorder = traits.Bool(argstr='-networkbyteorder',
                                   desc=("Write header in network byte order "
                                         "(big-endian). This is the default "
                                         "for new headers."))
Esempio n. 27
0
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'))
Esempio n. 28
0
class RobustMNINormalizationInputSpec(BaseInterfaceInputSpec):
    """
    Set inputs to RobustMNINormalization
    """
    # Enable deprecation
    package_version = niworkflows_version

    # Moving image.
    moving_image = File(exists=True,
                        mandatory=True,
                        desc='image to apply transformation to')
    # Reference image (optional).
    reference_image = File(exists=True, desc='override the reference image')
    # Moving mask (optional).
    moving_mask = File(exists=True, desc='moving image mask')
    # Reference mask (optional).
    reference_mask = File(exists=True, desc='reference image mask')
    # Lesion mask (optional).
    lesion_mask = File(exists=True, desc='lesion mask image')
    # Number of threads to use for ANTs/ITK processes.
    num_threads = traits.Int(cpu_count(),
                             usedefault=True,
                             nohash=True,
                             desc="Number of ITK threads to use")
    # ANTs parameter set to use.
    flavor = traits.Enum('precise',
                         'testing',
                         'fast',
                         usedefault=True,
                         desc='registration settings parameter set')
    # Template orientation.
    orientation = traits.Enum(
        'RAS',
        'LAS',
        mandatory=True,
        usedefault=True,
        desc='modify template orientation (should match input image)')
    # Modality of the reference image.
    reference = traits.Enum('T1w',
                            'T2w',
                            'boldref',
                            'PDw',
                            mandatory=True,
                            usedefault=True,
                            desc='set the reference modality for registration')
    # T1 or EPI registration?
    moving = traits.Enum('T1w',
                         'boldref',
                         usedefault=True,
                         mandatory=True,
                         desc='registration type')
    # Template to use as the default reference image.
    template = traits.Str('MNI152NLin2009cAsym',
                          usedefault=True,
                          desc='define the template to be used')
    # Load other settings from file.
    settings = traits.List(File(exists=True),
                           desc='pass on the list of settings files')
    # Resolution of the default template.
    template_spec = traits.DictStrAny(desc='template specifications')
    template_resolution = traits.Enum(1,
                                      2,
                                      desc='(DEPRECATED) template resolution')
    # Use explicit masking?
    explicit_masking = traits.Bool(True,
                                   usedefault=True,
                                   desc="""\
Set voxels outside the masks to zero thus creating an artificial border
that can drive the registration. Requires reliable and accurate masks.
See https://sourceforge.net/p/advants/discussion/840261/thread/27216e69/#c7ba\
""")
    initial_moving_transform = File(exists=True,
                                    desc='transform for initialization')
    float = traits.Bool(False,
                        usedefault=True,
                        desc='use single precision calculations')
Esempio n. 29
0
class MaxImageInput(MathsInput):

    dimension = traits.Enum("T", "X", "Y", "Z", usedefault=True, argstr="-%smax", position=4,
        desc="dimension to max across")
Esempio n. 30
0
class Annot2LabelInputSpec(CommandLineInputSpec):
    subject = traits.String(desc='subject id', argstr='--subject %s', position=0, mandatory=True)
    hemi = traits.Enum("rh", "lh", desc="hemisphere [rh | lh]", position=1, argstr="--hemi %s", mandatory=True)
    lobes = traits.Enum("lobes", desc='lobes type', argstr='--lobesStrict %s', position=2)
    in_annot = traits.File(desc='input annotation file', exists=True)