How to use the nipype.interfaces.base.traits.Int function in nipype

To help you get started, we’ve selected a few nipype examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github poldracklab / mriqc / mriqc / interfaces / functional.py View on Github external
usedefault=True,
        desc="z-score to call one timepoint of one axial slice a spike",
    )
    skip_frames = traits.Int(
        0,
        usedefault=True,
        desc="number of frames to skip in the beginning of the time series",
    )
    out_tsz = File("spikes_tsz.txt", usedefault=True, desc="output file name")
    out_spikes = File("spikes_idx.txt", usedefault=True, desc="output file name")


class SpikesOutputSpec(TraitedSpec):
    out_tsz = File(desc="slice-wise z-scored timeseries (Z x N), inside brainmask")
    out_spikes = File(desc="indices of spikes")
    num_spikes = traits.Int(desc="number of spikes found (total)")


class Spikes(SimpleInterface):

    """
    Computes the number of spikes
    https://github.com/cni/nims/blob/master/nimsproc/qa_report.py

    """

    input_spec = SpikesInputSpec
    output_spec = SpikesOutputSpec

    def _run_interface(self, runtime):
        func_nii = nb.load(self.inputs.in_file)
        func_data = func_nii.get_data()
github nipy / nipype / nipype / interfaces / fsl / model.py View on Github external
tfce = traits.Bool(
        desc='carry out Threshold-Free Cluster Enhancement', argstr='-T')
    tfce2D = traits.Bool(
        desc=('carry out Threshold-Free Cluster Enhancement with 2D '
              'optimisation'),
        argstr='--T2')
    f_only = traits.Bool(desc='calculate f-statistics only', argstr='--f_only')
    raw_stats_imgs = traits.Bool(
        desc='output raw ( unpermuted ) statistic images', argstr='-R')
    p_vec_n_dist_files = traits.Bool(
        desc='output permutation vector and null distribution text files',
        argstr='-P')
    num_perm = traits.Int(
        argstr='-n %d',
        desc='number of permutations (default 5000, set to 0 for exhaustive)')
    seed = traits.Int(
        argstr='--seed=%d',
        desc='specific integer seed for random number generator')
    var_smooth = traits.Int(
        argstr='-v %d', desc='use variance smoothing (std is in mm)')
    c_thresh = traits.Float(
        argstr='-c %.1f', desc='carry out cluster-based thresholding')
    cm_thresh = traits.Float(
        argstr='-C %.1f', desc='carry out cluster-mass-based thresholding')
    f_c_thresh = traits.Float(
        argstr='-F %.2f', desc='carry out f cluster thresholding')
    f_cm_thresh = traits.Float(
        argstr='-S %.2f', desc='carry out f cluster-mass thresholding')
    tfce_H = traits.Float(
        argstr='--tfce_H=%.2f', desc='TFCE height parameter (default=2)')
    tfce_E = traits.Float(
        argstr='--tfce_E=%.2f', desc='TFCE extent parameter (default=0.5)')
github nipy / nipype / nipype / interfaces / slicer / surface.py View on Github external
)
    generateAll = traits.Bool(
        desc="Generate models for all labels in the input volume. select this option if you want to create all models that correspond to all values in a labelmap volume (using the Joint Smoothing option below is useful with this option). Ignores Labels, Start Label, End Label settings. Skips label 0.",
        argstr="--generateAll ",
    )
    labels = InputMultiPath(
        traits.Int,
        desc="A comma separated list of label values from which to make models. f you specify a list of Labels, it will override any start/end label settings. If you click Generate All Models it will override the list of labels and any start/end label settings.",
        sep=",",
        argstr="--labels %s",
    )
    start = traits.Int(
        desc="If you want to specify a continuous range of labels from which to generate models, enter the lower label here. Voxel value from which to start making models. Used instead of the label list to specify a range (make sure the label list is empty or it will over ride this).",
        argstr="--start %d",
    )
    end = traits.Int(
        desc="If you want to specify a continuous range of labels from which to generate models, enter the higher label here. Voxel value up to which to continue making models. Skip any values with zero voxels.",
        argstr="--end %d",
    )
    skipUnNamed = traits.Bool(
        desc="Select this to not generate models from labels that do not have names defined in the color look up table associated with the input label map. If true, only models which have an entry in the color table will be generated.  If false, generate all models that exist within the label range.",
        argstr="--skipUnNamed ",
    )
    jointsmooth = traits.Bool(
        desc="This will ensure that all resulting models fit together smoothly, like jigsaw puzzle pieces. Otherwise the models will be smoothed independently and may overlap.",
        argstr="--jointsmooth ",
    )
    smooth = traits.Int(
        desc="Here you can set the number of smoothing iterations for Laplacian smoothing, or the degree of the polynomial approximating the windowed Sinc function. Use 0 if you wish no smoothing. ",
        argstr="--smooth %d",
    )
    filtertype = traits.Enum(
github nipy / nipype / nipype / interfaces / ants / visualization.py View on Github external
desc=('Possible colormaps: grey, red, green, '
              'blue, copper, jet, hsv, spring, summer, '
              'autumn, winter, hot, cool, overunder, custom '),
        mandatory=True,
        position=4)
    custom_color_map_file = traits.Str(
        'none',
        argstr='%s',
        usedefault=True,
        desc='custom color map file',
        position=5)
    minimum_input = traits.Int(
        argstr='%d', desc='minimum input', mandatory=True, position=6)
    maximum_input = traits.Int(
        argstr='%d', desc='maximum input', mandatory=True, position=7)
    minimum_RGB_output = traits.Int(
        0, usedefault=True, argstr='%d', desc='', position=8)
    maximum_RGB_output = traits.Int(
        255, usedefault=True, argstr='%d', desc='', position=9)


