class LFComputationConnInputSpec(BaseInterfaceInputSpec): sbj_id = traits.String(desc='subject id', mandatory=True) sbj_dir = traits.String(exists=True, desc='Freesurfer main directory', mandatory=True) raw_info = traits.Any(desc='raw info', mandatory=True) raw_fname = traits.String(desc='raw file name', mandatory=True) spacing = traits.String(desc='spacing to use to setup a source space', mandatory=False) aseg = traits.Bool(desc='if true sub structures will be considered', mandatory=False) aseg_labels = traits.List(desc='list of substructures in the src space', mandatory=False) save_mixed_src_space = traits.Bool(False, desc='if true save src space', usedefault=True, mandatory=False)
class ROI_stats_to_spreadsheetInputSpec(BaseInterfaceInputSpec): imgFile = File(exists=True, desc='Image list', mandatory=True) labelImgFile = File(exists=True, desc='Label image list', mandatory=True) ROI_list = traits.List( traits.Int(), minlen=1, desc= 'list of ROI indices for which stats will be computed (should match the label indices in the label image)', mandatory=True) ROI_names = traits.List( traits.String(), minlen=1, desc= 'list of equal size to ROI_list that lists the corresponding ROI names', mandatory=True) additionalROIs = traits.List(traits.List(traits.Int()), desc='list of lists of integers') additionalROI_names = traits.List( traits.String(), desc='names corresponding to additional ROIs') stat = traits.Enum('mean', 'Q1', 'median', 'Q3', 'min', 'max', desc='one of: mean, Q1, median, Q3, min, max', mandatory=True)
class FuseSegmentationsInputSpec(FSTraitedSpec): # required subject_id = traits.String(argstr='%s', position=-3, desc="subject_id being processed") timepoints = InputMultiPath( traits.String(), mandatory=True, argstr='%s', position=-2, desc='subject_ids or timepoints to be processed') out_file = File(exists=False, mandatory=True, position=-1, desc="output fused segmentation file") in_segmentations = InputMultiPath( File(exists=True), argstr="-a %s", mandatory=True, desc="name of aseg file to use (default: aseg.mgz) \ must include the aseg files for all the given timepoints") in_segmentations_noCC = InputMultiPath( File(exists=True), argstr="-c %s", mandatory=True, desc="name of aseg file w/o CC labels (default: aseg.auto_noCCseg.mgz) \ must include the corresponding file for all the given timepoints") in_norms = InputMultiPath( File(exists=True), argstr="-n %s", mandatory=True, desc="-n <filename> - name of norm file to use (default: norm.mgs) \ must include the corresponding norm file for all given timepoints \ as well as for the current subject")
class WriteXMLFilesInputSpec(BaseInterfaceInputSpec): # import datetime # now = datetime.datetime.now() today_date = 'today' #now.strftime("%Y_%b_%d") # %Y_%b_%dT%Hh%M type_xml_file = traits.Enum( 'All', 'Def', 'Obj', usedefault=True, desc="'Def' to write the deformation xml file. " + "'Obj' for the object parameter xml file. " + "'All' to write both files", mandatory=True) path = traits.String( desc=" path where the xml_files folder will be created.") dkw = traits.Int(desc=' Diffeo Kernel width ', default_value=10) dkt = traits.String("Exact", desc=' Diffeo Kernel type ', usedefault=True) dtp = traits.Int(desc=' Diffeo: number of time points', default_value=30) dsk = traits.Float(desc=' Diffeo: smoothing kernel width ', default_value=0.5) dcps = traits.Int(desc="Diffeos: Initial spacing for Control Points", usedefault=True, default_value=5) dcpp = File( 'x', desc= "Diffeos: name of a file containing positions of control points. In case of conflict with " + "initial-cp-spacing, if a file name is given in initial-cp-position and initial-cp-spacing " + "is set, the latter is ignored and control point positions in the file name are used.", usedefault=True) dfcp = traits.String('Off', desc="Diffeos: Freeze the Control Points", usedefault=True) dmi = traits.Int(desc="Diffeos : Maximum of descent iterations", usedefault=True, default_value=100) dat = traits.Float( desc="Diffeos : adaptative tolerence for the gradient descent", usedefault=True, default_value=0.00005) dls = traits.Int(desc="Diffeos: Maximum line search iterations", usedefault=True, default_value=20) ods = traits.ListFloat( desc="Object: weight of the object in the fidelity-to-data term ", usedefault=True, default_value=[0.5]) okw = traits.ListInt(default_value=[3], desc="Object: Kernel width", usedefault=True) ot = traits.List(["NonOrientedSurfaceMesh"], desc="Object type", usedefault=True) xml_diffeo = traits.String( 'parametersDiffeo' + today_date + '.xml', desc='Name of the xml file containing the diffeo parameters', usedefault=True)
class EPIDeWarpInputSpec(FSLCommandInputSpec): mag_file = File(exists=True, desc='Magnitude file', argstr='--mag %s', position=0, mandatory=True) dph_file = File(exists=True, desc='Phase file assumed to be scaled from 0 to 4095', argstr='--dph %s', mandatory=True) exf_file = File(exists=True, desc='example func volume (or use epi)', argstr='--exf %s') epi_file = File(exists=True, desc='EPI volume to unwarp', argstr='--epi %s') tediff = traits.Float(2.46, usedefault=True, desc='difference in B0 field map TEs', argstr='--tediff %s') esp = traits.Float(0.58, desc='EPI echo spacing', argstr='--esp %s', usedefault=True) sigma = traits.Int(2, usedefault=True, argstr='--sigma %s', desc="2D spatial gaussing smoothing \ stdev (default = 2mm)") vsm = traits.String(genfile=True, desc='voxel shift map', argstr='--vsm %s') exfdw = traits.String(desc='dewarped example func volume', genfile=True, argstr='--exfdw %s') epidw = traits.String(desc='dewarped epi volume', genfile=False, argstr='--epidw %s') tmpdir = traits.String(genfile=True, desc='tmpdir', argstr='--tmpdir %s') nocleanup = traits.Bool(True, usedefault=True, desc='no cleanup', argstr='--nocleanup') cleanup = traits.Bool(desc='cleanup', argstr='--cleanup')
class ImportBrainVisionAsciiInputSpec(BaseInterfaceInputSpec): """Import brainvision ascii input spec.""" txt_file = File(exists=True, desc='Ascii text file exported from BrainVision', mandatory=True) sample_size = traits.Float(desc='Size (nb of time points) of all samples', mandatory=True) sep_label_name = traits.String("", desc='Separator between electrode name \ (normally a capital letter) and \ contact numbers', usedefault=True) repair = traits.Bool(True, desc='Repair file if behaves strangely (adding \ space sometimes...)', usedefault=True) sep = traits.Str(";", desc="Separator between time points", usedefault=True) keep_electrodes = traits.String("", desc='keep_electrodes', usedefault=True)
class MaskSurfaceInputSpec(BaseInterfaceInputSpec): sxfmout = File(exists=True, desc='original surface', mandatory=True) hemi = traits.String(exists=True, desc='hemisphere', mandatory=True) fs = traits.String(exists=True, desc='fsaverage', mandatory=True) freesurferdir = traits.String(exists=True, desc='freesurfer directory', mandatory=True) sourcelabels = traits.ListInt(exists=True, desc= 'source labels', mandatory=True) targetlabels = traits.ListInt(exists=True, desc= 'target labels', mandatory=True)
class DiffInputSpec(QI.InputBaseSpec): # Options in_file = traits.String(desc='Input file', argstr='--input=%s') baseline = traits.String(desc='Baseline file', argstr='--baseline=%s') noise = traits.Float(desc='Added noise level', argstr='--noise=%f') abs_diff = traits.Bool(desc='Use absolute difference, not relative', argstr='--abs')
class RenameInputSpec(DynamicTraitedSpec): in_file = File(exists=True, mandatory=True, desc="file to rename") keep_ext = traits.Bool( desc="Keep in_file extension, replace non-extension component of name") format_string = traits.String( mandatory=True, desc="Python formatting string for output template") parse_string = traits.String( desc="Python regexp parse string to define replacement inputs")
class SubjectSpaceParcellationInputSpec(BaseInterfaceInputSpec): subject_id = traits.String(desc='subject ID') subjects_dir = File(exist=True, desc='FreeSufer subject directory') source_subject = traits.String(desc='subject ID') source_annot_file = File(exist=True, desc='annotation file to be transformed') parcellation_directory = File(desc='directory containing the subjects parcellations') out_directory = File( exist=True, desc='directory where FreeSurfer output should be directed') wm = File(exit=True, desc='segmented white matter image')
class AtlasTransformInputSpec(TraitedSpec): nifti = traits.Any(mandatory=True, desc='input nifti') atlas_name = traits.String(mandatory=True, desc='atlas name') bids_dir = traits.String(mandatory=True, desc='atlas name') resolution = traits.Int(mandatory=False, desc='resolution (for shen atlas)') number_of_clusters = traits.Int(mandatory=False, desc='for craddock') similarity_measure = traits.String(mandatory=False, desc='for craddock') algorithm = traits.String(mandatory=False, desc='for craddock')
class GetDPInputSpec(CommandLineInputSpec): problem_file = File(exists=True, argstr="%s", position=1, mandatory=True) mesh_file = File(exists=True, mandatory=True, argstr="-msh %s", desc="Read mesh (in Gmsh .msh format) from file") adapatation_constraint_file = File( exists=True, argstr="-adapt %s", desc="Read adaptation constraints from file") gmsh_read_file = File( exists=True, argstr="-gmshread %s", desc="Read gmsh data (same as GmshRead in resolution)") results_file = File(exists=True, argstr="-res %s", desc="Load processing results from file(s)") preprocessing_type = traits.String(argstr="-pre %s", desc="Pre-processing") run_processing = traits.Bool(argstr='-cal', desc="Run processing") postprocessing_type = traits.String(argstr="-post %s", desc="Post-processing") save_results_separately = traits.Bool( argstr='-split', desc="Save processing results in separate files") restart_processing = traits.Bool( argstr='-restart', desc="Resume processing from where it stopped") solve = traits.String(argstr="-solve %s", desc="Solve (same as -pre 'Resolution' -cal)") output_name = traits.String("getdp", argstr="-name %s", usedefault=True, desc="Generic file name") maximum_interpolation_order = traits.Int( argstr='-order %d', desc="Restrict maximum interpolation order") # Linear solver options binary_output_files = traits.Bool(argstr='-bin', desc="Create binary output files") mesh_based_output_files = traits.Bool( argstr='-v2', desc="Create mesh-based Gmsh output files when possible") out_table_filenames = traits.List( traits.Str, desc="List of table text files generated by the specified problem file. \ If tables are written during the GetDP solving process, this is required for Nipype to find the proper output files for the interface." ) out_pos_filenames = traits.List( traits.Str, desc="List of postprocessing (.pos) files generated by the specified \ problem file. If tables are written during the GetDP solving process, this is required for Nipype to find the proper \ output files for the interface.")
class Aparc2AsegInputSpec(CommandLineInputSpec): subject = traits.String(desc='subject id', argstr='--s %s', position=0, mandatory=True) annot = traits.String(desc='name of annot file', argstr='--annot %s', position=1, mandatory=True) labelwm = traits.Bool(desc='percolate white matter', argstr='--labelwm', position=2) dmax = traits.Int(desc='depth to percolate', argstr='--wmparc-dmax %d', position=3) rip = traits.Bool(desc='rip unknown label', argstr='--rip-unknown', position=4) hypo = traits.Bool(desc='hypointensities as wm', argstr='--hypo-as-wm', position=5) out_file = traits.File(desc='output aseg file', argstr='--o %s', position=6) in_lobes_rh = traits.File(desc='input lobar file RH', exists=True) in_lobes_lh = traits.File(desc='input lobar file LH', exists=True)
class ReferenceInputSpec(MatlabInputSpec): data_file = traits.File(exists=True, desc='FieldTrip data structure .mat', mandatory=True) ft_path = traits.String('', desc='FieldTrip path', mandatory=True) channels = traits.String('', desc='channel names') # updatesens = traits.String('', desc='update sensors (yes or no)', usedefault=True) # noqa refmethod = traits.String('', desc='reference type (avg, bipolar)', mandatory=True) # noqa
class CompIcaInputSpec(BaseInterfaceInputSpec): """Input specification for CompIca.""" fif_file = traits.File(exists=True, desc='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)
class AtlasBREXInputSpec(CommandLineInputSpec): import os package_directory = os.path.dirname(os.path.abspath(__file__)) script_atlas_BREX = File('{}/../bash/atlasBREX.sh'.format( package_directory), usedefault=True, exists=True, desc='atlasBREX script', mandatory=False, position=0, argstr="%s") NMT_SS_file = File( exists=True, desc='Skullstriped version of the template', mandatory=True, position=1, argstr="-b %s") NMT_file = File( exists=True, desc='template img', mandatory=True, position=2, argstr="-nb %s") t1_restored_file = File( exists=True, desc='T1 image to map', mandatory=True, position=3, argstr="-h %s") f = traits.Float( 0.5, usedefault=True, desc='f', position=4, argstr="-f %f", mandatory=True) wrp = traits.String( "10,10,10", usedefault=True, desc="wrp", position=5, argstr="-wrp %s", mandatory=True) reg = traits.Enum( 1, 0, 2, 3, usedefault=True, desc="Method: 0 = FNIRT w/ bending, \ 1 (default) = FNIRT membrane-energy regularization, \ 2 = ANTs/SyN w/, \ 3 = w/o N4Bias", position=6, argstr="-reg %d", mandatory=True) msk = traits.String( "a,0,0", usedefault=True, desc="msk", position=7, argstr="-msk %s", mandatory=True) dil = traits.Int(desc="dil", argstr="-dil %d") nrm = traits.Enum(1, 2, desc="nrm", argstr="-nrm %d") vox = traits.Int(desc="vox", argstr="-vox %d") args = traits.String(desc="args", position=-1, argstr=" %s", mandatory=False)
class ZShimInputSpec(base.InputBaseSpec): in_file = File(argstr='%s', mandatory=True, exists=True, position=-1, desc='Input file to fit polynomial to') zshims = traits.Int(argstr='--zshims=%d', desc='Number of Z-shims') yshims = traits.Int(argstr='--yshims=%d', desc='Number of Y-shums') prefix = traits.String(argstr='--out=%s', desc='Output prefix (default is input filename)') noiseregion = traits.String(desc='Noise region for background correction', argstr='--noiseregion=%s')
class SignalExtractionInputSpec(BaseInterfaceInputSpec): in_file = File(exists=True, mandatory=True) time_series_out_file = File(mandatory=True) correlation_matrix_out_file = File(mandatory=True) image_parcellation_path = traits.String(mandatory=True) labels_parcellation_path = traits.Either( traits.String(), traits.ArrayOrNone()) mask_img = File(mandatory=True) tr = traits.Float(mandatory=True) low_pass = traits.Float(default_value=None) high_pass = traits.Float(default_value=None) plot = traits.Bool(default_value=False, mandatory=False)
class NiftiToDatasetInputSpec(BaseInterfaceInputSpec): nifti_file = File(desc='nifti file to convert to ML dataset format', exists=True, mandatory=True) attributes_file = File(desc='attribute file containing information for ML', exists=True) annot_file = File( desc='annotation file containing parcelation information', exists=True) subject_id = traits.String(desc='unique subject identifier') session_id = traits.String(desc='unique session identifier') ds_file = traits.String('dataset.hdf5', desc='name of ds file', usedefault=True)
class RenameInputSpec(DynamicTraitedSpec): in_file = File(exists=True, mandatory=True, desc="file to rename") keep_ext = traits.Bool(desc=("Keep in_file extension, replace " "non-extension component of name")) format_string = traits.String(mandatory=True, desc=("Python formatting string for output " "template")) parse_string = traits.String(desc=("Python regexp parse string to define " "replacement inputs")) use_fullpath = traits.Bool(False, usedefault=True, desc="Use full path as input to regex parser")
class InputSpec(InputBaseSpec): """ Input Specification for most QUIT tools """ json = traits.File(exists=True, desc='JSON Input file', argstr='--json=%s') subregion = traits.String( desc='Only process a subregion of the image. Argument should be a string "start_x,start_y,start_z,size_x,size_y,size_z"', argstr='--subregion=%s') 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') mask_file = File( desc='Only process voxels within the mask', argstr='--mask=%s')
class ImportMatInputSpec(BaseInterfaceInputSpec): """Input specification for ImportMat.""" tsmat_file = traits.File(exists=True, desc='time series in .mat (matlab format)', mandatory=True) data_field_name = traits.String('F', desc='Name of structure in matlab', usedefault=True) good_channels_field_name = traits.String('ChannelFlag', desc='Boolean structure for\ choosing nodes, name of\ structure in matlab file')
class ClusterInputSpec(BaseInterfaceInputSpec): in_File = File(exists=True, desc='surface to be clustered', mandatory=True) hemi = traits.String(exists=True, desc='hemisphere', mandatory=True) cluster_type = traits.String( exists=True, desc='spectral, hiercluster, kmeans, or dbscan', mandatory=True) n_clusters = traits.Int(exists=True, desc='number of clusters', mandatory=True) epsilon = traits.Float(exists=True, desc='epsilon parameter for dbscan', mandatory=False)
class AtroposN4InputSpec(CommandLineInputSpec): dimension = traits.Int(3, default=True, usedefault=True, exists=True, desc='Dimension', mandatory=True, position=0, argstr="-d %d") brain_file = File(exists=True, desc='brain_file', mandatory=True, position=1, argstr="-a %s") brainmask_file = File(exists=True, desc='brainmask_file', mandatory=True, position=2, argstr="-x %s") numberOfClasses = traits.Int(3, usedefault=True, exists=True, desc='numberOfClasses', mandatory=True, position=3, argstr="-c %d") out_pref = traits.String("segment_", usedefault=True, desc="output prefix", mandatory=True, position=-1, argstr="-o %s") priors = traits.Either(traits.List(File(exists=True)), traits.String(), desc='template_file', mandatory=False, position=4, argstr="-p %s") prior_weight = traits.Float(0, desc='Atropos prior segmentation weight', mandatory=False, position=5, argstr="-w %f")
class PCAInputSpec(QI.InputSpec): in_file = File(argstr='%s', mandatory=True, exists=True, position=-1, desc='Input file for PCA denoising') retain = traits.Int(argstr='--retain=%d', desc='Number of PCs to retain') mask_file = File(argstr='--mask=%s', exists=True, desc='Mask file') projections_file = traits.String(argstr='--project=%s', desc='File to save projections to') pc_json_file = traits.String(argstr='--save_pcs=%s', desc='Save Principal Components to JSON file') out_file = traits.String(argstr='--out=%s', desc='Name of output file (default is input_pca)')
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 ASLInputSpec(QI.FitInputSpec): # Additional Options average = traits.Bool( desc='Average across time-series', argstr='--average') T1_blood = traits.Float( desc='Value of blood T1 (default 1.65)', argstr='--blood=%f') T1_tissue = traits.String( desc='Path to tissue T1 map (units are seconds)', argstr='--tissue=%s') PD_map = traits.String(desc='Path to PD weighted image', argstr='--pd=%s') label_efficiency = traits.Float( desc='Labelling efficiency, default 0.9', argstr='--alpha=%f') blood_brain_partition = traits.Float( desc='Blood-Brain Partition Co-efficient, default 0.9 mL/g', argstr='--lambda=%f') slicetime = traits.Bool( desc='Apply slice-timing correction (number of PLDs and slices must match)', argstr='--slicetime')
class PETtoT1LinRegInput(BaseInterfaceInputSpec): in_target_file = File(position=0, argstr="%s", exists=True, mandatory=True, desc="target image") in_source_file = File(position=1, argstr="%s", exists=True, mandatory=True, desc="source image") in_target_mask = File(position=2, argstr="-source_mask %s", exists=True, desc="target mask") in_source_mask = File(position=3, argstr="-target_mask %s", exists=True, desc="source mask") init_file_xfm = File(argstr="-init_xfm %s", exists=True, desc="initial transformation (default identity)") out_file_xfm = File(position=-3, argstr="%s", desc="transformation matrix") out_file_xfm_invert = File(position=-2, argstr="%s", desc="inverted transformation matrix") out_file_img = File(position=-1, argstr="%s", desc="resampled image") lsq = traits.String(desc="Number of parameters to use for transformation") metric = traits.String(desc="Metric for coregistration", default="mi", use_default=True) error = traits.String(desc="Error level by which to mis-register PET image") clobber = traits.Bool(position=-5, argstr="-clobber", usedefault=True, default_value=True, desc="Overwrite output file") run = traits.Bool(position=-4, argstr="-run", usedefault=True, default_value=True, desc="Run the commands") verbose = traits.Bool(position=-3, argstr="-verbose", usedefault=True, default_value=True, desc="Write messages indicating progress")
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 tensor2metricInputSpec(MRTrix3BaseInputSpec): input_file = File(exists=True, argstr="%s", mandatory=True, position=-4, desc="input DTI") vector_file = File( argstr="-vector %s", mandatory=False, position=-1, desc="compute the selected eigenvector(s) of the diffusion tensor.") fa_file = File( argstr="-fa %s", mandatory=False, position=-1, desc="compute the fractional anisotropy (FA) of the diffusion tensor.") adc_file = File( argstr="-adc %s", mandatory=False, position=-1, desc= "compute the mean apparent diffusion coefficient (ADC) of the diffusion tensor" ) modulate = traits.String(argstr="-modulate %s", mandatory=False, position=-3, desc="specify how to modulate (deault = FA)") num = traits.Int(argstr="-num %d", mandatory=False, position=-2, desc="specify the desired eigenvalue/eigenvector(s)")