How to use the nipype.interfaces.base.traits.Bool 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 nipy / nipype / nipype / interfaces / slicer / gtractTensor.py View on Github external
from nipype.interfaces.base import CommandLine, CommandLineInputSpec, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath
import os
from nipype.interfaces.slicer.base import SlicerCommandLine


class gtractTensorInputSpec(CommandLineInputSpec):
    inputVolume = File(desc="Required: input image 4D NRRD image. Must contain data based on at least 6 distinct diffusion directions. The inputVolume is allowed to have multiple b0 and gradient direction images. Averaging of the b0 image is done internally in this step. Prior averaging of the DWIs is not required.", exists=True, argstr="--inputVolume %s")
    outputVolume = traits.Either(traits.Bool, File(), hash_files=False, desc="Required: name of output NRRD file containing the Tensor vector image", argstr="--outputVolume %s")
    medianFilterSize = InputMultiPath(traits.Int, desc="Median filter radius in all 3 directions", sep=",", argstr="--medianFilterSize %s")
    maskProcessingMode = traits.Enum("NOMASK", "ROIAUTO", "ROI", desc="ROIAUTO:  mask is implicitly defined using a otsu forground and hole filling algorithm. ROI: Uses the masks to define what parts of the image should be used for computing the transform. NOMASK: no mask used", argstr="--maskProcessingMode %s")
    maskVolume = File(desc="Mask Image, if maskProcessingMode is ROI", exists=True, argstr="--maskVolume %s")
    backgroundSuppressingThreshold = traits.Int(desc="Image threshold to suppress background. This sets a threshold used on the b0 image to remove background voxels from processing. Typically, values of 100 and 500 work well for Siemens and GE DTI data, respectively. Check your data particularly in the globus pallidus to make sure the brain tissue is not being eliminated with this threshold.", argstr="--backgroundSuppressingThreshold %d")
    resampleIsotropic = traits.Bool(desc="Flag to resample to isotropic voxels. Enabling this feature is recommended if fiber tracking will be performed.", argstr="--resampleIsotropic ")
    size = traits.Float(desc="Isotropic voxel size to resample to", argstr="--size %f")
    b0Index = traits.Int(desc="Index in input vector index to extract", argstr="--b0Index %d")
    applyMeasurementFrame = traits.Bool(desc="Flag to apply the measurement frame to the gradient directions", argstr="--applyMeasurementFrame ")
    ignoreIndex = InputMultiPath(traits.Int, desc="Ignore diffusion gradient index. Used to remove specific gradient directions with artifacts.", sep=",", argstr="--ignoreIndex %s")
    numberOfThreads = traits.Int(desc="Explicitly specify the maximum number of threads to use.", argstr="--numberOfThreads %d")


class gtractTensorOutputSpec(TraitedSpec):
    outputVolume = File(desc="Required: name of output NRRD file containing the Tensor vector image", exists=True)


