class MontageSolverSchema(ArgSchema): data_dir = InputDir( required=False, description="directory containing metafile, images, and matches") metafile = InputFile( required=False, description=("fullpath to metafile. Helps in the case of multiple" " metafiles in one directory. data_dir will take " " os.path.dirname(metafile)")) output_dir = OutputDir(required=False, missing=None, default=None, description="directory for output files") read_transform_from = Str( required=False, missing='metafile', default='metafile', validator=mm.validate.OneOf(['metafile', 'reffile', 'dict']), description="3 possible ways to read in the reference transform") ref_transform = InputFile(required=False, missing=None, default=None, description="transform json") ref_transform_dict = Dict(require=False, missing=None, description="transform in from memory") ransacReprojThreshold = Float( required=False, missing=10.0, default=10.0, description=("passed into cv2.estimateAffinePartial2D()" "for RANSAC filtering of montage template matches")) compress_output = Boolean( required=False, missing=True, default=True, description=("tilespecs will be .json or .json.gz")) solver_templates = List( Str, required=True, description="input json basenames for the solver args") solver_template_dir = InputDir( required=True, description="location of the templates for the solver") @mm.post_load def check_solver_inputs(self, data): for args in data['solver_templates']: argpath = os.path.join(data['solver_template_dir'], args) if not os.path.isfile(argpath): raise mm.ValidationError("solver arg file doesn't exist: %s" % argpath) @mm.post_load def check_metafile(self, data): if ('data_dir' not in data) & ('metafile' not in data): raise mm.ValidationError(" must specify either data_dir" " or metafile")
class AutomergingParams(DefaultSchema): merge_threshold = Float( required=True, default=2.5, help='Minimum merge score required to perform a merge') distance_to_compare = Int( required=True, default=5, help='Distance (in channels) to look for potential merges')
class OutputParameters(OutputSchema): execution_time = Float() kilosort_commit_hash = String() kilosort_commit_date = String() mask_channels = NumpyArray() nTemplate = Int() nTot = Int()
class InputParameters(ArgSchema): stimulus = Nested(StimulusInputParameters, required=True, help='Defines the stimulus from which CSD is calculated') probes = Nested(ProbeInputParameters, many=True, required=True, help='Probewise parameters.') pre_stimulus_time = Float( required=True, help='how much time pre stimulus onset is used for CSD calculation ') post_stimulus_time = Float( required=True, help='how much time post stimulus onset is used for CSD calculation ') num_trials = Int( default=None, allow_none=True, help='Number of trials after stimulus onset from which to compute CSD') volts_per_bit = Float( default=1.0, help= 'If the data are not in units of volts, they must be converted. In the past, this value was 0.195' ) memmap = Bool( default=False, help= 'whether to memory map the data file on disk or load it directly to main memory' ) memmap_thresh = Float( default=np.inf, help= 'files larger than this threshold (bytes) will be memmapped, regardless of the memmap setting.' ) filter_cuts = List(Float, default=[5.0, 150.0], cli_as_single_argument=True, help='Cutoff frequencies for bandpass filter') filter_order = Int(default=5, help='Order for bandpass filter') reorder_channels = Bool( default=True, help='Determines whether LFP channels should be re-ordered') noisy_channel_threshold = Float( default=1500.0, help='Threshold for removing noisy channels from analysis')
class regularization(ArgSchema): default_lambda = Float( default=0.005, description='regularization factor') translation_factor = Float( default=0.005, description='regularization factor') poly_factors = NumpyArray( Float, required=False, default=None, missing=None, cli_as_single_argument=True, description=("List of regularization factors by order (0, 1, ..., n)" "will override other settings for Polynomial2DTransform" "will multiply default_lambda")) freeze_first_tile = Boolean( default=False, required=False)
class FeatureExtractionParameters(argschema.schemas.DefaultSchema): SIFTfdSize = Int( required=False, description=( "SIFT feature descriptor size -- samples per row and column. " "8 if excluded or None")) SIFTminScale = Float( required=False, description=("SIFT minimum scale -- " "minSize * minScale < size < maxSize * maxScale. " "0.5 if excluded or None")) SIFTmaxScale = Float( required=False, description=("SIFT maximum scale -- " "minSize * minScale < size < maxSize * maxScale. " "0.85 if excluded or None")) SIFTsteps = Int( required=False, description=("SIFT steps per scale octave. 3 if excluded or None"))
class NoiseWaveformParams(DefaultSchema): classifier_path = String(required=True, help='Path to pre-trained waveform classifier') smoothed_template_amplitude_threshold = Float( default=0.2, help='Fraction of max amplitude for calculating spread') template_amplitude_threshold = Float( default=0.2, help='Fraction of max amplitude for calculating spread') smoothed_template_filter_width = Int( default=2, help='Smoothing window for calculating spread') min_spread_threshold = Int( default=2, help='Minimum number of channels for a waveform to be considered good') mid_spread_threshold = Int( default=16, help='Over this channel spread, waveform shape must be considered') max_spread_threshold = Int(default=25, help='Maximum channel spread for a good unit') channel_amplitude_thresh = Float( default=0.25, help= 'Fraction of max amplitude for considering channels in spatial peak detection' ) peak_height_thresh = Float( default=0.2, help='Minimum height for spatial peak detection') peak_prominence_thresh = Float( default=0.2, help='Minimum prominence for spatial peak detection') peak_channel_range = Int( default=24, help='Range of channels for detecting spatial peaks') peak_locs_std_thresh = Float( default=3.5, help='Maximum standard deviation of peak locations for good units') min_temporal_peak_location = Int(default=10, help='Minimum peak index for good unit') max_temporal_peak_location = Int(default=30, help='Maximum peak index for good unit') template_shape_channel_range = Int( default=12, help='Range of channels for checking template shape') wavelet_index = Int( default=2, help='Wavelet index for noise template shape detection') min_wavelet_peak_height = Float( default=0.0, help='Minimum wavelet peak height for good units') min_wavelet_peak_loc = Int( default=15, help='Minimum wavelet peak location for good units') max_wavelet_peak_loc = Int( default=25, help='Maximum wavelet peak location for good units') multiprocessing_worker_count = Int( default=4, help='Number of workers to use for spatial peak calculation') use_random_forest = Boolean(default=False, help='set to false to use heuristic noise id') use_preclustered = Boolean( default=False, help='use clusters from cluster_group.tsv or not')
class SessionData(RaisingSchema): ophys_experiment_id = Int( required=True, description='unique identifier for this ophys session') rig_name = String(required=True, description='name of ophys device') movie_height = Int(required=True, description='height of field-of-view for 2p movie') movie_width = Int(required=True, description='width of field-of-view for 2p movie') container_id = Int(required=True, description='container that this experiment is in') sync_file = String(required=True, description='path to sync file') segmentation_mask_image_file = String( required=True, description='path to segmentation_mask_image file') max_projection_file = String(required=True, description='path to max_projection file') behavior_stimulus_file = String( required=True, description='path to behavior_stimulus file') dff_file = String(required=True, description='path to dff file') demix_file = String(required=True, description='path to demix file') average_intensity_projection_image_file = String( required=True, description='path to average_intensity_projection_image file') rigid_motion_transform_file = String( required=True, description='path to rigid_motion_transform file') targeted_structure = String( required=True, description='Anatomical structure that the experiment targeted') targeted_depth = Int( required=True, description='Cortical depth that the experiment targeted') stimulus_name = String(required=True, description='Stimulus Name') date_of_acquisition = String( required=True, description= 'date of acquisition of experiment, as string (no timezone info but relative ot UTC)' ) reporter_line = List(String, required=True, description='reporter line') driver_line = List(String, required=True, description='driver line') external_specimen_name = Int(required=True, description='LabTracks ID of the animal') full_genotype = String(required=True, description='full genotype') surface_2p_pixel_size_um = Float( required=True, description='the spatial extent (in um) of the 2p field-of-view') ophys_cell_segmentation_run_id = Int( required=True, description= 'ID of the active segmentation run used to generate this file') cell_specimen_table_dict = Nested( CellSpecimenTable, required=True, description='Table of cell specimen info') sex = String(required=True, description='sex') age = String(required=True, description='age')
class OutputParameters(DefaultSchema): inputs = Nested(InputParameters, description="The parameters argued to this executable", required=True) scale_correction = Float( description=("Z axis scale factor to correct for slice shrinkage"), required=True) scale_transform = Nested( AffineDictSchema, required=False, description='Dictionary defining an affine transform')
class InputParameters(ArgSchema): output_path = String(required=True, help="write outputs to here") stimulus_pkl_path = String( required=True, help="path to pkl file containing raw stimulus information", ) sync_h5_path = String( required=True, help="path to h5 file containing synchronization information", ) wheel_radius = Float(default=8.255, help="radius, in cm, of running wheel") subject_position = Float( default=2 / 3, help= "normalized distance of the subject from the center of the running wheel (1 is rim, 0 is center)", ) use_median_duration = Boolean( default=True, help= "frame timestamps are often too noisy to use as the denominator in the velocity calculation. Can instead use the median frame duration." )
class ProbeOutputParameters(DefaultSchema): name = String(required=True, help="Identifier for this probe") output_paths = Dict( required=True, help="Paths of each mappable file written by this run of the module.", ) total_time_shift = Float( required=True, help= "Translation (in seconds) from master->probe times computed for this probe.", ) global_probe_sampling_rate = Float( required=True, help= "The sampling rate of this probe in Hz, assessed on the master clock.", ) global_probe_lfp_sampling_rate = Float( required=True, help= "The sampling rate of LFP collected on this probe in Hz, assessed on the master clock.", )
class OutputParameters(DefaultSchema): inputs = Nested(InputParameters, description="The parameters argued to this executable", required=True) tilt_correction = Float( description= 'Tilt correction about x axis to align with streamlines (radians)', required=True) tilt_transform_dict = Nested( AffineDictSchema, required=False, description='Dictionary defining an affine transform')
class InputParameters(ArgSchema): class Meta: unknown = RAISE log_level = LogLevel(default='INFO', description="set the logging level of the module") case = String(required=True, validate=lambda s: s in VALID_CASES, help='select a use case to run') sub_images = Nested(SubImage, required=True, many=True, help='Sub images composing this image series') affine_params = List( Float, help='Parameters of affine image stack to reference space transform.') deformation_field_path = String( required=True, help= 'Path to parameters of the deformable local transform from affine-transformed image stack to reference space transform.' ) image_series_slice_spacing = Float( required=True, help='Distance (microns) between successive images in this series.') target_spacings = List( Float, required=True, help='For each volume produced, downsample to this isometric resolution' ) reference_spacing = Nested( ReferenceSpacing, required=True, help='Native spacing of reference space (microns).') reference_dimensions = Nested(ReferenceDimensions, required=True, help='Native dimensions of reference space.') sub_image_count = Int(required=True, help='Expected number of sub images') grid_prefix = String(required=True, help='Write output grid files here') accumulator_prefix = String( required=True, help='If this run produces accumulators, write them here.') storage_directory = String( required=False, help='Storage directory for this image series. Not used') filter_bit = Int( default=None, allow_none=True, help= 'if provided, signals that pixels with this bit high have passed the optional post-filter stage' ) nprocesses = Int(default=8, help='spawn this many worker subprocesses') reduce_level = Int( default=0, help='power of two by which to downsample each input axis')
class ApplyAffineParametersBase(RenderParameters): transformId = Str( required=True, description='transform reference name to use when applying changes') M00 = Float(required=False, default=1.0, description='M00 (x\'=M00*x element of affine (default 1.0)') M10 = Float(required=False, default=0.0, description='M10 (y\'=M10*x element of affine (default 0.0)') M01 = Float(required=False, default=0.0, description='M01 (x\'=M01*y element of affine (default 0.0)') M11 = Float(required=False, default=1.0, description='M11 (y\'=M11*y) element of affine (default 1.0)') B0 = Float( required=False, default=0.0, description='B0 (x translation) element of affine (defautl 0.0)') B1 = Float( required=False, default=0.0, description='B1 (y translation) element of affine (default 0.0)') zmin = Int(required=False, description='zvalue to start') zmax = Int(required=False, description='zvalue to end') pool_size = Int( required=False, default=20, description='size of pool for parallel processing (default=20)')
class BaseRegistrationItem(DefaultSchema): x_offset = Int( required=True, description=("X offset from the top-left of the image to the center " "of the gold reticle in image coordinates (pixel units)")) y_offset = Int( required=True, description=("Y offset from the top-left of the image to the center " "of the gold reticle in image coordinates (pixel units)")) rotation = Float( required=True, description=("Rotation of the image relative to gold reticle in " "degrees")) pixel_size_um = Float(required=True, description="Linear dimension of a pixel in microns") acquired_at = DateTime(required=True, description="Acquisition timestamp") stage_image_rotation = Float( description="Rotation of stage relative to image") stage_x = Float(description="X position of stage when image was acquired") stage_y = Float(description="Y position of stage when image was acquired") stage_z = Float(description="Z position of stage when image was acquired") home_offset_x = Int( description="X offset between reticle home and vasculature home") home_offset_y = Int( description="Y offset between reticle home and vasculature home")
class DepthEstimationParams(DefaultSchema): hi_noise_thresh = Float(required=True, default=50.0, help='Max RMS noise for including channels') lo_noise_thresh = Float(required=True, default=3.0, help='Min RMS noise for including channels') save_figure = Bool(required=True, default=True) figure_location = OutputFile(required=True, default=None) smoothing_amount = Int( required=True, default=5, help='Gaussian smoothing parameter to reduce channel-to-channel noise') power_thresh = Float( required=True, default=2.5, help= 'Ignore threshold crossings if power is above this level (indicates channels are in the brain)' ) diff_thresh = Float( required=True, default=-0.07, help='Threshold to detect large increases is power at brain surface') freq_range = NumpyArray( required=True, default=[0, 10], help='Frequency band for detecting power increases') max_freq = Int(required=True, default=150, help='Maximum frequency to plot') channel_range = NumpyArray( required=True, default=[370, 380], help='Channels assumed to be out of brain, but in saline') n_passes = Int( required=True, default=10, help='Number of times to compute offset and surface channel') skip_s_per_pass = Int( required=True, default=100, help='Number of seconds between data chunks used on each pass') start_time = Float( required=True, default=0, help='First time (in seconds) for computing median offset') time_interval = Float(required=True, default=5, help='Number of seconds for computing median offset') nfft = Int(required=True, default=4096, help='Length of FFT used for calculations') air_gap = Int( required=True, default=100, help='Approximate number of channels between brain surface and air')
class EphysParams(DefaultSchema): sample_rate = Float( required=True, default=30000.0, help='Sample rate of Neuropixels AP band continuous data') lfp_sample_rate = Float( require=True, default=2500.0, help='Sample rate of Neuropixels LFP band continuous data') bit_volts = Float( required=True, default=0.195, help='Scalar required to convert int16 values into microvolts') num_channels = Int(required=True, default=384, help='Total number of channels in binary data files') reference_channels = NumpyArray( required=False, default=[36, 75, 112, 151, 188, 227, 264, 303, 340, 379], help='Reference channels on Neuropixels probe (numbering starts at 0)') template_zero_padding = Int( required=True, default=21, help='Zero-padding on templates output by Kilosort') vertical_site_spacing = Float(required=False, default=20e-6, help='Vertical site spacing in meters') probe_type = String(required=False, default='NP1', help='3A, 3B2, NP1') lfp_band_file = String(required=False, help='Location of LFP band binary file') ap_band_file = String(required=False, help='Location of AP band binary file') reorder_lfp_channels = Bool( required=False, default=True, help= 'Should we fix the ordering of LFP channels (necessary for 3a probes following extract_from_npx modules)' ) cluster_group_file_name = String(required=False, default='cluster_group.tsv')
class RenderSectionAtScaleParameters(RenderParameters): input_stack = Str( required=True, description='Input stack to make the downsample version of') image_directory = OutputDir( required=True, description='Directory to save the downsampled sections') imgformat = Str(required=False, default="png", missing="png", description='Image format (default - png)') doFilter = Boolean(required=False, default=True, missing=True, description='Apply filtering before rendering') fillWithNoise = Boolean( required=False, default=False, missing=False, description='Fill image with noise (default - False)') scale = Float(required=True, description='scale of the downsampled sections') minZ = Int(required=False, default=-1, missing=-1, description='min Z to create the downsample section from') maxZ = Int(required=False, default=-1, missing=-1, description='max Z to create the downsample section from') filterListName = Str( required=False, description=("Apply specified filter list to all renderings")) bounds = Nested(Bounds, required=False, default=None, missing=None) use_stack_bounds = Boolean( required=False, default=False, missing=False, description= 'Do you want to use stack bounds while downsampling?. Default=False') pool_size = Int(required=False, default=20, missing=20, description='number of parallel threads to use') @post_load def validate_data(self, data): # FIXME will be able to remove with render-python tweak if data.get('filterListName') is not None: warnings.warn( "filterListName not implemented -- will use default behavior", UserWarning)
class Kilosort2Parameters(DefaultSchema): trange = String(required=False, default='[0 Inf]', help='Time range in seconds to process') fproc = String(required=False, default="fullfile('D:\kilosort_datatemp', 'temp_wh.dat')", help='Processed data file on a fast ssd') KSver = String(required=False, default='2.5', help='kilsort version: 2.0 (tracking) or 2.5(data shift correction)') remDup = Int(required=False, default=0, help='KS2 remove duplicates') finalSplits = Int(required=False, default=1, help='KS2 final splits by SVD') labelGood = Int(required=False, default=1, help='KS2 noise cluster detection') saveRez = Int(required=False, default=1, help='KS2 save rez.mat file') copy_fproc = Int(required=False, default=1, help='Copy processed binary to output directory') chanMap = String(required=False, default="'chanMap.mat'", help='path to channel map .mat file') fshigh = Int(required=False, default=150, help='frequency for high pass filtering') minfr_goodchannels = Float(required=False, default=0.1, help='minimum firing rate on a "good" channel (0 to skip)') Th = String(required=False, default='[10 4]', help='threshold (last pass can be lower') lam = Int(required=False, default=10, help='how important is the amplitude penalty (like in Kilosort1, 0 means not used, 10 is average, 50 is a lot)') AUCsplit = Float(required=False, default=0.9, help='splitting a cluster at the end requires at least this much isolation for each sub-cluster (max = 1)') minFR = Float(required=False, default=1/50., help='minimum spike rate (Hz)') momentum = String(required=False, default='[20 400]', help='number of samples to average over (annealed)') sigmaMask = Int(required=False, default=30, help='spatial constant in um for computing residual variance of spike') ThPre = Int(required=False, default=8, help='threshold crossings for pre-clustering (in PCA projection space)') spkTh = Int(required=False, default=-6, help='spike threshold is standard deviations') reorder = Int(required=False, default=1, help='whether to reorder batches for drift correction') nskip = Int(required=False, default=25, help='how many batches to skip for determining spike PCs') GPU = Int(required=False, default=1, help='whether to run this code on an Nvidia GPU') nfilt_factor = Int(required=False, default=4, help='max number of clusters per good channel (even temporary ones)') ntbuff = Int(required=False, default=64, help='samples of symmetrical buffer for whitening and spike detection') NT = String(required=False, default='64*1024 + ops.ntbuff', help='this is the batch size; for GPU should be a multiple of 32 + ntbuff)') whiteningRange = Int(required=False, default=32) nSkipCov = Int(required=False, default=25, help='compute whitening matrix from every Nth batch') scaleproc = Int(required=False, default=200, help='int16 scaling of whitenend data') nPCs = Int(required=False, default=3, help='how many PCs to project the spikes into') useRAM = Int(required=False, default=0, help='must be 0') gain = Float(required=False, default=1, help='uV/bit to report amplitudes in uV') CSBseed = Int(required=False, default=1, help='random seed for clusterSingleBatches') LTseed = Int(required=False, default=1, help='random seed for learnTemplates') nNeighbors = Int(required=False, default=32, help='number of channels to include in template')
class regularization(DefaultSchema): default_lambda = Float(default=0.005, description='common regularization value') translation_factor = Float( default=0.005, description=("translation regularization factor." " multiplies default_lambda")) poly_factors = List( Float, required=False, default=None, missing=None, cli_as_single_argument=True, description=("List of regularization factors by order " "(0, 1, ..., n) will override other settings " "for Polynomial2DTransform. multiplies default_lambda")) thinplate_factor = Float( required=False, default=1e-5, missing=1e-5, description=("regularization factor for thin plate spline " "control points. multiplies default_lambda."))
class QualityMetricsParams(DefaultSchema): isi_threshold = Float(required=False, default=0.0015, help='Maximum time (in seconds) for ISI violation') min_isi = Float(required=False, default=0.00, help='Minimum time (in seconds) for ISI violation') num_channels_to_compare = Int( required=False, default=13, help='Number of channels to use for computing PC metrics; must be odd') max_spikes_for_unit = Int( required=False, default=500, help='Number of spikes to subsample for computing PC metrics') max_spikes_for_nn = Int( required=False, default=10000, help='Further subsampling for NearestNeighbor calculation') n_neighbors = Int( required=False, default=4, help='Number of neighbors to use for NearestNeighbor calculation') n_silhouette = Int( required=False, default=10000, help='Number of spikes to use for calculating silhouette score') drift_metrics_min_spikes_per_interval = Int( required=False, default=10, help='Minimum number of spikes for computing depth') drift_metrics_interval_s = Float( required=False, default=100, help='Interval length is seconds for computing spike depth') quality_metrics_output_file = String( required=True, help='CSV file where metrics will be saved')
class PostprocessingParams(DefaultSchema): within_unit_overlap_window = Float( required=False, default=0.000166, help='Time window for removing overlapping spikes for one unit.') between_unit_overlap_window = Float( required=False, default=0.000166, help='Time window for removing overlapping spikes between two units.') between_unit_dist_um = Int( required=False, default=5, help= 'Number of channels (above and below peak channel) to search for overlapping spikes' ) deletion_mode = String(required=False, default='lowAmpCluster', help='lowAmpCluster or deleteFirst') include_pcs = Boolean( required=False, default=True, help='Set to false if features were not saved with Phy output')
class QualityMetricsParams(DefaultSchema): isi_threshold = Float(required=False, default=0.0015, help='Maximum time (in seconds) for ISI violation') min_isi = Float(required=False, default=0.00, help='Minimum time (in seconds) for ISI violation') max_radius_um = Int(required=False, default=68, help='Maximum radius for computing PC metrics, in um') max_spikes_for_unit = Int( required=False, default=500, help='Number of spikes to subsample for computing PC metrics') max_spikes_for_nn = Int( required=False, default=10000, help='Further subsampling for NearestNeighbor calculation') n_neighbors = Int( required=False, default=4, help='Number of neighbors to use for NearestNeighbor calculation') n_silhouette = Int( required=False, default=10000, help='Number of spikes to use for calculating silhouette score') drift_metrics_min_spikes_per_interval = Int( required=False, default=10, help='Minimum number of spikes for computing depth') drift_metrics_interval_s = Float( required=False, default=100, help='Interval length is seconds for computing spike depth') include_pcs = Boolean( required=False, default=True, help='Set to false if features were not saved with Phy output')
class CellFeatures(DefaultSchema): blowout_mv = Float(description="blash", required=False, allow_none=True) seal_gohm = Float(description="blash", allow_none=True) electrode_0_pa = Float(description="blash", allow_none=True) input_access_resistance_ratio = Float(description="blash", allow_none=True) input_resistance_mohm = Float(description="blash", allow_none=True) initial_access_resistance_mohm = Float(description="blash", allow_none=True)
class ConsolidateTransformsParameters(RenderParameters): stack = Str(required=True, description='stack to consolidate') postfix = Str( required=False, default="_CONS", description= 'postfix to add to stack name on saving if no output defined (default _CONS)' ) transforms_slice = Slice( required=True, description="a string representing a slice describing \ the set of transforms to be consolidated (i.e. 1:)" ) output_stack = Str( required=False, description='name of output stack (default to adding postfix to input)' ) pool_size = Int( required=False, default=10, description='name of output stack (default to adding postfix to input)' ) minZ = Float( required=False, description= """minimum z to consolidate in read in from stack and write to output_stack\ default to minimum z in stack""") maxZ = Float( required=False, description= """minimaximummum z to consolidate in read in from stack and write to output_stack\ default to maximum z in stack""") overwrite_zlayer = Boolean( required=False, default=False, description=("whether to remove the existing layer from the " "target stack before uploading.")) close_stack = Boolean(required=False, default=False)
class SIFTParameters(DefaultSchema): initialSigma = Float( required=True, description="initial sigma value for SIFT's gaussian blur, in pixels") steps = Int(required=True, description='steps per SIFT scale octave') minOctaveSize = Int( required=True, description='minimum image size used for SIFT octave, in pixels') maxOctaveSize = Int( required=True, description='maximum image size used for SIFT octave, in pixels') fdSize = Int(required=True, description='SIFT feature descriptor size') fdBins = Int(required=True, description='SIFT feature descriptor orientation bins')
class PointMatchFilteringOptions(DefaultSchema): NumRandomSamplingsMethod = Str( required=False, default="Desired confidence", missing="Desired confidence", description="Numerical random sampling method") MaximumRandomSamples = Int(required=False, default=5000, missing=5000, description="Max number of random samples") DesiredConfidence = Float( required=False, default=99.9, missing=99.9, description="Desired confidence value for point match filtering") Transform = Str(required=False, default="Affine", missing="Affine", description="RANSAC model to fit") PixelDistanceThreshold = Float(required=False, default=0.1, missing=0.1, description="Pixel distance threshold")
class RansacParameters(DefaultSchema): minimum_points_for_fit = Int( default=EllipseFitter.DEFAULT_MINIMUM_POINTS_FOR_FIT, description="Number of points required to fit data") number_of_close_points = Int( default=EllipseFitter.DEFAULT_NUMBER_OF_CLOSE_POINTS, description=("Number of candidate outliers reselected as inliers " "required to consider a good fit")) threshold = Float( default=EllipseFitter.DEFAULT_THRESHOLD, description=("Error threshold below which data should be considered " "an inlier")) iterations = Int(default=EllipseFitter.DEFAULT_ITERATIONS, description="Number of iterations to run")
class MeanWaveformParams(DefaultSchema): samples_per_spike = Int(required=True, default=82, help='Number of samples to extract for each spike') pre_samples = Int( required=True, default=20, help='Number of samples between start of spike and the peak') num_epochs = Int(required=True, default=1, help='Number of epochs to compute mean waveforms') spikes_per_epoch = Int(require=True, default=100, help='Max number of spikes per epoch') upsampling_factor = Float( require=False, default=200 / 82, help='Upsampling factor for calculating waveform metrics') spread_threshold = Float( require=False, default=0.12, help='Threshold for computing channel spread of 2D waveform') site_range = Int(require=False, default=16, help='Number of sites to use for 2D waveform metrics') cWaves_path = InputDir(require=False, help='directory containing the TPrime executable.') use_C_Waves = Bool(require=False, default=False, help='Use faster C routine to calculate mean waveforms') snr_radius = Int( require=False, default=8, help='disk radius (chans) about pk-chan for snr calculation in C_waves' ) mean_waveforms_file = String(required=True, help='Path to mean waveforms file (.npy)')
class PointMatchParameters(DefaultSchema): NumRandomSamplingsMethod = Str( required=False, default="Desired confidence", missing="Desired confidence", description='Numerical Random sampling method') MaximumRandomSamples = Int(required=False, default=5000, missing=5000, description='Maximum number of random samples') DesiredConfidence = Float(required=False, default=99.9, missing=99.9, description='Desired confidence level') PixelDistanceThreshold = Float( required=False, default=0.1, missing=0.1, description='Pixel distance threshold for filtering') Transform = Str(required=False, default="AFFINE", missing="AFFINE", description="Transformation type parameter for point " "match filtering (default AFFINE)")