Exemplo n.º 1
0
 class spec2(nib.CommandLineInputSpec):
     doo = nib.File(exists=True, argstr="%s", position=1)
     moo = nib.File(name_source=['doo'],
                    hash_files=False,
                    argstr="%s",
                    position=2,
                    name_template='%s_mootpl')
     poo = nib.File(name_source=['moo'],
                    hash_files=False,
                    argstr="%s",
                    position=3)
Exemplo n.º 2
0
 class spec2(nib.CommandLineInputSpec):
     moo = nib.File(name_source=['doo'],
                    hash_files=False,
                    argstr="%s",
                    position=2)
     doo = nib.File(exists=True, argstr="%s", position=1)
     goo = traits.Int(argstr="%d", position=4)
     poo = nib.File(name_source=['goo'],
                    hash_files=False,
                    argstr="%s",
                    position=3)
Exemplo n.º 3
0
class ImageMathInputSpec(ANTSCommandInputSpec):
    dimension = traits.Int(3, usedefault=True, position=1, argstr='%d',
                           desc='dimension of output image')
    output_image = base.File(position=2, argstr='%s', name_source=['op1'],
                             name_template='%s_maths', desc='output image file',
                             keep_extension=True)
    operation = base.Str(mandatory=True, position=3, argstr='%s',
                         desc='operations and intputs')
    op1 = base.File(exists=True, mandatory=True, position=-2, argstr='%s',
                    desc='first operator')
    op2 = traits.Either(base.File(exists=True), base.Str, position=-1,
                        argstr='%s', desc='second operator')
Exemplo n.º 4
0
class ThresholdImageInputSpec(ANTSCommandInputSpec):
    dimension = traits.Int(3,
                           usedefault=True,
                           position=1,
                           argstr='%d',
                           desc='dimension of output image')
    input_image = base.File(exists=True,
                            mandatory=True,
                            position=2,
                            argstr='%s',
                            desc='input image file')
    output_image = base.File(position=3,
                             argstr='%s',
                             name_source=['input_image'],
                             name_template='%s_resampled',
                             desc='output image file',
                             keep_extension=True)

    mode = traits.Enum('Otsu',
                       'Kmeans',
                       argstr='%s',
                       position=4,
                       requires=['num_thresholds'],
                       xor=['th_low', 'th_high'],
                       desc='whether to run Otsu / Kmeans thresholding')
    num_thresholds = traits.Int(position=5,
                                argstr='%d',
                                desc='number of thresholds')
    input_mask = base.File(exists=True,
                           requires=['num_thresholds'],
                           argstr='%s',
                           desc='input mask for Otsu, Kmeans')

    th_low = traits.Float(position=4,
                          argstr='%f',
                          xor=['mode'],
                          desc='lower threshold')
    th_high = traits.Float(position=5,
                           argstr='%f',
                           xor=['mode'],
                           desc='upper threshold')
    inside_value = traits.Float(1,
                                position=6,
                                argstr='%f',
                                requires=['th_low'],
                                desc='inside value')
    outside_value = traits.Float(0,
                                 position=7,
                                 argstr='%f',
                                 requires=['th_low'],
                                 desc='outside value')
Exemplo n.º 5
0
 class spec3(nib.CommandLineInputSpec):
     moo = nib.File(name_source=['doo'],
                    hash_files=False,
                    argstr="%s",
                    position=1,
                    name_template='%s_mootpl')
     poo = nib.File(name_source=['moo'],
                    hash_files=False,
                    argstr="%s",
                    position=2)
     doo = nib.File(name_source=['poo'],
                    hash_files=False,
                    argstr="%s",
                    position=3)
Exemplo n.º 6
0
class _RDFClassifierInputSpec(base.BaseInterfaceInputSpec):
    feature_files = base.traits.List(
        desc='List of feature files. Must be in the correct order!',
        trait=base.File(exists=True),
        mandatory=True)
    classifier_file = base.File(
        desc='Pickled python object containing the RDF classifier to use.',
        mandatory=True,
        exists=True)
    mask_file = base.File(
        desc='Mask file indicating on which voxels to operate',
        mandatory=True,
        exists=True)
    segmentation_file = base.File(desc='the target segmentation file')
    probability_file = base.File(desc='the target probability file')
