Example #1
0
class PETPVCInputSpec(CommandLineInputSpec):
    in_file = File(desc="PET image file",
                   exists=True,
                   mandatory=True,
                   argstr="-i %s")
    out_file = File(desc="Output file",
                    genfile=True,
                    hash_files=False,
                    argstr="-o %s")
    mask_file = File(desc="Mask image file",
                     exists=True,
                     mandatory=True,
                     argstr="-m %s")
    pvc = traits.Enum(pvc_methods,
                      desc="Desired PVC method",
                      mandatory=True,
                      argstr="-p %s")
    fwhm_x = traits.Float(
        desc="The full-width at half maximum in mm along x-axis",
        mandatory=True,
        argstr="-x %.4f")
    fwhm_y = traits.Float(
        desc="The full-width at half maximum in mm along y-axis",
        mandatory=True,
        argstr="-y %.4f")
    fwhm_z = traits.Float(
        desc="The full-width at half maximum in mm along z-axis",
        mandatory=True,
        argstr="-z %.4f")
    debug = traits.Bool(desc="Prints debug information",
                        usedefault=True,
                        default_value=False,
                        argstr="-d")
    n_iter = traits.Int(desc="Number of iterations",
                        default_value=10,
                        argstr="-n %d")
    n_deconv = traits.Int(desc="Number of deconvolution iterations",
                          default_value=10,
                          argstr="-k %d")
    alpha = traits.Float(desc="Alpha value",
                         default_value=1.5,
                         argstr="-a %.4f")
    stop_crit = traits.Float(desc="Stopping criterion",
                             default_value=0.01,
                             argstr="-a %.4f")
Example #2
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")
Example #3
0
class TestMathInputSpec(TraitedSpec):

    x = traits.Either(traits.Float(),
                      traits.File(exists=True),
                      traits.List(traits.Float),
                      traits.List(traits.File(exists=True)),
                      desc='first arg')
    y = traits.Either(traits.Float(),
                      traits.File(exists=True),
                      mandatory=False,
                      desc='second arg')
    op = traits.Str(mandatory=True, desc='operation')

    z = traits.File(genfile=True, mandatory=False, desc="Name for output file")

    as_file = traits.Bool(False,
                          desc="Whether to write as a file",
                          usedefault=True)
Example #4
0
class ScanDiagnosisInputSpec(BaseInterfaceInputSpec):
    file_dict = traits.Dict(
        desc="A dictionary regrouping the all required accompanying files.")
    mask_file_dict = traits.Dict(
        desc="A dictionary regrouping the all required accompanying files.")
    prior_bold_idx = traits.List(
        desc="The index for the ICA components that correspond to bold sources."
    )
    prior_confound_idx = traits.List(
        desc=
        "The index for the ICA components that correspond to confounding sources."
    )
    dual_convergence = traits.Int(
        desc="number of components to compute from dual convergence.")
    DSURQE_regions = traits.Bool(
        desc=
        "Whether to use the regional masks generated from the DSURQE atlas for the grayplots outputs. Requires using the DSURQE template for preprocessing."
    )
Example #5
0
class coreg_qc_metricsInput(BaseInterfaceInputSpec):
    pet = traits.File(exists=True, mandatory=True, desc="Input PET image")
    t1 = traits.File(exists=True, mandatory=True, desc="Input T1 MRI")
    brain_mask_space_mri = traits.File(exists=True,
                                       mandatory=True,
                                       desc="Input T1 MRI")
    pet_brain_mask = traits.File(exists=True,
                                 mandatory=True,
                                 desc="Input T1 MRI")
    sid = traits.Str(desc="Subject")
    ses = traits.Str(desc="Session")
    task = traits.Str(desc="Task")
    run = traits.Str(desc="Run")
    rec = traits.Str(desc="Reconstruction")
    acq = traits.Str(desc="Acquisition")
    study_prefix = traits.Str(desc="Study Prefix")
    out_file = traits.File(desc="Output file")
    clobber = traits.Bool(desc="Overwrite output file", default=False)
