Esempio n. 1
0
class CompIcaInputSpec(BaseInterfaceInputSpec):
    """Input specification for CompIca."""

    fif_file = traits.File(exists=True,
                           desc='filtered raw meg data in fif format',
                           mandatory=True)
    raw_fif_file = traits.File(exists=True,
                               desc='orignal raw meg data in fif format',
                               mandatory=True)
    ecg_ch_name = traits.String(desc='name of ecg channel')
    eog_ch_name = traits.String(desc='name of eog channel')
    n_components = traits.Float(desc='number of ica components')
    reject = traits.Dict(desc='rejection parameters', mandatory=False)
Esempio n. 2
0
    def __init__(self):
        super(ASL_Rescaling, self).__init__()
        # Inputs
        self.add_trait("ASL_file", traits.File(output=False, optional=False))
        self.add_trait("method",
                       traits.Str('whitepaper', output=False, optional=True))
        self.add_trait("M0_image_file", traits.File(output=False,
                                                    optional=True))
        self.add_trait("T1_map_file", traits.File(output=False, optional=True))
        self.add_trait("T1_blood",
                       traits.Float(1.65, output=False,
                                    optional=True))  # seconds
        self.add_trait("T2w_blood",
                       traits.Float(0.1, output=False,
                                    optional=True))  # seconds
        self.add_trait("rho_blood",
                       traits.Float(0.8, output=False, optional=True))
        self.add_trait("T1_CSF", traits.Float(4.0, output=False,
                                              optional=True))  # seconds
        self.add_trait("T2w_CSF", traits.Float(0.1,
                                               output=False,
                                               optional=True))  # seconds
        self.add_trait("rho_CSF", traits.Float(1.0,
                                               output=False,
                                               optional=True))
        self.add_trait("rho_brain",
                       traits.Float(1040, output=False,
                                    optional=True))  #kg/m^3
        self.add_trait("lambda_",
                       traits.Float(0.0009, output=False,
                                    optional=True))  #kg/m^3
        self.add_trait("label_eff", traits.Float(output=False, optional=True))
        self.add_trait("transit_delay",
                       traits.Float(1.5, output=False,
                                    optional=True))  #seconds
        self.add_trait("tAcq_slice",
                       traits.Float(0.0, output=False, optional=True))
        self.add_trait("back_supp", traits.Int(output=False, optional=True))
        self.add_trait("TI1", traits.Float(1.8, output=False, optional=True))
        self.add_trait("PLD", traits.Float(2.0, output=False, optional=True))
        self.add_trait("TRm0", traits.Float(10.0, output=False, optional=True))
        self.add_trait("T1t", traits.Float(0.9, output=False, optional=True))
        self.add_trait("ASL_mode", traits.Str(output=False, optional=True))
        self.add_trait("output_prefix",
                       traits.Str('t', output=False, optional=True))
        self.add_trait("output_datatype",
                       traits.Str('int16', output=False, optional=True))

        # Outputs
        self.add_trait("ASL_output", traits.File(output=True))
        self.add_trait("M0_output", traits.File(output=True))
Esempio n. 3
0
 class output_spec(TraitedSpec):
     mask_file = traits.File(exists=True)
     beta_file = traits.File(exists=True)
     error_file = traits.File(exists=True)
     ols_file = traits.File(exists=True)
     resid_file = traits.File()
     design_file = traits.File(exists=True)
     resid_plot = traits.File(exists=True)
     design_plot = traits.File(exists=True)
     error_plot = traits.File(exists=True)
Esempio n. 4
0
File: qc.py Progetto: bilgelm/APPIAN
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")
    t1_brain_mask = 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)