class ConvertScalarImageToRGBOutputSpec(TraitedSpec):
    output_image = File(exists=True, desc='converted RGB image')


class ConvertScalarImageToRGB(ANTSCommand):
    """
    Examples
    --------
    >>> from nipype.interfaces.ants.visualization import ConvertScalarImageToRGB
    >>> converter = ConvertScalarImageToRGB()
    >>> converter.inputs.dimension = 3
github nipy / nipype / nipype / interfaces / afni / preprocess.py View on Github external
desc='output image file name',
        argstr='-prefix %s',
        name_source='in_file')
    brain_file = File(
        name_template='%s_masked',
        desc='output file from 3dAutomask',
        argstr='-apply_prefix %s',
        name_source='in_file')
    clfrac = traits.Float(
        desc='sets the clip level fraction (must be 0.1-0.9). A small value '
             'will tend to make the mask larger [default = 0.5].',
        argstr='-clfrac %s')
    dilate = traits.Int(
        desc='dilate the mask outwards',
        argstr='-dilate %s')
    erode = traits.Int(
        desc='erode the mask inwards',
        argstr='-erode %s')


class AutomaskOutputSpec(TraitedSpec):
    out_file = File(
        desc='mask file',
        exists=True)
    brain_file = File(
        desc='brain file (skull stripped)',
        exists=True)


class Automask(AFNICommand):
    """Create a brain-only mask of the image using AFNI 3dAutomask command