Example #6
0
class EddyInputSpec( FSLCommandInputSpec ):
    in_file =  File(exists=True, mandatory=True, desc='File containing all the images to estimate distortions for', argstr='--imain=%s' )
    in_mask =  File(exists=True, mandatory=True, desc='Mask to indicate brain', argstr='--mask=%s' )
    in_index = File(exists=True, mandatory=True, desc='File containing indices for all volumes in --imain into --acqp and --topup', argstr='--index=%s' )
    in_acqp =  File(exists=True, mandatory=True, desc='File containing acquisition parameters', argstr='--acqp=%s' )
    in_bvec =  File(exists=True, mandatory=True, desc='File containing the b-vectors for all volumes in --imain', argstr='--bvecs=%s' )
    in_bval =  File(exists=True, mandatory=True, desc='File containing the b-values for all volumes in --imain', argstr='--bvals=%s' )

    out_base = File( desc='basename for output (warped) image', argstr='--out=%s' )


    session =  File(exists=True, desc='File containing session indices for all volumes in --imain', argstr='--session=%s' )
    in_topup =  File(exists=True, desc='Base name for output files from topup', argstr='--topup=%s' )
    flm =  traits.Enum( ('linear','quadratic','cubic'), desc='First level EC model', argstr='--flm=%s' )
    fwhm = traits.Float( desc='FWHM for conditioning filter when estimating the parameters', argstr='--fwhm=%s' )
    niter = traits.Int( 5, desc='Number of iterations', argstr='--niter=%s' )
    method = traits.Enum( ('jac','lsr'), argstr='--resamp=%s', desc='Final resampling method (jacobian/least squeares)' )
    repol = traits.Bool( False, desc='Detect and replace outlier slices', argstr='--repol' )
Example #7
0
class DTIimportInputSpec(CommandLineInputSpec):
    inputFile = File(position=-2,
                     desc="Input DTI file",
                     exists=True,
                     argstr="%s")
    outputTensor = traits.Either(
        traits.Bool,
        File(),
        position=-1,
        hash_files=False,
        desc="Output DTI volume",
        argstr="%s",
    )
    testingmode = traits.Bool(
        desc=
        "Enable testing mode. Sample helix file (helix-DTI.nhdr) will be loaded into Slicer and converted in Nifti.",
        argstr="--testingmode ",
    )
Example #8
0
class ZSpecInputSpec(QI.InputSpec):
    # Input nifti
    in_file = File(exists=True,
                   argstr='%s',
                   mandatory=True,
                   position=-1,
                   desc='Input file')
    # Options
    f0_map = File(desc='Fieldmap (in same units as frequencies)',
                  argstr='--f0=%s')
    ref = File(desc='Reference image for image output', argstr='--ref=%s')
    asym = traits.Bool(
        desc='Output MT-asymmetry spectrum instead of Z-spectrum',
        argstr='--asym')
    order = traits.Int(desc='Interpolation order (default 3)',
                       argstr='--order=%d')
    out_file = traits.String(desc='Output filename (default is input_interp)',
                             argstr='--out=%s')
Example #9
0
class DWIPreProcInputSpec(MRTrix3BaseInputSpec):
    in_file = File(exists=True,
                   argstr="%s",
                   mandatory=True,
                   position=-2,
                   desc="input dwi image")
    out_file = File(argstr="%s",
                    mandatory=True,
                    position=-1,
                    desc="output image")
    use_header = traits.Bool(
        argstr="-rpe_header",
        mandatory=True,
        desc="Phase-encoding information can be found in the image header",
    )
    se_epi_file = File(exists=True,
                       argstr="-se_epi %s",
                       desc="Spin Echo EPI image")
Example #10
0
class MathsInput(FSLCommandInputSpec):
    in_file = File(position=2, argstr="%s", exists=True, mandatory=True,
                   desc="image to operate on")

    out_file = File(genfile=True, position=-2, argstr="%s",
                    desc="image to write", hash_files=False)

    _dtypes = ["float", "char", "int", "short", "double", "input"]

    internal_datatype = traits.Enum(*_dtypes, position=1, argstr="-dt %s",
                                    desc="datatype to use for calculations (default is float)")

    output_datatype = traits.Enum(*_dtypes,
                                  position=-1, argstr="-odt %s",
                                  desc="datatype to use for output (default uses input type)")

    nan2zeros = traits.Bool(position=3, argstr='-nan',
                            desc='change NaNs to zeros before doing anything')