Esempio n. 5
0
class LOGISMOSBPreprocessingInputSpec(BaseInterfaceInputSpec):
    """This class represents a..."""

    white_mask = traits.File(exists=True, mandatory=True)
    erode_mask = traits.Int(default_value=1, usedefault=True)
    gm_proba = traits.File(exists=True, mandatory=True)
    wm_proba = traits.File(exists=True, mandatory=True)
    background_penalty = traits.Int(default_value=100,
                                    usedefault=True,
                                    desc="Penalty for a zero probability.")
    proba_scale = traits.Int(default_value=50,
                             usedefault=True,
                             desc="Scale the probabilities.")
    min_probability = traits.Float(default_value=0.01, usedefault=True)
Esempio n. 6
0
File: utils.py Progetto: ywangc/QUIT
class CoilCombineInputSpec(QI.InputSpec):
    in_file = traits.File(desc='Input complex-valued file to coil-combine',
                          argstr='%s',
                          exists=True)
    composer_file = traits.File(
        desc='Short Echo-Time reference file for COMPOSER',
        argstr='--composer=%s',
        exists=True)
    hammond_coils = traits.Int(desc='Number of coils for Hammond method',
                               argstr='--coils=%d')
    hammond_volume = traits.Int(desc='Volume to use for Hammond method',
                                argstr='--vol=%d')
    hammond_region = traits.Str(desc='Region to use for Hammond method',
                                argstr='--region=%s')
Esempio n. 7
0
class SlicesInputSpec(BaseInterfaceInputSpec):
    out_file = traits.File(mandatory=True, desc='Output slice image')
    base_file = traits.File(exists=True,
                            mandatory=True,
                            desc='Image file to slice')
    base_map = traits.String('gist_gray',
                             usedefault=True,
                             desc='Color map for base image')
    base_window = traits.Tuple(minlen=2,
                               maxlen=2,
                               desc='Window for base image')
    base_scale = traits.Float(1.0,
                              usedefault=True,
                              desc='Scaling factor for base image')
    base_label = traits.String('',
                               usedefault=True,
                               desc='Label for base image color-bar')

    mask_file = traits.File(None,
                            usedefault=True,
                            mandatory=True,
                            desc='Mask file')

    slice_axis = traits.String('z', usedefault=True, desc='Axis to slice')
    slice_lims = traits.Tuple(
        (0.1, 0.9),
        minlen=2,
        maxlen=2,
        usedefault=True,
        desc='Limits of axis to slice, fraction (low, high) default (0.1, 0.9)'
    )
    slice_layout = traits.Tuple((3, 6),
                                minlen=2,
                                maxlen=2,
                                usedefault=True,
                                desc='Slices layout (rows, cols)')
    volume = traits.Int(0,
                        usedefault=True,
                        desc='Volume for slicing in multi-volume file')
    figsize = traits.Tuple(minlen=2, maxlen=2, desc='Output figure size')
    preclinical = traits.Bool(False,
                              usedefault=True,
                              desc='Data is pre-clinical, fix orientation')
    transpose = traits.Bool(False,
                            usedefault=True,
                            desc='Transpose slice layout')
    bar_pos = traits.String('bottom',
                            usedefault=True,
                            desc='Color/Alphabar position')
Esempio n. 8
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)
Esempio n. 9
0
class SpectralConnInputSpec(BaseInterfaceInputSpec):
    """Input specification."""

    ts_file = traits.File(
        exists=True, desc='nodes * time series in .npy format', mandatory=True)

    sfreq = traits.Float(desc='sampling frequency', mandatory=True)

    freq_band = traits.List(traits.Float(exists=True),
                            desc='frequency bands', mandatory=True)

    mode = traits.Enum("multitaper", "cwt_morlet",
                       desc='Mode for computing frequency bands')

    con_method = traits.Enum("coh", "imcoh", "plv", "pli", "wpli",
                             "pli2_unbiased", "ppc", "cohy", "wpli2_debiased",
                             desc='connectivity measure')

    epoch_window_length = traits.Float(-1.0, desc='epoched data',
                                       mandatory=False)

    export_to_matlab = traits.Bool(
        False, desc='If conmat is exported to .mat format as well',
        usedefault=True)

    index = traits.Int(
        0, desc="What to add to the name of the file", usedefault=True)

    multi_con = traits.Bool(
        False, desc='If multiple connectivity matrices are exported',
        usedefault=True)

    gathering_method = traits.Enum("mean", "max", "none",
                                   desc='gathering_method', usedefault=True)