Exemplo n.º 7
0
class FilterNumsInputSpec(nib.CommandLineInputSpec):
    in_file = nib.File(desc="File",
                       exists=True,
                       mandatory=True,
                       argstr="%s",
                       position=1)
    max_number = nib.traits.Int(desc="Max number",
                                mandatory=True,
                                argstr="'($1<%d)'",
                                position=0)
    out_file = nib.File(desc="Filtered file",
                        name_source=['in_file'],
                        name_template='%s_filtered',
                        hash_files=False,
                        argstr="> %s")
Exemplo n.º 8
0
class _MedpyResampleInputSpec(base.CommandLineInputSpec):
    in_file = base.File(desc='the input image',
                        position=0,
                        exists=True,
                        mandatory=True,
                        argstr='%s')
    out_file = base.File(desc='the output image',
                         position=1,
                         argstr='%s',
                         genfile=True)
    spacing = base.traits.String(
        desc='the desired voxel spacing in colon-separated values, '
        'e.g. 1.2,1.2,5.0',
        position=2,
        mandatory=True,
        argstr='%s')
Exemplo n.º 9
0
class _ResampleImageBySpacingInputSpec(ANTSCommandInputSpec):
    dimension = traits.Int(3,
                           usedefault=True,
                           position=1,
                           argstr="%d",
                           desc="dimension of output image")
    input_image = base.File(exists=True,
                            mandatory=True,
                            position=2,
                            argstr="%s",
                            desc="input image file")
    output_image = base.File(
        position=3,
        argstr="%s",
        name_source=["input_image"],
        name_template="%s_resampled",
        desc="output image file",
        keep_extension=True,
    )
    out_spacing = traits.Either(
        traits.List(traits.Float, minlen=2, maxlen=3),
        traits.Tuple(traits.Float, traits.Float, traits.Float),
        traits.Tuple(traits.Float, traits.Float),
        position=4,
        argstr="%s",
        mandatory=True,
        desc="output spacing",
    )
    apply_smoothing = traits.Bool(False,
                                  argstr="%d",
                                  position=5,
                                  desc="smooth before resampling")
    addvox = traits.Int(
        argstr="%d",
        position=6,
        requires=["apply_smoothing"],
        desc="addvox pads each dimension by addvox",
    )
    nn_interp = traits.Bool(argstr="%d",
                            desc="nn interpolation",
                            position=-1,
                            requires=["addvox"])
Exemplo n.º 10
0
class _ExtractFeatureInputSpec(base.BaseInterfaceInputSpec):
    in_file = base.File(desc='The image to extract the feature from',
                        mandatory=True,
                        exists=True)
    mask_file = base.File(
        desc='Image mask, features are only extracted where mask has 1 values',
        mandatory=True,
        exists=True)
    function = base.traits.Function(
        desc='The function to use for feature extraction',
        mandatory=True,
        nohash=True)
    kwargs = base.traits.DictStrAny(
        desc='A dictionary of keyword arguments that is passed to the feature'
        ' extraction function')
    pass_voxelspacing = base.traits.Bool(
        desc='Whether to pass the in_file`s voxel spacing to the feature '
        'extraction function or not.')
    out_file = base.File(desc='Target file name of the extracted features.',
                         hash_files=False)
Exemplo n.º 11
0
class ResampleImageBySpacingInputSpec(ANTSCommandInputSpec):
    dimension = traits.Int(3, usedefault=True, position=1, argstr='%d',
                           desc='dimension of output image')
    input_image = base.File(exists=True, mandatory=True, position=2, argstr='%s',
                            desc='input image file')
    output_image = base.File(position=3, argstr='%s', name_source=['input_image'],
                             name_template='%s_resampled', desc='output image file',
                             keep_extension=True)
    out_spacing = traits.Either(
        traits.List(traits.Float, minlen=2, maxlen=3),
        traits.Tuple(traits.Float, traits.Float, traits.Float),
        traits.Tuple(traits.Float, traits.Float),
        position=4, argstr='%s', mandatory=True, desc='output spacing'
    )
    apply_smoothing = traits.Bool(False, argstr='%d', position=5,
                                  desc='smooth before resampling')
    addvox = traits.Int(argstr='%d', position=6, requires=['apply_smoothing'],
                        desc='addvox pads each dimension by addvox')
    nn_interp = traits.Bool(argstr='%d', desc='nn interpolation',
                            position=-1, requires=['addvox'])