Example #11
0
class SQLiteGrabberInputSpec(DynamicTraitedSpec, BaseInterfaceInputSpec):
    """
    This class represents a...
    :param DynamicTraitedSpec:
    :param BaseInterfaceInputSpec:
    """
    database_file = File(exists=True, mandatory=True)
    table_name = traits.Str(mandatory=True)
    columns = traits.List(traits.Str, mandatory=True)
    constraints = traits.List(
        traits.Tuple(traits.Str,
                     traits.Either(traits.Str, traits.List(traits.Str))),
        minlen=1,
        desc="The list of column/value pairs for WHERE creation")
    distinct = traits.Bool(default=False, usedefault=True)
    orderby = traits.List(
        traits.Tuple(traits.Str, traits.Enum(('ASC', 'DESC'))),
        desc='List of tuples with column and order direction')
Example #12
0
class ROIGenInputSpec(BaseInterfaceInputSpec):
    aparc_aseg_file = File(exists=True,
                           mandatory=True,
                           desc='Freesurfer aparc+aseg file')
    LUT_file = File(exists=True,
                    xor=['use_freesurfer_LUT'],
                    desc='Custom lookup table (cf. FreeSurferColorLUT.txt)')
    use_freesurfer_LUT = traits.Bool(
        xor=['LUT_file'],
        desc=
        'Boolean value; Set to True to use default Freesurfer LUT, False for custom LUT'
    )
    freesurfer_dir = Directory(requires=['use_freesurfer_LUT'],
                               desc='Freesurfer main directory')
    out_roi_file = File(
        genfile=True, desc='Region of Interest file for connectivity mapping')
    out_dict_file = File(genfile=True,
                         desc='Label dictionary saved in Pickle format')
Example #13
0
class ComputeModuleMatPropInputSpec(BaseInterfaceInputSpec):

    rada_lol_file = File(
        exists=True,
        desc='lol file, describing modular structure of the network',
        mandatory=True)

    Pajek_net_file = File(exists=True,
                          desc='net description in Pajek format',
                          mandatory=True)

    group_conmat_file = File(exists=True,
                             desc='list of several full matrix in npy format',
                             mandatory=True)

    export_excel = traits.Bool(False,
                               desc="export data as xls (as well as csv)",
                               usedefault=True)
Example #14
0
class ProbMapInputSpec(ImageGridReportletInputSpec):
    name = traits.Str(mandatory=True, desc='Name of image')
    image = traits.Either(File(exists=True, mandatory=True, desc='Image file'),
                          None)
    probmapimage = traits.Either(
        File(exists=True, mandatory=True, desc='Probability map'), None)
    slice_to_probmap = traits.Bool(False,
                                   usedefault=True,
                                   desc='If true, calculated slices based on '
                                   'non zero extent of labelimage')
    max_intensity_fraction = traits.Float(
        0.99,
        usedefault=True,
        desc="""The intensity display range is 0, max where max is calculated as:
        ``vals = np.sort(niimg.get_fdata()).ravel()``
        ``vals = vals[vals > 0]``
        ``max = vals[int(len(vals) * max_intensity_fraction)]``
        """)
Example #15
0
class ImageLabelCombineInputSpec(CommandLineInputSpec):
    InputLabelMap_A = File(position=-3,
                           desc="Label map image",
                           exists=True,
                           argstr="%s")
    InputLabelMap_B = File(position=-2,
                           desc="Label map image",
                           exists=True,
                           argstr="%s")
    OutputLabelMap = traits.Either(traits.Bool,
                                   File(),
                                   position=-1,
                                   hash_files=False,
                                   desc="Resulting Label map image",
                                   argstr="%s")
    first_overwrites = traits.Bool(
        desc="Use first or second label when both are present",
        argstr="--first_overwrites ")
Example #16
0
class HausdorffDistanceInputSpec(CommandLineInputSpec):
    surface1 = File(exists=True,
                    argstr='-r %s',
                    mandatory=True,
                    desc=('reference surface'))
    surface2 = File(exists=True,
                    argstr='-t %s',
                    mandatory=True,
                    desc=('reference surface'))
    cells_mode = traits.Bool(False,
                             argstr='-C',
                             desc='Use point-to-cells mode')
    out_ref = File('hdist_ref.vtk',
                   usedefault=True,
                   desc='Output reference file name')
    out_tst = File('hdist_ref.vtk',
                   usedefault=True,
                   desc='Output reference file name')