Esempio n. 10
0
class MouseCroppingInputSpec(BaseInterfaceInputSpec):

    ct = InputMultiPath(traits.File(exists=True),
                        desc='Mouse clinical CT image to crop')
    out_folder = Directory('Cropping_dir',
                           usedefault=True,
                           desc='Folder to store the cropping results.')
Esempio n. 11
0
File: viz.py Progetto: xwolfs/mriqc
class PlotContoursInputSpec(BaseInterfaceInputSpec):
    in_file = File(exists=True, mandatory=True, desc='File to be plotted')
    in_contours = File(exists=True,
                       mandatory=True,
                       desc='file to pick the contours from')
    cut_coords = traits.Int(8, usedefault=True, desc='number of slices')
    levels = traits.List([.5],
                         traits.Float,
                         usedefault=True,
                         desc='add a contour per level')
    colors = traits.List(['r'],
                         traits.Str,
                         usedefault=True,
                         desc='colors to be used for contours')
    display_mode = traits.Enum('ortho',
                               'x',
                               'y',
                               'z',
                               'yx',
                               'xz',
                               'yz',
                               usedefault=True,
                               desc='visualization mode')
    saturate = traits.Bool(False, usedefault=True, desc='saturate background')
    out_file = traits.File(exists=False, desc='output file name')
    vmin = traits.Float(desc='minimum intensity')
    vmax = traits.Float(desc='maximum intensity')
Esempio n. 12
0
class PlotContoursInputSpec(BaseInterfaceInputSpec):
    in_file = File(exists=True, mandatory=True, desc="File to be plotted")
    in_contours = File(exists=True,
                       mandatory=True,
                       desc="file to pick the contours from")
    cut_coords = traits.Int(8, usedefault=True, desc="number of slices")
    levels = traits.List([0.5],
                         traits.Float,
                         usedefault=True,
                         desc="add a contour per level")
    colors = traits.List(
        ["r"],
        traits.Str,
        usedefault=True,
        desc="colors to be used for contours",
    )
    display_mode = traits.Enum(
        "ortho",
        "x",
        "y",
        "z",
        "yx",
        "xz",
        "yz",
        usedefault=True,
        desc="visualization mode",
    )
    saturate = traits.Bool(False, usedefault=True, desc="saturate background")
    out_file = traits.File(exists=False, desc="output file name")
    vmin = traits.Float(desc="minimum intensity")
    vmax = traits.Float(desc="maximum intensity")
Esempio n. 13
0
class PowerInputSpec(BaseInterfaceInputSpec):
    data_file = traits.File(exists=True,
                            desc='File with mne.Epochs or mne.io.Raw or .npy',
                            mandatory=True)

    fmin = traits.Float(desc='lower psd frequency', mandatory=False)
    fmax = traits.Float(desc='higher psd frequency', mandatory=False)

    sfreq = traits.Float(desc='sampling frequency', mandatory=False)

    nfft = traits.Int(desc='the length of FFT used', mandatory=False)
    overlap = traits.Float(
        desc='The number of points of overlap between segments',
        mandatory=False)

    method = traits.Enum('welch',
                         'multitaper',
                         desc='power spectral density computation method')

    is_epoched = traits.Bool(desc='if true input data are mne.Epochs',
                             mandatory=False)

    is_sensor_space = traits.Bool(True,
                                  usedefault=True,
                                  dedesc='True for PSD on sensor space \
                                  False for PSD on source',
                                  mandatory=False)