Exemplo n.º 12
0
class _MedpyIntensityRangeStandardizationInputSpec(base.CommandLineInputSpec):
    in_file = base.File(desc='The image to transform',
                        position=-1,
                        exists=True,
                        mandatory=True,
                        argstr='%s')
    out_dir = base.Directory(
        desc='Save the transformed images under this location.',
        mandatory=True,
        argstr='--save-images %s',
        nohash=True)
    mask_file = base.File(
        desc='A number binary foreground mask. Alternative to supplying a'
        'threshold.',
        exists=True,
        mandatory=True,
        xor=['threshold'],
        argstr='--masks %s')
    threshold = base.traits.Int(
        desc='All voxel with an intensity > threshold are considered as'
        'foreground. Supply either this or a mask for each image.',
        mandatory=True,
        xor=['mask_file'],
        argstr='--threshold %d')
    lmodel = base.traits.File(
        desc='Location of the pickled intensity range model to load. Activated'
        'application mode.',
        exists=True,
        mandatory=True,
        argstr='--load-model %s')
    ignore = base.traits.Bool(
        desc=
        'Ignore possible loss of information during intensity transformation.'
        ' Should only be used when you know what you are doing.',
        argstr='--ignore')
    verbose = base.traits.Bool(desc='Verbose output', argstr='-v')
    debug = base.traits.Bool(desc='Display debug information', argst='-d')
    force = base.traits.Bool(desc='Overwrite existing files', argstr='-f')
Exemplo n.º 13
0
class _ResampleInputSpec(base.CommandLineInputSpec):
    ref_image = base.File(desc='Filename of the reference image',
                          exists=True,
                          mandatory=True,
                          argstr='-ref %s',
                          position=0)
    flo_image = base.File(desc='Filename of the floating image',
                          exists=True,
                          mandatory=True,
                          argstr='-flo %s',
                          position=1)
    # only one option of the following will be taken into account
    in_affine = base.File(
        desc='Filename which contains an affine transformation '
        '(Affine*Reference=floating)',
        exists=True,
        mandatory=True,
        argstr='-aff %s',
        xor=['in_affFlirt', 'in_cpp', 'in_def'])
    in_affFlirt = base.File(
        desc='Filename which contains a radiological flirt affine '
        'transformation',
        exists=True,
        mandatory=True,
        argstr='-affFlirt %s',
        xor=['in_affine', 'in_cpp', 'in_def'])
    in_cpp = base.File(
        desc='Filename of the control point grid image (from reg_f3d)',
        exists=True,
        mandatory=True,
        argstr='-cpp %s',
        xor=['in_affine', 'in_affFlirt', 'in_def'])
    in_def = base.File(
        desc='Filename of the deformation field image (from reg_transform)',
        exists=True,
        mandatory=True,
        argstr='-def %s',
        xor=['in_affine', 'in_affFlirt', 'in_cpp'])
    # output options
    result_file = base.File('outputResult.nii',
                            desc='Filename of the resampled image '
                            '[outputResult.nii]',
                            argstr='-res %s',
                            usedefault=True)
    # others
    interpolation_order = base.traits.Enum(
        '0',
        '1',
        '3',
        '4',
        desc='Interpolation order (0, 1, 3, 4)[3] (0=NN, '
        '1=LIN; 3=CUB, 4=SINC)',
        argstr='-inter %s')
Exemplo n.º 14
0
class _ImageMathInputSpec(ANTSCommandInputSpec):
    dimension = traits.Int(3,
                           usedefault=True,
                           position=1,
                           argstr="%d",
                           desc="dimension of output image")
    output_image = base.File(
        position=2,
        argstr="%s",
        name_source=["op1"],
        name_template="%s_maths",
        desc="output image file",
        keep_extension=True,
    )
    operation = base.Str(mandatory=True,
                         position=3,
                         argstr="%s",
                         desc="operations and intputs")
    op1 = base.File(exists=True,
                    mandatory=True,
                    position=-2,
                    argstr="%s",
                    desc="first operator")
    op2 = traits.Either(
        base.File(exists=True),
        base.Str,
        position=-1,
        argstr="%s",
        desc="second operator",
    )
    copy_header = traits.Bool(
        True,
        usedefault=True,
        desc=
        "copy headers of the original image into the output (corrected) file",
    )