github nipy / nipype / nipype / interfaces / meshfix.py View on Github external
remove_handles = traits.Bool(
        argstr='--remove-handles', desc="Remove handles")

    uniform_remeshing_steps = traits.Int(
        argstr='-u %d',
        requires=['uniform_remeshing_vertices'],
        desc="Number of steps for uniform remeshing of the whole mesh")

    uniform_remeshing_vertices = traits.Int(
        argstr='--vertices %d',
        requires=['uniform_remeshing_steps'],
        desc="Constrains the number of vertices."
        "Must be used with uniform_remeshing_steps")

    laplacian_smoothing_steps = traits.Int(
        argstr='--smooth %d',
        desc="The number of laplacian smoothing steps to apply")

    x_shift = traits.Int(
        argstr='--smooth %d',
        desc=
        "Shifts the coordinates of the vertices when saving. Output must be in FreeSurfer format"
    )

    # Cutting, decoupling, dilation
    cut_outer = traits.Int(
        argstr='--cut-outer %d',
        desc="Remove triangles of 1st that are outside of the 2nd shell.")
    cut_inner = traits.Int(
        argstr='--cut-inner %d',
        desc=
github nipy / nipype / nipype / interfaces / niftyfit / qt1.py View on Github external
)

    # Other options:
    mask = File(
        position=2, exists=True, desc="Filename of image mask.", argstr="-mask %s"
    )
    prior = File(
        position=3, exists=True, desc="Filename of parameter prior.", argstr="-prior %s"
    )
    te_value = traits.Float(desc="TE Echo Time [0ms!].", argstr="-TE %f", position=4)
    tr_value = traits.Float(
        desc="TR Repetition Time [10s!].", argstr="-TR %f", position=5
    )
    desc = "Number of components to fit [1] (currently IR/SR only)"
    # set position to be ahead of TIs
    nb_comp = traits.Int(desc=desc, position=6, argstr="-nc %d")
    desc = "Set LM parameters (initial value, decrease rate) [100,1.2]."
    lm_val = traits.Tuple(
        traits.Float, traits.Float, desc=desc, argstr="-lm %f %f", position=7
    )
    desc = "Use Gauss-Newton algorithm [Levenberg-Marquardt]."
    gn_flag = traits.Bool(desc=desc, argstr="-gn", position=8)
    slice_no = traits.Int(
        desc="Fit to single slice number.", argstr="-slice %d", position=9
    )
    voxel = traits.Tuple(
        traits.Int,
        traits.Int,
        traits.Int,
        desc="Fit to single voxel only.",
        argstr="-voxel %d %d %d",
        position=10,
github nipy / nipype / nipype / interfaces / semtools / segmentation / specialized.py View on Github external
)
    outputMRML = traits.Either(
        traits.Bool,
        File(),
        hash_files=False,
        desc=",               The filename for the new subject-specific scene definition file in the same format produced by Slicer3 (in .mrml format). Only the components that were specified by the user on command line would be generated. Compatible components include inputVolume, outputVolume, outputLandmarksInInputSpace, outputLandmarksInACPCAlignedSpace, and outputTransform.,             ",
        argstr="--outputMRML %s",
    )
    outputVerificationScript = traits.Either(
        traits.Bool,
        File(),
        hash_files=False,
        desc=",               The filename for the Slicer3 script that verifies the aligned landmarks against the aligned image file.  This will happen only in conjunction with saveOutputLandmarks and an outputVolume.,             ",
        argstr="--outputVerificationScript %s",
    )
    mspQualityLevel = traits.Int(
        desc=",                 Flag cotrols how agressive the MSP is estimated. 0=quick estimate (9 seconds), 1=normal estimate (11 seconds), 2=great estimate (22 seconds), 3=best estimate (58 seconds), NOTE: -1= Prealigned so no estimate!.,             ",
        argstr="--mspQualityLevel %d",
    )
    otsuPercentileThreshold = traits.Float(
        desc=",                 This is a parameter to FindLargestForegroundFilledMask, which is employed when acLowerBound is set and an outputUntransformedClippedVolume is requested.,             ",
        argstr="--otsuPercentileThreshold %f",
    )
    acLowerBound = traits.Float(
        desc=",                 When generating a resampled output image, replace the image with the BackgroundFillValue everywhere below the plane This Far in physical units (millimeters) below (inferior to) the AC point (as found by the model.)  The oversize default was chosen to have no effect.  Based on visualizing a thousand masks in the IPIG study, we recommend a limit no smaller than 80.0 mm.,             ",
        argstr="--acLowerBound %f",
    )
    cutOutHeadInOutputVolume = traits.Bool(
        desc=",                 Flag to cut out just the head tissue when producing an (un)transformed clipped volume.,             ",
        argstr="--cutOutHeadInOutputVolume ",
    )
    outputUntransformedClippedVolume = traits.Either(
github nipy / nipype / nipype / interfaces / minc / minc.py View on Github external
traits.Int,
        traits.Int,
        traits.Int,
        desc='Number of elements along each dimension (X, Y, Z).',
        argstr='-nelements %s %s %s',
        xor=_xor_nelements)

    # FIXME Is mincresample happy if we only specify one of these, or do we
    # need the requires=...?
    xnelements = traits.Int(
        desc='Number of elements along the X dimension.',
        argstr='-xnelements %s',
        requires=('ynelements', 'znelements'),
        xor=_xor_nelements)

    ynelements = traits.Int(
        desc='Number of elements along the Y dimension.',
        argstr='-ynelements %s',
        requires=('xnelements', 'znelements'),
        xor=_xor_nelements)

    znelements = traits.Int(
        desc='Number of elements along the Z dimension.',
        argstr='-znelements %s',
        requires=('xnelements', 'ynelements'),
        xor=_xor_nelements)

    # step size along each dimension
    _xor_step = ('step', 'step_x_y_or_z')

    step = traits.Tuple(
        traits.Int,
github nipy / nipype / nipype / interfaces / afni / utils.py View on Github external
out_file = File(
        argstr='-prefix %s', name_source='in_file', name_template='%s_autobox')
    no_clustering = traits.Bool(
        argstr='-noclust',
        desc='Don\'t do any clustering to find box. Any non-zero voxel will '
        'be preserved in the cropped volume. The default method uses '
        'some clustering to find the cropping box, and will clip off '
        'small isolated blobs.')


class AutoboxOutputSpec(TraitedSpec):  # out_file not mandatory
    x_min = traits.Int()
    x_max = traits.Int()
    y_min = traits.Int()
    y_max = traits.Int()
    z_min = traits.Int()
    z_max = traits.Int()

    out_file = File(desc='output file')


class Autobox(AFNICommand):
    """Computes size of a box that fits around the volume.
    Also can be used to crop the volume to that box.

    For complete details, see the `3dAutobox Documentation.
    `_

    Examples
    ========

    >>> from nipype.interfaces import afni