Esempio n. 14
0
class CollectFeatureFilesOutputSpec(TraitedSpec):
    """
    This class represents a...
    """

    feature_files = traits.Dict(trait=traits.File(exists=True),
                                desc="Output dictionary of feature files")
Esempio n. 15
0
class CalculateProbabilityFromSamplesInput(TraitedSpec):
    sample_maps = InputMultiPath(File(exists=True), mandatory=True)
    stat_map = File(exists=True, mandatory=True)
    mask = traits.File(
        exists=True,
        desc="restrict the fitting only to the region defined by this mask")
    independent_voxel_nulls = traits.Bool(False, usedefault=True)
Esempio n. 16
0
class DARTELExistingTemplateInputSpec(SPMCommandInputSpec):
    image_files = traits.List(traits.List(File(exists=True)),
                              desc="A list of files to be segmented",
                              field='warp1.images', copyfile=False, mandatory=True)
    regularization_form = traits.Enum('Linear', 'Membrane', 'Bending',
                                      field='warp1.settings.rform',
                                      desc='Form of regularization energy term')
    iteration_parameters = traits.List(traits.Tuple(traits.Range(1, 10),
                                                    traits.Tuple(traits.Float,
                                                                 traits.Float,
                                                                 traits.Float),
                                                    traits.Range(0, 9),
                                                    traits.File(exists=True)),
                                       minlen=3,
                                       maxlen=12,
                                       mandatory=True,
                                       field='warp1.settings.param',
                                       desc="""List of tuples for each iteration
                                       - Inner iterations
                                       - Regularization parameters
                                       - Time points for deformation model
                                       - DARTEL template
                                       """)
    optimization_parameters = traits.Tuple(traits.Float, traits.Range(1, 8),
                                           traits.Range(1, 8),
                                           field='warp1.settings.optim',
                                           desc="""Optimization settings a tuple
                                           - LM regularization
                                           - cycles of multigrid solver
                                           - relaxation iterations
                                           """)
Esempio n. 17
0
class SimInputBaseSpec(DynamicTraitedSpec):
    """
    Input specification for tools in simulation mode
    """
    ignore_exception = traits.Bool(
        False,
        usedefault=True,
        nohash=True,
        deprecated='1.0.0',
        desc='Print an error message instead of throwing an exception '
        'in case the interface fails to run')
    args = traits.Str(argstr='%s', desc='Additional parameters to the command')
    environ = traits.DictStrStr(
        desc='Environment variables', usedefault=True, nohash=True)
    # This input does not have a "usedefault=True" so the set_default_terminal_output()
    # method would work
    terminal_output = traits.Enum(
        'stream',
        'allatonce',
        'file',
        'none',
        deprecated='1.0.0',
        desc=('Control terminal output: `stream` - '
              'displays to terminal immediately (default), '
              '`allatonce` - waits till command is '
              'finished to display output, `file` - '
              'writes output to file, `none` - output'
              ' is ignored'),
        nohash=True)

    json = traits.File(exists=True, desc='JSON Input file', argstr='--json=%s')
    noise = traits.Float(desc='Noise level to add to simulation',
                         argstr='--simulate=%f', default_value=0.0, usedefault=True)
Esempio n. 18
0
class JsonToSifInput(CommandLineInputSpec):
    out_file = File(argstr="%s",
                    desc="SIF text file with correct time frames.")
    pet = File(exists=True, argstr="%s", desc="Minc PET image.")
    pet_header_json = traits.File(exists=True,
                                  argstr="%s",
                                  desc="PET header file")