Exemplo n.º 15
0
 class spec3(nib.TraitedSpec):
     moo = nib.File(exists=True, name_source="doo")
     doo = nib.traits.List(nib.File(exists=True))
Exemplo n.º 16
0
 class spec2(nib.TraitedSpec):
     moo = nib.File(exists=True, hash_files=False)
     doo = nib.traits.List(nib.File(exists=True))
Exemplo n.º 17
0
class MRtrix_mul_OutputSpec(TraitedSpec):
    out_file = nibase.File(desc='Multiplication result file')
Exemplo n.º 18
0
class MRtrix_mul_InputSpec(CommandLineInputSpec):
    input1 = nibase.File(desc='Input1 file',position=1,mandatory=True,exists=True,argstr = "%s")
    input2 = nibase.File(desc='Input2 file',position=2,mandatory=True,exists=True,argstr = "%s")
    out_filename = traits.Str(desc='out filename',position=3,mandatory=True,argstr = "%s")
Exemplo n.º 19
0
class DTB_gfaOutputSpec(TraitedSpec):
    out_file = nibase.File(desc='Resulting file')
Exemplo n.º 20
0
class DTB_P0InputSpec(CommandLineInputSpec):
    dsi_basepath = traits.Str(desc='DSI path/basename (e.g. \"data/dsi_\")',position=1,mandatory=True,argstr = "--dsi %s")
    dwi_file = nibase.File(desc='DWI file',position=2,mandatory=True,exists=True,argstr = "--dwi %s")
Exemplo n.º 21
0
 class InputSpec(nib.TraitedSpec):
     foo = nib.traits.Int(desc='a random int')
     goo = nib.traits.Int(desc='a random int', mandatory=True)
     hoo = nib.traits.Int(desc='a random int', usedefault=True)
     zoo = nib.File(desc='a file', copyfile=False)
     woo = nib.File(desc='a file', copyfile=True)
Exemplo n.º 22
0
class ExtendedDespikeOutputSpec(afni.base.AFNICommandOutputSpec):
    spike_file = base.File(desc='spike file', exists=True)
Exemplo n.º 23
0
class ExtendedDespikeInputSpec(afni.preprocess.DespikeInputSpec):
    spike_file = base.File(name_template="%s_despike_SPIKES",
                           desc='spike image file name',
                           argstr='-ssave %s',
                           name_source="in_file")
Exemplo n.º 24
0
class _F3DInputSpec(base.CommandLineInputSpec):
    ref_image = base.File(desc='Filename of the reference image',
                          exists=True,
                          mandatory=True,
                          argstr='-ref %s',
                          position=0)
    flo_image = base.File(desc='Filename of the floating image',
                          exists=True,
                          mandatory=True,
                          argstr='-flo %s',
                          position=1)
    # initial transformation options (only one will be considered)
    in_affine = base.File(
        desc='Filename which contains an affine transformation '
        '(Affine*Reference=Floating)',
        exists=True,
        argstr='-aff %s',
        xor=['in_affFlirt', 'in_cpp'])
    in_affFlirt = base.File(
        desc='Filename which contains a flirt affine transformation (Flirt '
        'from the FSL package)',
        exists=True,
        argstr='-affFlirt %s',
        xor=['in_affine', 'in_cpp'])
    in_cpp = base.File(
        desc='Filename ofl control point grid input. The coarse spacing '
        'is defined by this file.',
        exists=True,
        argstr='-incpp %s',
        xor=['in_affine', 'in_affFlirt'])
    # output options
    cpp_file = base.File(desc='Filename of control point grid [outputCPP.nii]',
                         argstr='-cpp %s')
    result_file = base.File(desc='Filename of the resampled image '
                            '[outputResult.nii]',
                            argstr='-res %s')
    # input image options (incomplete)
    rmask_file = base.File(
        desc='Filename of a mask image in the reference space',
        exists=True,
        argstr='-rmask %s')
    smooth_ref = base.traits.Float(
        desc='Smooth the reference image using the specified sigma (mm) [0]',
        argstr='-smooR %f')
    smooth_flo = base.traits.Float(
        desc='Smooth the floating image using the specified sigma (mm) [0]',
        argstr='-smooF %f')
    # spline options (not yet implemented)
    # objective function options (not yet implemented)
    # optimisation options (not yet implemented)
    # F3D_SYM options
    symmetric = base.traits.Bool(desc='Use symmetric approach', argstr='-sym')
    fmask_file = base.File(desc='Filename of a mask image in the floating '
                           'space. Only used when symmetric turned on',
                           exists=True,
                           argstr='-fmask %s')
    inverse_consistency = base.traits.Float(
        desc='Weight of the inverse consistency penalty term [0.01]',
        argstr='-ic %f')
    # F3D2 options (not yet implemented)
    # other options (incomplete)
    verbose_off = base.traits.Bool(desc='Turn verbose off', argstr='-voff')