class gtractTensor(SlicerCommandLine):
    """title: Tensor Estimation

category: Diffusion.GTRACT

description: This step will convert a b-value averaged diffusion tensor image to a 3x3 tensor voxel image. This step takes the diffusion tensor image data and generates a tensor representation of the data based on the signal intensity decay, b values applied, and the diffusion difrections. The apparent diffusion coefficient for a given orientation is computed on a pixel-by-pixel basis by fitting the image data (voxel intensities) to the Stejskal-Tanner equation. If at least 6 diffusion directions are used, then the diffusion tensor can be computed. This program uses itk::DiffusionTensor3DReconstructionImageFilter. The user can adjust background threshold, median filter, and isotropic resampling.

version: 4.0.0
github nipy / nipype / nipype / interfaces / afni / model.py View on Github external
argstr='-jobs %d',
        nohash=True)
    fout = traits.Bool(
        desc='output F-statistic for each stimulus', argstr='-fout')
    rout = traits.Bool(
        desc='output the R^2 statistic for each stimulus', argstr='-rout')
    tout = traits.Bool(
        desc='output the T-statistic for each stimulus', argstr='-tout')
    vout = traits.Bool(
        desc='output the sample variance (MSE) for each stimulus',
        argstr='-vout')
    nofdr = traits.Bool(
        desc="Don't compute the statistic-vs-FDR curves for the bucket "
             "dataset.",
        argstr='-noFDR')
    global_times = traits.Bool(
        desc='use global timing for stimulus timing files',
        argstr='-global_times',
        xor=['local_times'])
    local_times = traits.Bool(
        desc='use local timing for stimulus timing files',
        argstr='-local_times',
        xor=['global_times'])
    num_stimts = traits.Int(
        desc='number of stimulus timing files',
        argstr='-num_stimts %d',
        position=-6)
    stim_times = traits.List(
        traits.Tuple(
            traits.Int(desc='k-th response model'),
            File(desc='stimulus timing file', exists=True),
            Str(desc='model')),
github nipy / nipype / nipype / interfaces / minc / minc.py View on Github external
mandatory=True,
        argstr='%s',
        position=-2,
    )

    output_file_base = File(desc='output file base', argstr='%s', position=-1)

    clobber = traits.Bool(
        desc='Overwrite existing file.',
        argstr='-clobber',
        usedefault=True,
        default_value=True)

    _xor_kernel = ('gaussian', 'rect')

    gaussian = traits.Bool(
        desc='Use a gaussian smoothing kernel (default).',
        argstr='-gaussian',
        xor=_xor_kernel)
    rect = traits.Bool(
        desc='Use a rect (box) smoothing kernel.',
        argstr='-rect',
        xor=_xor_kernel)

    gradient = traits.Bool(
        desc='Create the gradient magnitude volume as well.',
        argstr='-gradient')
    partial = traits.Bool(
        desc=
        'Create the partial derivative and gradient magnitude volumes as well.',
        argstr='-partial')
github nipy / nipype / nipype / interfaces / workbench / cifti.py View on Github external
position=9,
        argstr="-cerebellum-surface %s",
        desc="specify the cerebellum surface to use")
    cerebellum_corrected_areas = File(
        exists=True,
        position=10,
        requires=["cerebellum_surf"],
        argstr="cerebellum-corrected-areas %s",
        desc="vertex areas (as a metric) to use instead of computing them from "
             "the cerebellum surface")
    cifti_roi = File(
        exists=True,
        position=11,
        argstr="-cifti-roi %s",
        desc="CIFTI file for ROI smoothing")
    fix_zeros_vol = traits.Bool(
        position=12,
        argstr="-fix-zeros-volume",
        desc="treat values of zero in the volume as missing data")
    fix_zeros_surf = traits.Bool(
        position=13,
        argstr="-fix-zeros-surface",
        desc="treat values of zero on the surface as missing data")
    merged_volume = traits.Bool(
        position=14,
        argstr="-merged-volume",
        desc="smooth across subcortical structure boundaries")


class CiftiSmoothOutputSpec(TraitedSpec):
    out_file = File(exists=True, desc="output CIFTI file")
github nipy / nipype / nipype / interfaces / freesurfer / model.py View on Github external
desc='Save average waveform into file (bool or filename)')
    avgwf_file = traits.Either(
        traits.Bool,
        File,
        argstr='--avgwfvol %s',
        desc='Save as binary volume (bool or filename)')
    sf_avg_file = traits.Either(
        traits.Bool,
        File,
        argstr='--sfavg %s',
        desc='Save mean across space and time')
    vox = traits.List(
        traits.Int,
        argstr='--vox %s',
        desc='Replace seg with all 0s except at C R S (three int inputs)')
    supratent = traits.Bool(
        argstr="--supratent", desc="Undocumented input flag")
    subcort_gm = traits.Bool(
        argstr="--subcortgray",
        desc="Compute volume of subcortical gray matter")
    total_gray = traits.Bool(
        argstr="--totalgray", desc="Compute volume of total gray matter")
    euler = traits.Bool(
        argstr="--euler",
        desc=
        "Write out number of defect holes in orig.nofix based on the euler number"
    )
    in_intensity = File(
        argstr="--in %s --in-intensity-name %s",
        desc="Undocumented input norm.mgz file")
    intensity_units = traits.Enum(
        'MR',
github nipy / nipype / nipype / interfaces / slicer / filtering / resamplescalarvectordwivolume.py View on Github external
"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",
github APPIAN-PET / APPIAN / Extra / mincants.py View on Github external
'CosineWindowedSinc',
			'WelchWindowedSinc',
			'HammingWindowedSinc',
			'LanczosWindowedSinc',
			'BSpline',
			'MultiLabel',
			'Gaussian',
			argstr='%s',
			usedefault=True)
	interpolation_parameters = traits.Either(
			traits.Tuple(traits.Int()),  # BSpline (order)
			traits.Tuple(
				traits.Float(),  # Gaussian/MultiLabel (sigma, alpha)
				traits.Float()))

	write_composite_transform = traits.Bool(
					argstr='--write-composite-transform %d',
					default_value=False,
					usedefault=True,
					desc='')
	collapse_output_transforms = traits.Bool(
					argstr='--collapse-output-transforms %d',
					default_value=True,
					usedefault=True,  # This should be true for explicit completeness
					desc=('Collapse output transforms. Specifically, enabling this option '
						'combines all adjacent linear transforms and composes all '
						'adjacent displacement field transforms before writing the '
						'results to disk.'))
	
	
	initialize_transforms_per_stage = traits.Bool(
							argstr='--initialize-transforms-per-stage %d',
github nipy / nipype / nipype / interfaces / minc / minc.py View on Github external
'format_double',
        'format_signed',
        'format_unsigned',
    )

    format_filetype = traits.Bool(
        desc='Use data type of first file (default).',
        argstr='-filetype',
        xor=_xor_format)
    format_byte = traits.Bool(
        desc='Write out byte data.', argstr='-byte', xor=_xor_format)
    format_short = traits.Bool(
        desc='Write out short integer data.', argstr='-short', xor=_xor_format)
    format_int = traits.Bool(
        desc='Write out 32-bit integer data.', argstr='-int', xor=_xor_format)
    format_long = traits.Bool(
        desc='Superseded by -int.', argstr='-long', xor=_xor_format)
    format_float = traits.Bool(
        desc='Write out single-precision floating-point data.',
        argstr='-float',
        xor=_xor_format)
    format_double = traits.Bool(
        desc='Write out double-precision floating-point data.',
        argstr='-double',
        xor=_xor_format)
    format_signed = traits.Bool(
        desc='Write signed integer data.', argstr='-signed', xor=_xor_format)
    format_unsigned = traits.Bool(
        desc='Write unsigned integer data (default).',
        argstr='-unsigned',
        xor=_xor_format)
github nipy / nipype / nipype / interfaces / minc / minc.py View on Github external
argstr='-range %s %s',
        desc=
        'Valid range for output data. Default value: -1.79769e+308 -1.79769e+308.'
    )

    _xor_slices = ('transverse', 'sagittal', 'coronal')

    transverse_slices = traits.Bool(
        desc='Write out transverse slices.',
        argstr='-transverse',
        xor=_xor_slices)

    sagittal_slices = traits.Bool(
        desc='Write out sagittal slices', argstr='-sagittal', xor=_xor_slices)

    coronal_slices = traits.Bool(
        desc='Write out coronal slices', argstr='-coronal', xor=_xor_slices)

    _xor_fill = ('nofill', 'fill')

    no_fill = traits.Bool(
        desc='Use value zero for points outside of input volume.',
        argstr='-nofill',
        xor=_xor_fill)
    fill = traits.Bool(
        desc='Use a fill value for points outside of input volume.',
        argstr='-fill',
        xor=_xor_fill)

    fill_value = traits.Float(
        desc=('Specify a fill value for points outside of input volume.'
              'Default value: 1.79769e+308.'),
github nipy / nipype / nipype / interfaces / fsl / utils.py View on Github external
exists=True,
        mandatory=True,
        argstr="%s",
        position=0,
        desc="source image")
    dest_file = File(
        exists=True,
        mandatory=True,
        argstr="%s",
        position=1,
        desc="destination image",
        copyfile=True,
        output_name='out_file',
        name_source='dest_file',
        name_template='%s')
    ignore_dims = traits.Bool(
        desc='Do not copy image dimensions', argstr='-d', position="-1")


class CopyGeomOutputSpec(TraitedSpec):
    out_file = File(exists=True, desc="image with new geometry header")


class CopyGeom(FSLCommand):
    """Use fslcpgeom to copy the header geometry information to another image.
    Copy certain parts of the header information (image dimensions, voxel
    dimensions, voxel dimensions units string, image orientation/origin or
    qform/sform info) from one image to another. Note that only copies from
    Analyze to Analyze or Nifti to Nifti will work properly. Copying from
    different files will result in loss of information or potentially incorrect
    settings.
    """