Esempio n. 19
0
class ModifyHeaderInput(CommandLineInputSpec):
    in_file = File(position=-1, argstr="%s", mandatory=True, desc="Image")
    out_file = File(desc="Image after centering")
    sinsert = traits.Bool(argstr="-sinsert",
                          position=-3,
                          default_value=False,
                          desc="Insert a string attribute")
    dinsert = traits.Bool(argstr="-dinsert",
                          position=-3,
                          default_value=False,
                          desc="Insert a double precision attribute")
    sappend = traits.Bool(argstr="-sappend",
                          position=-3,
                          default_value=False,
                          desc="Append a string attribute")
    dappend = traits.Bool(argstr="-dappend",
                          position=-3,
                          default_value=False,
                          desc="Append a double precision attribute")
    delete = traits.Bool(argstr="-delete",
                         position=-3,
                         default_value=False,
                         desc="Delete an attribute")
    opt_string = traits.Str(argstr="%s",
                            position=-2,
                            desc="Option defining the infos to print out")
    header = traits.File(
        argstr="MINC header for PET image, stored as dictionary")
Esempio n. 20
0
class MultiLabelDilationOutputSpec(TraitedSpec):
    """This class represents a...

    :param TraitedSpec:
    """

    out_file = traits.File()
Esempio n. 21
0
class SplitWindowsInputSpec(BaseInterfaceInputSpec):

    ts_file = traits.File(
        exists=True, desc='nodes * time series in .npy format', mandatory=True)

    n_windows = traits.List(
        traits.Tuple, desc='List of start and stop points (tuple of two integers) of temporal windows', mandatory=True)
Esempio n. 22
0
class SplitLabelsOutputSpec(TraitedSpec):
    """This class represents a...

     :param TraitedSpec:
     """

    out_file = traits.File(exists=True)
Esempio n. 23
0
class CreateEpInputSpec(BaseInterfaceInputSpec):
    """Input specification for CreateEp."""

    fif_file = traits.File(exists=True,
                           desc='raw meg data in fif format',
                           mandatory=True)
    ep_length = traits.Float(desc='epoch length in seconds')
Esempio n. 24
0
class SurfaceMaskOutputSpec(TraitedSpec):
    """This class represents a...

     :param TraitedSpec:
     """

    out_file = traits.File(desc="Output masked volume.")
Esempio n. 25
0
class PowerBandInputSpec(BaseInterfaceInputSpec):
    """Input specification for PowerBand"""
    psds_file = traits.File(exists=True,
                            desc='psd tensor and frequencies in .npz format',
                            mandatory=True)

    freq_bands = traits.List(desc='frequency bands', mandatory=True)
Esempio n. 26
0
class e7emhdrInput(CommandLineInputSpec):  #CommandLineInputSpec):
    in_file = File(argstr="%s", position=-2, desc="Input image.")
    out_file = File(desc="Output image.")
    isotope = traits.Str(argstr="isotope_halflife :=  %s",
                         position=-1,
                         desc="Set isotope half life")
    header = traits.File(exists=True, argstr="%s", desc="PET header file")
Esempio n. 27
0
class NewImageInputSpec(QI.InputBaseSpec):
    # Options
    img_size = traits.List(minsize=2,
                           maxsize=4,
                           mandatory=True,
                           desc='Image size',
                           argstr='--size=%s',
                           sep=',')
    voxel_spacing = traits.Float(desc='Voxel spacing', argstr='--spacing=%f')
    origin = traits.Float(desc='Image origin', argstr='--origin=%f')
    fill = traits.Float(desc='Fill with value', argstr='--fill=%f')
    grad_dim = traits.Int(desc='Fill with gradient along dimension',
                          argstr='--grad_dim=%d')
    grad_vals = traits.Tuple(desc='Gradient start/end values',
                             argstr='--grad_vals=%f,%f')
    grad_steps = traits.Int(desc='Gradient in N discrete steps',
                            argstr='--steps=%s')
    wrap = traits.Float(desc='Wrap image values at the given value',
                        argstr='--wrap=%f')

    # Output file
    out_file = traits.File(desc='Output file',
                           exists=False,
                           position=-1,
                           argstr='%s',
                           mandatory=True)