class EddyInputSpec(FSLCommandInputSpec):
    in_file = File(
        exists=True,
        desc='File containing all the images to estimate distortions for',
        argstr='--imain=%s',
        position=0,
        mandatory=True)
    mask = File(exists=True,
                desc='Mask to indicate brain',
                argstr='--mask=%s',
                position=1,
                mandatory=True)
    index = File(
        exists=True,
        desc=
        'File containing indices for all volumes in --imain into --acqp and --topup',
        argstr='--index=%s',
        position=2,
        mandatory=True)
    acqp = File(exists=True,
                desc='File containing acquisition parameters',
                argstr='--acqp=%s',
                position=3,
                mandatory=True)
    bvecs = File(
        exists=True,
        desc='File containing the b-vectors for all volumes in --imain',
        argstr='--bvecs=%s',
        position=4,
        mandatory=True)
    bvals = File(
        exists=True,
        desc='File containing the b-values for all volumes in --imain',
        argstr='--bvals=%s',
        position=5,
        mandatory=True)
    out_file = File(desc='Basename for output',
                    argstr='--out=%s',
                    position=6,
                    genfile=True,
                    hash_files=False)
    verbose = traits.Bool(argstr='--verbose',
                          position=7,
                          desc="Display debugging messages.")
Example #18
0
class NiiWranglerInputSpec(BaseInterfaceInputSpec):
    nii_files = InputMultiPath(
            traits.Either(traits.List(File(exists=True)),File(exists=True)),
            mandatory=True,
            desc="a list of nifti files to be categorized, matched up, etc.",
            copyfile=False)
    series_map = traits.Dict(
            key_trait=traits.Str(),
            value_trait=traits.List(),
            value = {},
            mandatory=False,
            usedefault=True,
            desc="keys are any member of SCAN_TYPES, values are lists of series\
                  descriptions as recorded in DICOM headers.")
    dicom_info = traits.List(
            mandatory=True,
            desc="one dict for each series in the session, in the order they were\
                  run. each dict should contain at least the series_num (int) and\
                  the series_desc (str).")
    ep_echo_spacing = traits.Either(traits.Enum("NONE"), traits.Float(),
            desc="""
            The effective echo spacing of your BOLD images. Already accounts
            for whether or not iPAT (acceleration in the phase direction) was
            used. If you're using acceleration, then the EES is not going to
            match the 'Echo Spacing' that Siemen's reports in the console.

            Setting this value will prevent any attempt to derive it.""")
    ep_unwarp_dir = traits.Enum("x", "x-", "-x", "y", "y-", "-y", "z", "z-", "-z",
            desc="Setting this value will prevent any attempt to derive it.")
    block_struct_averaging = traits.Bool(False,
            mandatory=False, usedefault=True,
            desc="""
            Causes us to only use the first t1 and t2 images. A kludge for
            some data that fails during structural averaging.""")
    ep_fieldmap_selection = traits.Enum("first","most_recent",
            mandatory=False, usedefault=True,
            desc="""
            If you have more than one set of ep fieldmaps, then you can either
            use the first set during preprocessing of all bold images
            ('first'), or you can select the se fieldmap set that was taken
            most recently prior to acquisition of a given bold image, or -
            failing that - the first available se fieldmap thereafter
            ('most_recent')."""
            )
Example #19
0
class FunctionalSummaryInputSpec(BaseInterfaceInputSpec):
    slice_timing = traits.Enum(False,
                               True,
                               'TooShort',
                               usedefault=True,
                               desc='Slice timing correction used')
    distortion_correction = traits.Str(
        desc='Susceptibility distortion correction method', mandatory=True)
    pe_direction = traits.Enum(None,
                               'i',
                               'i-',
                               'j',
                               'j-',
                               'k',
                               'k-',
                               mandatory=True,
                               desc='Phase-encoding direction detected')
    registration = traits.Enum(
        'FSL',
        'FreeSurfer',
        mandatory=True,
        desc='Functional/anatomical registration method')
    fallback = traits.Bool(desc='Boundary-based registration rejected')
    registration_dof = traits.Enum(6,
                                   9,
                                   12,
                                   desc='Registration degrees of freedom',
                                   mandatory=True)
    registration_init = traits.Enum(
        'register',
        'header',
        mandatory=True,
        desc='Whether to initialize registration with the "header"'
        ' or by centering the volumes ("register")')
    confounds_file = File(exists=True, desc='Confounds file')
    tr = traits.Float(desc='Repetition time', mandatory=True)
    dummy_scans = traits.Either(traits.Int(),
                                None,
                                desc='number of dummy scans specified by user')
    algo_dummy_scans = traits.Int(
        desc='number of dummy scans determined by algorithm')
    echo_idx = traits.List([], usedefault=True, desc="BIDS echo identifiers")
    orientation = traits.Str(mandatory=True,
                             desc='Orientation of the voxel axes')
