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 MaskVolumeInputSpec(BaseInterfaceInputSpec): preprocessedfile = File(exists=True, desc='original volume', mandatory=True) regfile = File(exists=True, desc='register .mat file', mandatory=True) parcfile = File(exists=True, desc='parcellation/segmentation file', mandatory=True) vol_source = traits.ListInt(exists=True, desc='source labels', mandatory=True) vol_target = traits.ListInt(exists=True, desc='target labels', mandatory=True)
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 PlotCoclassInputSpec(BaseInterfaceInputSpec): coclass_matrix_file = File(exists=True, desc='coclass matrix in npy format', mandatory=True) labels_file = File(exists=True, desc='labels of nodes', mandatory=False) list_value_range = traits.ListInt(desc='force the range of the plot', mandatory=False)
class sortingTimePointsOutputSpec(TraitedSpec): out_t_from = traits.ListInt( desc= 'list of time points sorted the same way as the 2 other output files.') files_trajectory_source = traits.List( File(exists=True, desc='list of the source.vtk file sorted by the time points')) files_xmlDiffeo = traits.List( File, desc= 'list of param Diffeo file, to be able to use the CP.txt files generated by ' + 'the shooting as initial CP position for the subsequent ' + 'SparseMatching3 function.') subject_id = traits.List(traits.String())
class Labels2ProbMapsInputSpec(CommandLineInputSpec): output_template = traits.Str( default='out_{label}.nii.gz', argstr='%s', position=0, desc='Template string for output files. Must contain {label}.') input_files = InputMultiPath(File(exists=True), mandatory=True, argstr='%s', position=1) labels = traits.ListInt(minlen=1, mandatory=True, argstr='--labels %s') bids_labels = traits.Bool( argstr='--bids_labels', desc= 'Assume label numbers correspond to then standard anatomical labels in BEP011' )
class MRDeGibbsInputSpec(MRTrix3BaseInputSpec): in_file = File( exists=True, argstr="%s", position=-2, mandatory=True, desc="input DWI image", ) axes = traits.ListInt( default_value=[0, 1], usedefault=True, sep=",", minlen=2, maxlen=2, argstr="-axes %s", desc="indicate the plane in which the data was acquired (axial = 0,1; " "coronal = 0,2; sagittal = 1,2", ) nshifts = traits.Int( default_value=20, usedefault=True, argstr="-nshifts %d", desc="discretization of subpixel spacing (default = 20)", ) minW = traits.Int( default_value=1, usedefault=True, argstr="-minW %d", desc="left border of window used for total variation (TV) computation " "(default = 1)", ) maxW = traits.Int( default_value=3, usedefault=True, argstr="-maxW %d", desc="right border of window used for total variation (TV) computation " "(default = 3)", ) out_file = File( name_template="%s_unr", name_source="in_file", keep_extension=True, argstr="%s", position=-1, desc="the output unringed DWI image", genfile=True, )
class STCParametersInputSpec(BaseInterfaceInputSpec): in_files = InputMultiPath( traits.File( desc="fMRI image file(s) from where to obtain the slice time " "correction parameters.", exists=True, mandatory=True)) num_slices = traits.Int( desc="Number of slices (depends on acquisition direction).") slice_order = traits.ListInt( desc="List of integers with the order in which slices are acquired.") time_repetition = traits.Float( desc="The time repetition (TR) of the input dataset in seconds. " "If left to default will read the TR from the nifti image header.", default=0) time_acquisition = traits.Float( desc= "Time of volume acquisition. usually calculated as TR-(TR/num_slices)." ) ref_slice = traits.Int(desc="Index of the slice of reference.") slice_mode = traits.Enum( 'unknown', 'seq_inc', 'seq_dec', 'alt_inc', 'alt_dec', 'alt_inc2', 'alt_dec2', desc="Slicing mode of the acquisition. \n" "Choices: \n" " 'unknown': auto detect if images are from Siemens and converted with dcm2nii" " from Nov 2013 or later #kNIFTI_SLICE_UNKNOWN\n" " 'seq_inc': sequential ascending kNIFTI_SLICE_SEQ_INC = 1; %1,2,3,4\n" " 'seq_dec': sequential descending kNIFTI_SLICE_SEQ_DEC = 2; %4,3,2,1\n" " 'alt_inc': Siemens: interleaved ascending with odd number of slices," " interleaved for other vendors kNIFTI_SLICE_ALT_INC = 3; %1,3,2,4\n" " 'alt_dec': descending interleaved kNIFTI_SLICE_ALT_DEC = 4; %4,2,3,1\n" " 'alt_inc2': Siemens interleaved ascending with even number of slices kNIFTI_SLICE_ALT_INC2 = 5; %2,4,1,3\n" " 'alt_dec2': Siemens interleaved descending with even number of slices kNIFTI_SLICE_ALT_DEC2 = 6; %3,1,4,2\n" "If left to default will try to detect the TR from the nifti image header, if it doesn't work" "an AttributeError exception will be raise.", default='unknown')
class STCParametersOutputSpec(TraitedSpec): in_files = InputMultiPath( traits.File( desc= "fMRI image file from where to obtain the slice time correction " "parameters.", exists=True, mandatory=True)) num_slices = traits.Int( desc="Number of slices (depends on acquisition direction).") slice_order = traits.ListInt( desc="List of integers with the order in which slices are acquired.") time_repetition = traits.Float( desc="The time repetition (TR) of the input dataset in seconds. " "If left to default will read the TR from the nifti image header.", default=0) time_acquisition = traits.Float( desc= "Time of volume acquisition. usually calculated as TR-(TR/num_slices)." ) ref_slice = traits.Int(desc="Index of the slice of reference.")
class PVProcessInputSpec(BaseInterfaceInputSpec): in_files = InputMultiPath( File(exists=True), copyfile=False, desc='image, or multi-channel set of images,' \ 'used for segmentation', mandatory=True ) in_maps = InputMultiPath(File(exists=True), copyfile=False, desc='Resulting tissue probability maps', mandatory=True) parameters = File( exists=True, desc='CSV file containing parameters for all the classes', mandatory=True) pure_tissues = traits.ListInt( value=[0, 2, 4], minlen=1, desc='Identifiers of the pure tissue classes') dist = traits.String(value="euclidean", desc="Distance definition to be used") reorder = traits.Bool( value=True, desc= 'Reorder classes if the classification is not ordered by first contrast means' )
class MRDeGibbsInputSpec(MRTrix3BaseInputSpec): in_file = File(exists=True, argstr='%s', position=-2, mandatory=True, desc='input DWI image') axes = traits.ListInt( default_value=[0, 1], usedefault=True, sep=',', minlen=2, maxlen=2, argstr='-axes %s', desc='indicate the plane in which the data was acquired (axial = 0,1; ' 'coronal = 0,2; sagittal = 1,2') nshifts = traits.Int( default_value=20, usedefault=True, argstr='-nshifts %d', desc='discretization of subpixel spacing (default = 20)') minW = traits.Int( default_value=1, usedefault=True, argstr='-minW %d', desc='left border of window used for total variation (TV) computation ' '(default = 1)') maxW = traits.Int( default_value=3, usedefault=True, argstr='-maxW %d', desc='right border of window used for total variation (TV) computation ' '(default = 3)') out_file = File(name_template='%s_unr', name_source='in_file', keep_extension=True, argstr='%s', position=-1, desc='the output unringed DWI image')
class T1xT2BETInputSpec(FSLCommandInputSpec): t1_file = File(exists=True, desc='Whole-head T1w image', mandatory=True, position=0, argstr="-t1 %s") t2_file = File(exists=True, desc='Whole-head T2w image', mandatory=True, position=1, argstr="-t2 %s") opt_os = traits.String( "_BET", usedefault=True, desc="Suffix for the brain masked images (default is _BET)", argstr="-os %s", mandatory=False) aT2 = traits.Bool( False, usedefault=True, argstr="-aT2", desc="Will coregrister T2w to T1w using flirt. Output will have the\ suffix provided. Will only work for spatially close images.", mandatory=False) # as -> opt_as, as is already a part of python keywords... opt_as = traits.String("-in-T1w", usedefault=True, argstr="-as %s", desc="Suffix for T2w to T1w registration \ (\"-in-T1w\" if not specified)", mandatory=False) n = traits.Int( 1, usedefault=True, desc='n = the number of iterations BET will be run to find center of \ gravity (n=1 if option -n is absent)', argstr="-n %d", mandatory=False) m = traits.Bool(False, usedefault=True, argstr="-m", desc="Will output the BET mask at the format \ output_prefixT1_mask.nii.gz)", mandatory=False) ms = traits.String("_mask", usedefault=True, desc="Suffix for the mask (default is _mask)", argstr="-ms %s", mandatory=False) c = traits.Int( desc='Will crop the inputs & outputs after brain extraction. c is the \ space between the brain and the limits of the crop box expressed \ in percentage of the brain size (eg. if the brain size is 200\ voxels in one dimension and c=10: the sides of the brain in this \ dimension will be 20 voxels away from the borders of the resulting\ crop box in this dimension).', argstr="-c %d", mandatory=False) cs = traits.String( "_cropped", usedefault=True, desc="Suffix for the cropped images (default is _cropped)", argstr="-cs %s", mandatory=False) f = traits.Float( 0.5, usedefault=True, desc='-f options of BET: fractional intensity threshold (0->1); \ default=0.5; smaller values give larger brain outline estimates', argstr="-f %f", mandatory=False) g = traits.Float(0.0, usedefault=True, desc='-g options of BET:\ vertical gradient in fractional intensity threshold (-1->1);\ default=0; positive values give larger brain outline at\ bottom, smaller at top', argstr="-g %f", mandatory=False) cog = traits.ListInt( desc='For difficult cases, you can directly provide a center of \ gravity. Only one iteration will be performed.', argstr="-cog %d %d %d", mandatory=False) k = traits.Bool(False, usedefault=True, argstr="-k", desc="Will keep temporary files", mandatory=False) p = traits.String(desc="Prefix for running FSL functions\ (can be a path or just a prefix)", argstr="-p %s", mandatory=False)
class MergeLabelsInputSpec(BaseInterfaceInputSpec): in_file = File(exists=True, mandatory=True, desc="Input roi file") roi_list = traits.ListInt(mandatory=True, desc="List containing the label index to use")
class _AntsJointFusionInputSpec(ANTSCommandInputSpec): dimension = traits.Enum(3, 2, 4, argstr='-d %d', desc='This option forces the image to be treated ' 'as a specified-dimensional image. If not ' 'specified, the program tries to infer the ' 'dimensionality from the input image.') target_image = traits.List(base.InputMultiPath(base.File(exists=True)), argstr='-t %s', mandatory=True, desc='The target image (or ' 'multimodal target images) assumed to be ' 'aligned to a common image domain.') atlas_image = traits.List(base.InputMultiPath(base.File(exists=True)), argstr="-g %s...", mandatory=True, desc='The atlas image (or ' 'multimodal atlas images) assumed to be ' 'aligned to a common image domain.') atlas_segmentation_image = base.InputMultiPath( base.File(exists=True), argstr="-l %s...", mandatory=True, desc='The atlas segmentation ' 'images. For performing label fusion the number ' 'of specified segmentations should be identical ' 'to the number of atlas image sets.') alpha = traits.Float( default_value=0.1, usedefault=True, argstr='-a %s', desc=( 'Regularization ' 'term added to matrix Mx for calculating the inverse. Default = 0.1' )) beta = traits.Float( default_value=2.0, usedefault=True, argstr='-b %s', desc=('Exponent for mapping ' 'intensity difference to the joint error. Default = 2.0')) retain_label_posterior_images = traits.Bool( False, argstr='-r', usedefault=True, requires=['atlas_segmentation_image'], desc=('Retain label posterior probability images. Requires ' 'atlas segmentations to be specified. Default = false')) retain_atlas_voting_images = traits.Bool( False, argstr='-f', usedefault=True, desc=('Retain atlas voting images. Default = false')) constrain_nonnegative = traits.Bool( False, argstr='-c', usedefault=True, desc=('Constrain solution to non-negative weights.')) patch_radius = traits.ListInt(minlen=3, maxlen=3, argstr='-p %s', desc=('Patch radius for similarity measures.' 'Default: 2x2x2')) patch_metric = traits.Enum( 'PC', 'MSQ', argstr='-m %s', desc=('Metric to be used in determining the most similar ' 'neighborhood patch. Options include Pearson\'s ' 'correlation (PC) and mean squares (MSQ). Default = ' 'PC (Pearson correlation).')) search_radius = traits.List( [3, 3, 3], minlen=1, maxlen=3, argstr='-s %s', usedefault=True, desc=('Search radius for similarity measures. Default = 3x3x3. ' 'One can also specify an image where the value at the ' 'voxel specifies the isotropic search radius at that voxel.')) exclusion_image_label = traits.List( traits.Str(), argstr='-e %s', requires=['exclusion_image'], desc=('Specify a label for the exclusion region.')) exclusion_image = traits.List( base.File(exists=True), desc=('Specify an exclusion region for the given label.')) mask_image = base.File( argstr='-x %s', exists=True, desc='If a mask image ' 'is specified, fusion is only performed in the mask region.') out_label_fusion = base.File(argstr="%s", hash_files=False, desc='The output label fusion image.') out_intensity_fusion_name_format = traits.Str( argstr="", desc='Optional intensity fusion ' 'image file name format. ' '(e.g. "antsJointFusionIntensity_%d.nii.gz")') out_label_post_prob_name_format = traits.Str( 'antsJointFusionPosterior_%d.nii.gz', requires=['out_label_fusion', 'out_intensity_fusion_name_format'], desc='Optional label posterior probability ' 'image file name format.') out_atlas_voting_weight_name_format = traits.Str( 'antsJointFusionVotingWeight_%d.nii.gz', requires=[ 'out_label_fusion', 'out_intensity_fusion_name_format', 'out_label_post_prob_name_format' ], desc='Optional atlas voting weight image ' 'file name format.') verbose = traits.Bool(False, argstr="-v", desc=('Verbose output.'))
class RealignUnwarpInputSpec(SPMCommandInputSpec): scans = traits.Either(traits.List(File(exists=True)), File(exists=True), mandatory=True, copyfile=True, field='data.scans', desc='scans for this session') pmscan = File(mandatory=True, exists=True, copyfile=False, field='data.pmscan', desc='phase map (vdm* file)') # Estimation Options quality = traits.Range(low=0.0, high=1.0, field='eoptions.quality', desc='0.1 = fast, 1.0 = precise') fwhm = traits.Range(low=0.0, field='eoptions.fwhm', desc='gaussian smoothing kernel width') separation = traits.Range(low=0.0, field='eoptions.sep', desc='sampling separation in mm') register_to_mean = traits.Bool( field='eoptions.rtm', desc='Indicate whether realignment is done to the mean image') weight_img = File(exists=True, field='eoptions.weight', desc='filename of weighting image') interp = traits.Range(low=0, high=7, field='eoptions.interp', desc='degree of b-spline used for interpolation') wrap = traits.List(traits.Int(), minlen=3, maxlen=3, field='eoptions.wrap', desc='Check if interpolation should wrap in [x,y,z]') # Unwarp Options basfcn = traits.List(traits.Int(), minlen=2, maxlen=2, field='uweoptions.basfcn', desc='basic functions') regorder = traits.Range(low=0, high=3, field='uweoptions.regorder', desc='regularization') regfactor = traits.Range(low=0, field='uweoptions.lambda', desc='regularization factor') jm = traits.Bool(field='uweoptions.jm', desc='Jacobian deformations') fot = traits.List(traits.Int(), minlen=2, maxlen=2, field='uweoptions.fot', desc='first-order effects') sot = traits.List(traits.Int(), minlen=2, maxlen=2, field='uweoptions.sot', desc='second-order effects') uwfwhm = traits.Range(low=0, field='uweoptions.uwfwhm', desc='smoothing for unwarp') rem = traits.Bool(field='uweoptions.rem', desc='') noi = traits.Range(low=0, field='uweoptions.noi', desc='maximum number of iterations') expround = traits.Enum('Average', 'First', 'Last', field='uweoptions.expround', desc='one of: Average, First, Last') # Reslice Options write_which = traits.ListInt([2, 1], minlen=2, maxlen=2, usedefault=True, field='uwroptions.uwwhich', desc='determines which images to reslice') write_interp = traits.Range( low=0, high=7, field='uwroptions.rinterp', desc='degree of b-spline used for interpolation') write_wrap = traits.List( traits.Int(), minlen=3, maxlen=3, field='uwroptions.wrap', desc='Check if interpolation should wrap in [x,y,z]') write_mask = traits.Bool(field='uwroptions.mask', desc='True/False mask output image') out_prefix = traits.String('u', usedefault=True, field='uwroptions.prefix', desc='realigned output prefix')
class _AntsJointFusionInputSpec(ANTSCommandInputSpec): dimension = traits.Enum( 3, 2, 4, argstr="-d %d", desc="This option forces the image to be treated " "as a specified-dimensional image. If not " "specified, the program tries to infer the " "dimensionality from the input image.", ) target_image = traits.List( base.InputMultiPath(base.File(exists=True)), argstr="-t %s", mandatory=True, desc="The target image (or " "multimodal target images) assumed to be " "aligned to a common image domain.", ) atlas_image = traits.List( base.InputMultiPath(base.File(exists=True)), argstr="-g %s...", mandatory=True, desc="The atlas image (or " "multimodal atlas images) assumed to be " "aligned to a common image domain.", ) atlas_segmentation_image = base.InputMultiPath( base.File(exists=True), argstr="-l %s...", mandatory=True, desc="The atlas segmentation " "images. For performing label fusion the number " "of specified segmentations should be identical " "to the number of atlas image sets.", ) alpha = traits.Float( default_value=0.1, usedefault=True, argstr="-a %s", desc=( "Regularization " "term added to matrix Mx for calculating the inverse. Default = 0.1" ), ) beta = traits.Float( default_value=2.0, usedefault=True, argstr="-b %s", desc=("Exponent for mapping " "intensity difference to the joint error. Default = 2.0"), ) retain_label_posterior_images = traits.Bool( False, argstr="-r", usedefault=True, requires=["atlas_segmentation_image"], desc=("Retain label posterior probability images. Requires " "atlas segmentations to be specified. Default = false"), ) retain_atlas_voting_images = traits.Bool( False, argstr="-f", usedefault=True, desc=("Retain atlas voting images. Default = false"), ) constrain_nonnegative = traits.Bool( False, argstr="-c", usedefault=True, desc=("Constrain solution to non-negative weights."), ) patch_radius = traits.ListInt( minlen=3, maxlen=3, argstr="-p %s", desc=("Patch radius for similarity measures." "Default: 2x2x2"), ) patch_metric = traits.Enum( "PC", "MSQ", argstr="-m %s", desc=("Metric to be used in determining the most similar " "neighborhood patch. Options include Pearson's " "correlation (PC) and mean squares (MSQ). Default = " "PC (Pearson correlation)."), ) search_radius = traits.List( [3, 3, 3], minlen=1, maxlen=3, argstr="-s %s", usedefault=True, desc=("Search radius for similarity measures. Default = 3x3x3. " "One can also specify an image where the value at the " "voxel specifies the isotropic search radius at that voxel."), ) exclusion_image_label = traits.List( traits.Str(), argstr="-e %s", requires=["exclusion_image"], desc=("Specify a label for the exclusion region."), ) exclusion_image = traits.List( base.File(exists=True), desc=("Specify an exclusion region for the given label."), ) mask_image = base.File( argstr="-x %s", exists=True, desc="If a mask image " "is specified, fusion is only performed in the mask region.", ) out_label_fusion = base.File(argstr="%s", hash_files=False, desc="The output label fusion image.") out_intensity_fusion_name_format = traits.Str( argstr="", desc="Optional intensity fusion " "image file name format. " '(e.g. "antsJointFusionIntensity_%d.nii.gz")', ) out_label_post_prob_name_format = traits.Str( "antsJointFusionPosterior_%d.nii.gz", requires=["out_label_fusion", "out_intensity_fusion_name_format"], desc="Optional label posterior probability " "image file name format.", ) out_atlas_voting_weight_name_format = traits.Str( "antsJointFusionVotingWeight_%d.nii.gz", requires=[ "out_label_fusion", "out_intensity_fusion_name_format", "out_label_post_prob_name_format", ], desc="Optional atlas voting weight image " "file name format.", ) verbose = traits.Bool(False, argstr="-v", desc=("Verbose output."))