Esempio n. 28
0
class NoiseCovarianceConnInputSpec(BaseInterfaceInputSpec):
    """Input specification for NoiseCovariance."""

    cov_fname_in = traits.File(exists=False,
                               desc='file name for Noise \
                               Covariance Matrix')
    raw_filename = traits.File(exists=True, desc='raw data filename')
    is_epoched = traits.Bool(desc='true if we want to epoch the data',
                             mandatory=False)
    is_evoked = traits.Bool(desc='true if we want to analyze evoked data',
                            mandatory=False)
    events_id = traits.Dict(None,
                            desc='the id of all events to consider.',
                            mandatory=False)
    t_min = traits.Float(None, desc='start time before event', mandatory=False)
    t_max = traits.Float(None, desc='end time after event', mandatory=False)
Esempio n. 29
0
class MS_LDAInputSpec(FSTraitedSpec):
    lda_labels = traits.List(traits.Int(),
                             argstr='-lda %s',
                             mandatory=True,
                             minlen=2,
                             maxlen=2,
                             sep=' ',
                             desc='pair of class labels to optimize')
    weight_file = traits.File(
        argstr='-weight %s',
        mandatory=True,
        desc='filename for the LDA weights (input or output)')
    output_synth = traits.File(
        exists=False,
        argstr='-synth %s',
        mandatory=True,
        desc='filename for the synthesized output volume',
        deprecated='0.8',
        new_name='vol_synth_file',
        xor=['vol_synth_file', 'output_synth'])
    vol_synth_file = traits.File(
        exists=False,
        argstr='-synth %s',
        mandatory=True,
        desc='filename for the synthesized output volume',
        xor=['vol_synth_file', 'output_synth'])
    label_file = traits.File(exists=True,
                             argstr='-label %s',
                             desc='filename of the label volume')
    mask_file = traits.File(exists=True,
                            argstr='-mask %s',
                            desc='filename of the brain mask volume')
    shift = traits.Int(
        argstr='-shift %d',
        desc='shift all values equal to the given value to zero')
    conform = traits.Bool(argstr='-conform',
                          desc=('Conform the input volumes (brain mask '
                                'typically already conformed)'))
    use_weights = traits.Bool(argstr='-W',
                              desc=('Use the weights from a previously '
                                    'generated weight file'))
    images = InputMultiPath(File(exists=True),
                            argstr='%s',
                            mandatory=True,
                            copyfile=False,
                            desc='list of input FLASH images',
                            position=-1)
Esempio n. 30
0
class ConnectivityCorrelationInputSpec(BaseInterfaceInputSpec):
    in_files = InputMultiPath(
        traits.File(
            desc="NifTI image file(s) from where to extract the data. \n"
            "If more than one (3D volumes), all should be spatially normalized.",
            exists=True,
            mandatory=True))
    atlas_file = traits.File(
        desc="Atlas image file defining the connectivity ROIs.\n"
        "Must be spatially normalized to in_files.",
        exists=True,
        mandatory=True)
    atlas_type = traits.Enum("probabilistic",
                             "labels",
                             desc="The type of atlas.",
                             default="labels")

    # masker options
    smoothing_fwhm = traits.Float(
        desc=
        "If smoothing_fwhm is defined, it gives the full-width half maximum in "
        "millimeters of the spatial smoothing to apply to the signal.", )
    standardize = traits.Bool(
        desc="If standardize is True, the time-series are centered and normed: "
        "their mean is put to 0 and their variance to 1 in the time dimension.",
        default_value=False)
    resampling_target = traits.Enum(
        "mask",
        "maps",
        "data",
        "labels",
        "",
        desc="Gives which image gives the final shape/size. "
        "This depends on the `atlas_type`. "
        "For 'probabilistic' you must use 'mask', 'maps' or None; while for"
        "'labels' you must use 'data', 'labels' or None."
        "Have a look on nilearn docs for more information.")

    # connectome options
    kind = traits.Enum("correlation",
                       "partial correlation",
                       "tangent",
                       "covariance",
                       "precision",
                       desc="The connectivity matrix kind.",
                       default='covariance')