Example #20
0
class ModelMakerInputSpec(CommandLineInputSpec):
    InputVolume = File(argstr="%s", desc="Input label map. The Input Volume drop down menu is populated with the label map volumes that are present in the scene, select one from which to generate models.", position=-1, exists=True)
    color = File(argstr="--color %s", desc="Color table to make labels to colors and objects", exists=True)
    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, and their colors are set by the color table associated with the input label map volume. The model hierarchy node must be created before running the model maker, by selecting Create New ModelHierarchy from the Models drop down menu. If you're running from the command line, a model hierarchy node in a new mrml scene will be created for you.", hash_files=False)
    name = traits.Str(argstr="--name %s", desc="Name to use for this model. Any text entered in the entry box will be the starting string for the created model file names. The label number and the color name will also be part of the file name. If making multiple models, use this as a prefix to the label and color name.")
    generateAll = traits.Bool(argstr="--generateAll ", 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.")
    labels = InputMultiPath(traits.Int, argstr="--labels %s", 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=",")
    start = traits.Int(argstr="--start %d", 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).")
    end = traits.Int(argstr="--end %d", 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.")
    skipUnNamed = traits.Bool(argstr="--skipUnNamed ", 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.")
    jointsmooth = traits.Bool(argstr="--jointsmooth ", 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.")
    smooth = traits.Int(argstr="--smooth %d", 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. ")
    filtertype = traits.Enum("Sinc", "Laplacian", argstr="--filtertype %s", desc="You can control the type of smoothing done on the models by selecting a filter type of either Sinc or Laplacian.")
    decimate = traits.Float(argstr="--decimate %f", desc="Chose the target reduction in number of polygons as a decimal percentage (between 0 and 1) of the number of polygons. Specifies the percentage of triangles to be removed. For example, 0.1 means 10% reduction and 0.9 means 90% reduction.")
    splitnormals = traits.Bool(argstr="--splitnormals ", desc="Splitting normals is useful for visualizing sharp features. However it creates holes in surfaces which affects measurements.")
    pointnormals = traits.Bool(argstr="--pointnormals ", desc="Turn this flag on if you wish to calculate the normal vectors for the points.")
    pad = traits.Bool(argstr="--pad ", desc="Pad the input volume with zero value voxels on all 6 faces in order to ensure the production of closed surfaces. Sets the origin translation and extent translation so that the models still line up with the unpadded input volume.")
    modelHierarchyFile = File(argstr="--modelHierarchyFile %s", desc="A mrml file that contains a template model hierarchy tree with a hierarchy node per color used in the input volume's color table. Color names used for the models are matched to template hierarchy names to create a multi level output tree. Create a hierarchy in the Models GUI and save a scene, then clean it up to remove everything but the model hierarchy and display nodes.", exists=True)
    saveIntermediateModels = traits.Bool(argstr="--saveIntermediateModels ", desc="You can save a copy of the models after each of the intermediate steps (marching cubes, smoothing, and decimation if not joint smoothing, otherwise just after decimation). These intermediate models are not saved in the mrml file, you have to load them manually after turning off deleting temporary files in they python console (View ->Python Interactor) using the following command slicer.modules.modelmaker.cliModuleLogic().DeleteTemporaryFilesOff().")
    debug = traits.Bool(argstr="--debug ", desc="turn this flag on in order to see debugging output (look in the Error Log window that is accessed via the View menu)")
Example #21
0
class Dcm2niixInputSpec(CommandLineInputSpec):
    source_names = InputMultiPath(File(exists=True),
                                  argstr="%s",
                                  position=-1,
                                  copyfile=False,
                                  mandatory=True,
                                  xor=['source_dir'])
    source_dir = Directory(exists=True,
                           argstr="%s",
                           position=-1,
                           mandatory=True,
                           xor=['source_names'])
    out_filename = traits.Str('%t%p',
                              argstr="-f %s",
                              usedefault=True,
                              desc="Output filename")
    output_dir = Directory(exists=True,
                           argstr='-o %s',
                           genfile=True,
                           desc="Output directory")
    bids_format = traits.Bool(True,
                              argstr='-b',
                              usedefault=True,
                              desc="Create a BIDS sidecar file")
    compress = traits.Enum(
        'i', ['y', 'i', 'n'],
        argstr='-z %s',
        usedefault=True,
        desc="Gzip compress images - [y=pigz, i=internal, n=no]")
    merge_imgs = traits.Bool(False,
                             argstr='-m',
                             usedefault=True,
                             desc="merge 2D slices from same series")
    single_file = traits.Bool(
        False,
        argstr='-s',
        usedefault=True,
        desc="Convert only one image (filename as last input")
    verbose = traits.Bool(False,
                          argstr='-v',
                          usedefault=True,
                          desc="Verbose output")
    crop = traits.Bool(False,
                       argstr='-x',
                       usedefault=True,
                       desc="Crop 3D T1 acquisitions")
    has_private = traits.Bool(
        False,
        argstr='-t',
        usedefault=True,
        desc="Flag if text notes includes private patient details")
Example #22
0
class DistanceMapInputSpec(FSLCommandInputSpec):

    in_file = File(exists=True,
                   mandatory=True,
                   argstr="--in=%s",
                   desc="image to calculate distance values for")
    mask_file = File(exists=True,
                     argstr="--mask=%s",
                     desc="binary mask to contrain calculations")
    invert_input = traits.Bool(argstr="--invert", desc="invert input image")
    local_max_file = traits.Either(traits.Bool,
                                   File,
                                   argstr="--localmax=%s",
                                   desc="write an image of the local maxima",
                                   hash_files=False)
    distance_map = File(genfile=True,
                        argstr="--out=%s",
                        desc="distance map to write",
                        hash_files=False)
Example #23
0
class HIFIInputSpec(QI.InputSpec):
    # Inputs
    spgr_file = File(exists=True,
                     argstr='%s',
                     mandatory=True,
                     position=-2,
                     desc='Path to SPGR data')

    mprage_file = File(exists=True,
                       argstr='%s',
                       mandatory=True,
                       position=-1,
                       desc='Path to MPRAGE data')

    # Options
    residuals = traits.Bool(desc='Write out residuals for each data-point',
                            argstr='--resids')
    clamp_T1 = traits.Float(desc='Clamp T1 between 0 and value',
                            argstr='--clampT1=%f')
Example #24
0
class GCORInputSpec(CommandLineInputSpec):
    in_file = File(desc='input dataset to compute the GCOR over',
                   argstr='-input %s',
                   position=-1,
                   mandatory=True,
                   exists=True,
                   copyfile=False)

    mask = File(desc='mask dataset, for restricting the computation',
                argstr='-mask %s',
                exists=True,
                copyfile=False)

    nfirst = traits.Int(0,
                        argstr='-nfirst %d',
                        desc='specify number of initial TRs to ignore')
    no_demean = traits.Bool(False,
                            argstr='-no_demean',
                            desc='do not (need to) demean as first step')
Example #25
0
class _NonsteadyStatesDetectorInputSpec(BaseInterfaceInputSpec):
    in_file = File(exists=True, mandatory=True, desc="BOLD fMRI timeseries")
    nonnegative = traits.Bool(True,
                              usedefault=True,
                              desc="whether image voxels must be nonnegative")
    n_volumes = traits.Range(
        value=40,
        low=10,
        high=200,
        usedefault=True,
        desc="drop volumes in 4D image beyond this timepoint",
    )
    zero_dummy_masked = traits.Range(
        value=20,
        low=2,
        high=40,
        usedefault=True,
        desc=
        "number of timepoints to average when the number of dummies is zero")
Example #26
0
class QIAFIInputSpec(base.InputSpec):
    # Inputs
    afi_file = File(exists=True,
                    argstr='%s',
                    mandatory=True,
                    position=0,
                    desc='Input file')

    # Options
    threads = traits.Int(desc='Use N threads (default=4, 0=hardware limit)',
                         argstr='--threads=%d')
    prefix = traits.String(desc='Add a prefix to output filenames',
                           argstr='--out=%s')
    alpha = traits.Float(desc="Specify nominal flip-angle, default 55",
                         argstr="--flip=%f")
    tr_ratio = traits.Float(desc="Specify TR2:TR1 ratio, default 5",
                            argstr="--ratio=%f")
    save_act_b1 = traits.Bool(
        desc="Write out the actual flip-angle as well as B1", argstr="--save")
Example #27
0
class _ROIsPlotInputSpecRPT(nrb._SVGReportCapableInputSpec):
    in_file = File(
        exists=True, mandatory=True, desc="the volume where ROIs are defined"
    )
    in_rois = InputMultiPath(
        File(exists=True), mandatory=True, desc="a list of regions to be plotted"
    )
    in_mask = File(exists=True, desc="a special region, eg. the brain mask")
    masked = traits.Bool(False, usedefault=True, desc="mask in_file prior plotting")
    colors = traits.Either(
        None, traits.List(Str), usedefault=True, desc="use specific colors for contours"
    )
    levels = traits.Either(
        None,
        traits.List(traits.Float),
        usedefault=True,
        desc="pass levels to nilearn.plotting",
    )
    mask_color = Str("r", usedefault=True, desc="color for mask")
Example #28
0
class MergeInputSpec(BaseInterfaceInputSpec):
    in_files = InputMultiPath(File(exists=True),
                              mandatory=True,
                              desc='input list of files to merge')
    dtype = traits.Enum('f4',
                        'f8',
                        'u1',
                        'u2',
                        'u4',
                        'i2',
                        'i4',
                        usedefault=True,
                        desc='numpy dtype of output image')
    header_source = File(
        exists=True,
        desc='a Nifti file from which the header should be copied')
    compress = traits.Bool(True,
                           usedefault=True,
                           desc='Use gzip compression on .nii output')
Example #29
0
class _BIDSFreeSurferDirInputSpec(BaseInterfaceInputSpec):
    derivatives = Directory(exists=True,
                            mandatory=True,
                            desc="BIDS derivatives directory")
    freesurfer_home = Directory(exists=True,
                                mandatory=True,
                                desc="FreeSurfer installation directory")
    subjects_dir = traits.Either(
        traits.Str(),
        Directory(),
        default="freesurfer",
        usedefault=True,
        desc="Name of FreeSurfer subjects directory",
    )
    spaces = traits.List(traits.Str, desc="Set of output spaces to prepare")
    overwrite_fsaverage = traits.Bool(
        False,
        usedefault=True,
        desc="Overwrite fsaverage directories, if present")
Example #30
0
class PicoPDFsInputSpec(StdOutCommandLineInputSpec):
    in_file = File(exists=True,
                   argstr='< %s',
                   mandatory=True,
                   position=1,
                   desc='voxel-order data filename')

    inputmodel = traits.Enum('dt',
                             'multitensor',
                             'pds',
                             argstr='-inputmodel %s',
                             position=2,
                             desc='input model type',
                             usedefault=True)

    luts = File(exists=True, argstr='-luts %s',
        mandatory=False, position=3,
        desc='Files containing the lookup tables.'\
        'For tensor data, one lut must be specified for each type of inversion used in the image (one-tensor, two-tensor, three-tensor).'\
        'For pds, the number of LUTs must match -numpds (it is acceptable to use the same LUT several times - see example, above).'\
        'These LUTs may be generated with dtlutgen.')

    pdf = traits.Enum('watson', 'bingham', 'acg',
        argstr='-pdf %s', position=4, desc=' Specifies the PDF to use. There are three choices:'\
        'watson - The Watson distribution. This distribution is rotationally symmetric.'\
        'bingham - The Bingham distributionn, which allows elliptical probability density contours.'\
        'acg - The Angular Central Gaussian distribution, which also allows elliptical probability density contours', usedefault=True)

    directmap = traits.Bool(
        argstr='-directmap',
        desc=
        "Only applicable when using pds as the inputmodel. Use direct mapping between the eigenvalues and the distribution parameters instead of the log of the eigenvalues."
    )

    maxcomponents = traits.Int(argstr='-maxcomponents %d', units='NA',
        desc='The maximum number of tensor components in a voxel (default 2) for multitensor data.'\
        'Currently, only the default is supported, but future releases may allow the input of three-tensor data using this option.')

    numpds = traits.Int(argstr='-numpds %d', units='NA',
        desc='The maximum number of PDs in a voxel (default 3) for PD data.' \
        'This option determines the size of the input and output voxels.' \
        'This means that the data file may be large enough to accomodate three or more PDs,'\
        'but does not mean that any of the voxels are classified as containing three or more PDs.')