class DesignSpec(TraitedSpec): regressors = traits.Dict( traits.Str, traits.List(traits.Float), mandatory=True, ) contrasts = traits.List( traits.Either( traits.Tuple( traits.Str, traits.Enum("T"), traits.List(traits.Str), traits.List(traits.Float), ), traits.Tuple( traits.Str, traits.Enum("F"), traits.List( traits.Tuple( traits.Str, traits.Enum("T"), traits.List(traits.Str), traits.List(traits.Float), ), ), ), ), mandatory=True, )
class OverlayInputSpec(FSLCommandInputSpec): transparency = traits.Bool(desc='make overlay colors semi-transparent', position=1, argstr='%s', usedefault=True, default_value=True) out_type = traits.Enum('float', 'int', position=2, usedefault=True, argstr='%s', desc='write output with float or int') use_checkerboard = traits.Bool(desc='use checkerboard mask for overlay', argstr='-c', position=3) background_image = File(exists=True, position=4, mandatory=True, argstr='%s', desc='image to use as background') _xor_inputs = ('auto_thresh_bg', 'full_bg_range', 'bg_thresh') auto_thresh_bg = traits.Bool(desc='automatically threhsold the background image', argstr='-a', position=5, xor=_xor_inputs, mandatory=True) full_bg_range = traits.Bool(desc='use full range of background image', argstr='-A', position=5, xor=_xor_inputs, mandatory=True) bg_thresh = traits.Tuple(traits.Float, traits.Float, argstr='%.3f %.3f', position=5, desc='min and max values for background intensity', xor=_xor_inputs, mandatory=True) stat_image = File(exists=True, position=6, mandatory=True, argstr='%s', desc='statistical image to overlay in color') stat_thresh = traits.Tuple(traits.Float, traits.Float, position=7, mandatory=True, desc='min and max values for the statistical overlay', argstr='%.2f %.2f') show_negative_stats = traits.Bool(desc='display negative statistics in overlay', xor=['stat_image2'], argstr='%s', position=8) stat_image2 = File(exists=True, position=9, xor=['show_negative_stats'], argstr='%s', desc='second statistical image to overlay in color') stat_thresh2 = traits.Tuple(traits.Float, traits.Float, position=10, desc='min and max values for second statistical overlay', argstr='%.2f %.2f') out_file = File(desc='combined image volume', position=-1, argstr='%s', genfile=True, hash_files=False)
class PlotTimeSeriesInputSpec(FSLCommandInputSpec): in_file = traits.Either(File(exists=True), traits.List(File(exists=True)), mandatory=True, argstr="%s", position=1, desc="file or list of files with columns of timecourse information") plot_start = traits.Int(argstr="--start=%d", xor=("plot_range",), desc="first column from in-file to plot") plot_finish = traits.Int(argstr="--finish=%d", xor=("plot_range",), desc="final column from in-file to plot") plot_range = traits.Tuple(traits.Int, traits.Int, argstr="%s", xor=("plot_start", "plot_finish"), desc="first and last columns from the in-file to plot") title = traits.Str(argstr="%s", desc="plot title") legend_file = File(exists=True, argstr="--legend=%s", desc="legend file") labels = traits.Either(traits.Str, traits.List(traits.Str), argstr="%s", desc="label or list of labels") y_min = traits.Float(argstr="--ymin=%.2f", desc="minumum y value", xor=("y_range",)) y_max = traits.Float(argstr="--ymax=%.2f", desc="maximum y value", xor=("y_range",)) y_range = traits.Tuple(traits.Float, traits.Float, argstr="%s", xor=("y_min", "y_max"), desc="min and max y axis values") x_units = traits.Int(argstr="-u %d", usedefault=True, default_value=1, desc="scaling units for x-axis (between 1 and length of in file)") plot_size = traits.Tuple(traits.Int, traits.Int, argstr="%s", desc="plot image height and width") x_precision = traits.Int(argstr="--precision=%d", desc="precision of x-axis labels") sci_notation = traits.Bool(argstr="--sci", desc="switch on scientific notation") out_file = File(argstr="-o %s", genfile=True, desc="image to write", hash_files=False)
class TprojectInputSpec(AFNICommandInputSpec): in_file = File(desc='input file to 3dTproject', argstr='-input %s', exists=True, mandatory=True) out_file = File(name_template="%s_filt", desc='output image file name', argstr='-prefix %s', name_source="in_file") ort = File(desc='remove each column in file. Multiple ort are allowed', argstr='-ort %s', exists=True) polort = traits.Int(desc='remove polynomials up to degree specified', argstr='-polort %s') dsort = File( desc='Remove the 3D+time time series in the specified dataset', argstr='-dsort %s', exists=True) passband = traits.Tuple( (traits.Float(), traits.Float()), argstr='-passband %f %f', desc='Remove all frequencies EXCEPT those in the range provided.') stopband = traits.Tuple( (traits.Float(), traits.Float()), argstr='-stopband %f %f', desc='Remove all frequencies in the range provided.') delta_t = traits.Float(desc='time step for frequency calculations', argstr='-dt %f') mask = File(desc='Only operate on voxels nonzero in the provided mask.', argstr='-mask %s', exists=True, xor=['automask']) automask = traits.Bool(desc='the program will generate the mask to use for' 'calculations.', argstr='-automask', xor=['mask']) blur = traits.Float(desc='Blur (inside the mask only) with a filter that' 'has width (FWHM) of fff millimeters.', argstr='-blur %f') normalize = traits.Bool(desc='Normalize each output time series to have' 'sum of squares = 1. This is the LAST operation.', argstr='-norm')
class TemplateDimensionsOutputSpec(TraitedSpec): t1w_valid_list = OutputMultiPath(exists=True, desc='valid T1w images') target_zooms = traits.Tuple(traits.Float, traits.Float, traits.Float, desc='Target zoom information') target_shape = traits.Tuple(traits.Int, traits.Int, traits.Int, desc='Target shape information') out_report = File(exists=True, desc='conformation report')
class FMRISummaryInputSpec(BaseInterfaceInputSpec): in_func = File( exists=True, mandatory=True, desc="input BOLD time-series (4D file) or dense timeseries CIFTI", ) in_mask = File(exists=True, desc="3D brain mask") in_segm = File(exists=True, desc="resampled segmentation") confounds_file = File(exists=True, desc="BIDS' _confounds.tsv file") str_or_tuple = traits.Either( traits.Str, traits.Tuple(traits.Str, traits.Either(None, traits.Str)), traits.Tuple(traits.Str, traits.Either(None, traits.Str), traits.Either(None, traits.Str)), ) confounds_list = traits.List( str_or_tuple, minlen=1, desc="list of headers to extract from the confounds_file", ) tr = traits.Either(None, traits.Float, usedefault=True, desc="the repetition time")
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 """)
class DataSinkInputSpec(DynamicTraitedSpec, BaseInterfaceInputSpec): base_directory = Directory( desc='Path to the base directory for storing data.') container = traits.Str( desc='Folder within base directory in which to store output') parameterization = traits.Bool( True, usedefault=True, desc='store output in parametrized structure') strip_dir = Directory(desc='path to strip out of filename') substitutions = InputMultiPath(traits.Tuple(traits.Str, traits.Str), desc=('List of 2-tuples reflecting string ' 'to substitute and string to replace ' 'it with')) regexp_substitutions = InputMultiPath( traits.Tuple(traits.Str, traits.Str), desc=('List of 2-tuples reflecting a pair ' 'of a Python regexp pattern and a ' 'replacement string. Invoked after ' 'string `substitutions`')) _outputs = traits.Dict(traits.Str, value={}, usedefault=True) remove_dest_dir = traits.Bool( False, usedefault=True, desc='remove dest directory when copying dirs') def __setattr__(self, key, value): if key not in self.copyable_trait_names(): if not isdefined(value): super(DataSinkInputSpec, self).__setattr__(key, value) self._outputs[key] = value else: if key in self._outputs: self._outputs[key] = value super(DataSinkInputSpec, self).__setattr__(key, value)
class FormatHMCParamInputSpec(BaseInterfaceInputSpec): translations = traits.List(traits.Tuple(traits.Float, traits.Float, traits.Float), mandatory=True, desc='three translations in mm') rot_angles = traits.List(traits.Tuple(traits.Float, traits.Float, traits.Float), mandatory=True, desc='three rotations in rad') fmt = traits.Enum('confounds', 'movpar_file', usedefault=True, desc='type of resulting file')
class _ConformInputSpec(BaseInterfaceInputSpec): in_file = File(exists=True, mandatory=True, desc="Input image") target_zooms = traits.Tuple( traits.Float, traits.Float, traits.Float, desc="Target zoom information" ) target_shape = traits.Tuple( traits.Int, traits.Int, traits.Int, desc="Target shape information" )
class SQLiteGrabberInputSpec(DynamicTraitedSpec, 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')
class GrappaOutputSpec(BaseMatlabOutputSpec): channels_dir = Directory(exists=True) main_field_strength = traits.Float( desc="The orientation of the scanners main magnetic field"), main_field_orient = traits.Tuple( (traits.Int, traits.Int, traits.Int), desc="The orientation of the scanners main magnetic field") echo_times = traits.Tuple(traits.Int, desc="The echo times in seconds") larmor_freq = traits.Float(desc="The larmor frequency of the scanner")
class RepositorySinkOutputSpec(RepositorySinkSpec): files = traits.List(PATH_TRAIT, desc='Output filesets') fields = traits.List(traits.Tuple(traits.Str, FIELD_TRAIT), desc='Output fields') combined = traits.List(traits.Either(PATH_TRAIT, traits.Tuple(traits.Str, FIELD_TRAIT)), desc="Combined fileset and field outputs")
class ConformInputSpec(BaseInterfaceInputSpec): in_file = File(mandatory=True, desc='Input image') target_zooms = traits.Tuple(traits.Float, traits.Float, traits.Float, desc='Target zoom information') target_shape = traits.Tuple(traits.Int, traits.Int, traits.Int, desc='Target shape information') deoblique_header = traits.Bool(False, usedfault=True)
class _TemplateDimensionsOutputSpec(TraitedSpec): t1w_valid_list = OutputMultiObject(exists=True, desc="valid T1w images") target_zooms = traits.Tuple(traits.Float, traits.Float, traits.Float, desc="Target zoom information") target_shape = traits.Tuple(traits.Int, traits.Int, traits.Int, desc="Target shape information") out_report = File(exists=True, desc="conformation report")
class ImageInfoOutputSpec(TraitedSpec): info = traits.Any(desc="output of mri_info") out_file = File(exists=True, desc="text file with image information") data_type = traits.String(desc="image data type") file_format = traits.String(desc="file format") TE = traits.String(desc="echo time (msec)") TR = traits.String(desc="repetition time(msec)") TI = traits.String(desc="inversion time (msec)") dimensions = traits.Tuple(desc="image dimensions (voxels)") vox_sizes = traits.Tuple(desc="voxel sizes (mm)") orientation = traits.String(desc="image orientation") ph_enc_dir = traits.String(desc="phase encode direction")
class Level1DesignInputSpec(BaseInterfaceInputSpec): interscan_interval = traits.Float(mandatory=True, desc='Interscan interval (in secs)') session_info = traits.Any(mandatory=True, desc=('Session specific information generated ' 'by ``modelgen.SpecifyModel``')) bases = traits.Either( traits.Dict(traits.Enum('dgamma'), traits.Dict(traits.Enum('derivs'), traits.Bool)), traits.Dict( traits.Enum('gamma'), traits.Dict(traits.Enum('derivs', 'gammasigma', 'gammadelay'))), traits.Dict(traits.Enum('none'), traits.Dict()), mandatory=True, desc=("name of basis function and options e.g., " "{'dgamma': {'derivs': True}}")) orthogonalization = traits.Dict( traits.Int, traits.Dict(traits.Int, traits.Either(traits.Bool, traits.Int)), mandatory=False, default={}, ) model_serial_correlations = traits.Bool( desc="Option to model serial correlations using an \ autoregressive estimator (order 1). Setting this option is only \ useful in the context of the fsf file. If you set this to False, you need to \ repeat this option for FILMGLS by setting autocorr_noestimate to True", mandatory=True) contrasts = traits.List( traits.Either( traits.Tuple(traits.Str, traits.Enum('T'), traits.List(traits.Str), traits.List(traits.Float)), traits.Tuple(traits.Str, traits.Enum('T'), traits.List(traits.Str), traits.List(traits.Float), traits.List(traits.Float)), traits.Tuple( traits.Str, traits.Enum('F'), traits.List( traits.Either( traits.Tuple(traits.Str, traits.Enum('T'), traits.List(traits.Str), traits.List(traits.Float)), traits.Tuple(traits.Str, traits.Enum('T'), traits.List(traits.Str), traits.List(traits.Float), traits.List(traits.Float)))))), desc="List of contrasts with each contrast being a list of the form - \ [('name', 'stat', [condition list], [weight list], [session list])]. if \ session list is None or not provided, all sessions are used. For F \ contrasts, the condition list should contain previously defined \ T-contrasts.")
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')
class DWIDenoiseInputSpec(MRTrix3BaseInputSpec, SeriesPreprocReportInputSpec): in_file = File(exists=True, argstr='%s', position=-2, mandatory=True, desc='input DWI image') mask = File(exists=True, argstr='-mask %s', position=1, desc='mask image') extent = traits.Tuple( (traits.Int, traits.Int, traits.Int), argstr='-extent %d,%d,%d', desc='set the window size of the denoising filter. (default = 5,5,5)') noise_image = File(argstr='-noise %s', name_template='%s_noise.nii.gz', name_source=['in_file'], keep_extension=False, desc='the output noise map') out_file = File(name_template='%s_denoised.nii.gz', name_source=['in_file'], keep_extension=False, argstr='%s', position=-1, desc='the output denoised DWI image') out_report = File('dwidenoise_report.svg', usedefault=True, desc='filename for the visual report')
class DWIDenoiseInputSpec(MRTrix3BaseInputSpec): in_file = File( exists=True, argstr='%s', position=-2, mandatory=True, desc='input DWI image') mask = File( exists=True, argstr='-mask %s', position=1, desc='mask image') extent = traits.Tuple( (traits.Int, traits.Int, traits.Int), argstr='-extent %d,%d,%d', desc='set the window size of the denoising filter. (default = 5,5,5)') noise = File( argstr='-noise %s', name_template='%s_noise', name_source=['in_file'], keep_extension=True, desc='the output noise map') out_file = File( name_template='%s_denoised', name_source=['in_file'], keep_extension=True, argstr='%s', position=-1, desc='the output denoised DWI image')
class DWIDenoiseInputSpec(MRTrix3BaseInputSpec): in_file = File( exists=True, argstr="%s", position=-2, mandatory=True, desc="input DWI image", ) mask = File(exists=True, argstr="-mask %s", position=1, desc="mask image") extent = traits.Tuple( (traits.Int, traits.Int, traits.Int), argstr="-extent %d,%d,%d", desc="set the window size of the denoising filter. (default = 5,5,5)", ) noise = File( argstr="-noise %s", name_template="%s_noise", name_source=["in_file"], keep_extension=True, desc="the output noise map", ) out_file = File( argstr="%s", name_template="%s_denoised", name_source=["in_file"], keep_extension=True, position=-1, desc="the output denoised DWI image", )
class MRCropInputSpec(CommandLineInputSpec): in_file = File(exists=True, argstr='%s', mandatory=True, position=-2, desc="Diffusion weighted images with graident info") out_file = File(genfile=True, argstr='%s', position=-1, desc="Extracted DW or b-zero images") axis = traits.Tuple( traits.Int(desc="index"), # @UndefinedVariable traits.Int(desc="start"), # @UndefinedVariable traits.Int(desc='end'), # @UndefinedVariable mandatory=False, argstr="-axis %s %s %s", # @UndefinedVariable @IgnorePep8 desc=("crop the input image in the provided axis")) mask = File(mandatory=False, exists=True, argstr="-mask %s", desc=("Crop the input image according to the spatial extent of" " a mask image")) quiet = traits.Bool(mandatory=False, argstr="-quiet", desc="Don't display output during operation")
class InputSubjectsInputSpec(TraitedSpec): subject_id = traits.Str(mandatory=True, desc=("The subject ID")) prereq_reports = traits.List( traits.Tuple(traits.Str, traits.Str), value=[], desc=("A list of session reports from all prerequisite pipelines"))
class _BSplineApproxInputSpec(BaseInterfaceInputSpec): in_data = File(exists=True, mandatory=True, desc="path to a fieldmap") in_mask = File(exists=True, desc="path to a brain mask") bs_spacing = InputMultiObject( [DEFAULT_ZOOMS_MM], traits.Tuple(traits.Float, traits.Float, traits.Float), usedefault=True, desc="spacing between B-Spline control points", ) ridge_alpha = traits.Float( 0.01, usedefault=True, desc="controls the regularization" ) recenter = traits.Enum( "mode", "median", "mean", False, usedefault=True, desc="strategy to recenter the distribution of the input fieldmap", ) extrapolate = traits.Bool( True, usedefault=True, desc="generate a field, extrapolated outside the brain mask", )
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)
class _CompCorVariancePlotInputSpec(BaseInterfaceInputSpec): metadata_files = traits.List( File(exists=True), mandatory=True, desc="List of files containing component " "metadata", ) metadata_sources = traits.List( traits.Str, desc="List of names of decompositions " "(e.g., aCompCor, tCompCor) yielding " "the arguments in `metadata_files`", ) variance_thresholds = traits.Tuple( traits.Float(0.5), traits.Float(0.7), traits.Float(0.9), usedefault=True, desc="Levels of explained variance to include in " "plot", ) out_file = traits.Either(None, File, value=None, usedefault=True, desc="Path to save plot")
class MRPadInputSpec(CommandLineInputSpec): in_file = File(exists=True, argstr='%s', mandatory=True, position=-2, desc="Diffusion weighted images with graident info") out_file = File(genfile=True, argstr='%s', position=-1, desc="Extracted DW or b-zero images") axis = traits.Tuple( traits.Int(desc="index"), # @UndefinedVariable traits.Int(desc="lower"), # @UndefinedVariable traits.Int(desc='upper'), # @UndefinedVariable mandatory=False, argstr="-axis %s %s %s", # @UndefinedVariable @IgnorePep8 desc=("Pad the input image along the provided axis (defined by index)." "Lower and upper define the number of voxels to add to the lower" " and upper bounds of the axis")) uniform = File(mandatory=False, exists=True, argstr="-uniform %s", desc=("Pad the input image by a uniform number of voxels on" " all sides (in 3D)")) quiet = traits.Bool(mandatory=False, argstr="-quiet", desc="Don't display output during operation")
class SQLiteGrabberOutputSpec(TraitedSpec): """ This class represents a... :param TraitedSpec: """ results = traits.List(traits.Tuple(), desc='Results of query') query = traits.Str(desc='Query sent to database')
class ParseParamsInputSpec(BaseInterfaceInputSpec): params = traits.Dict(desc='Dictionnary to tap from') key = traits.Either(traits.String(), traits.Tuple(), desc='which key to tap from')
class PipelineReportInputSpec(TraitedSpec): subject_session_pairs = traits.List( traits.Tuple(traits.Str, traits.Str), desc="Subject & session pairs from per-session sink") subjects = traits.List(traits.Str, desc="Subjects from per-subject sink") visits = traits.List(traits.Str, desc="Visits from per_visit sink") project = traits.Str(desc="Project ID from per-project sink")