Exemplo n.º 25
0
class _F3DOutputSpec(base.TraitedSpec):
    cpp_file = base.File(desc='Filename of control point grid [outputCPP.nii]')
    result_file = base.File(
        desc='Filename of the resampled image [outputResult.nii]')
Exemplo n.º 26
0
 class spec4(nib.TraitedSpec):
     moo = nib.File(exists=True)
     doo = nib.traits.List(nib.File(exists=True))
Exemplo n.º 27
0
 class CommandLineInputSpec2(nib.CommandLineInputSpec):
     foo = nib.File(argstr='%s', desc='a str', genfile=True)
Exemplo n.º 28
0
class _ResampleOutputSpec(base.TraitedSpec):
    result_file = base.File('outputResult.nii',
                            desc='Filename of the resampled image '
                            '[outputResult.nii]')
Exemplo n.º 29
0
class ImageMathOuputSpec(base.TraitedSpec):
    output_image = base.File(exists=True, desc='output image file')
Exemplo n.º 30
0
class _AladinInputSpec(base.CommandLineInputSpec):
    ref_image = base.File(desc='Filename of the reference (target) image',
                          mandatory=True,
                          exists=True,
                          argstr='-ref %s',
                          position=0)
    flo_image = base.File(desc='Filename of the floating (source) image',
                          mandatory=True,
                          exists=True,
                          argstr='-flo %s',
                          position=1)
    symmetric = base.traits.Bool(desc='Use symmetric version of the algorithm',
                                 argstr='-sym')
    affine = base.File(desc='Filename which contains the output affine '
                       'transformation [outputAffine.txt] ',
                       argstr='-aff %s')
    rigid_only = base.traits.Bool(desc='Perform a rigid registration only (r'
                                  'igid+affine by default)',
                                  argstr='-rigOnly')
    affine_direct = base.traits.Bool(desc='Directly optimize 12 DoF affine '
                                     '[default: rigid initially then affine]',
                                     argstr='-affDirect')
    input_affine = base.File(desc='Filename which contains an input affine '
                             'transformation (Affine*Reference=Floating)',
                             exists=True,
                             argstr='-inaff %s')
    input_affine_flirt = base.File(desc='Filename which contains an input '
                                   'affine transformation from Flirt',
                                   exists=True,
                                   argstr='-affFlirt %s')
    rmask_file = base.File(desc='Filename of a mask image in the reference '
                           'space',
                           exists=True,
                           argstr='-rmask %s')
    fmask_file = base.File(desc='Filename of a mask image in the floating '
                           'space. Only used when symmetric turned on',
                           exists=True,
                           argstr='-fmask %s')
    result_file = base.File(desc='Filename of the resampled image '
                            '[outputResult.nii]',
                            argstr='-res %s')
    max_iterations = base.traits.Int(desc='Number of iterations per level [5]',
                                     argstr='maxit %i')
    smooth_ref = base.traits.Float(desc='Smooth the reference image using the '
                                   'specified sigma (mm) [0]',
                                   argstr='-smooR %f')
    smooth_flo = base.traits.Float(desc='Smooth the floating image using the '
                                   'specified sigma (mm) [0]',
                                   argstr='-smooR %f')
    number_levels = base.traits.Int(desc='Number of levels to perform [3]',
                                    argstr='-ln %i')
    perform_levels = base.traits.Int(desc='Only perform the first levels [ln]',
                                     argstr='-lp %i')
    nac = base.traits.Bool(desc='Use the nifti header origins to initialise '
                           'the translation',
                           argstr='-nac')
    block_percentage = base.traits.Int(desc='Percentage of block to use [50]',
                                       argstr='-%%v %i')
    inlier_percentage = base.traits.Int(desc='Percentage of inliers for the '
                                        'LTS [50]',
                                        argstr='-%%i %i')