Skip to content

Commit

Permalink
Feature/visualization tools1 (#95)
Browse files Browse the repository at this point in the history
* Proposed fix for 2017 nargout bug

This tries to fix the bug #86 emerging in matlab 2017 editions (and maybe others) where the builtin numArgumentsFromSubscript is not behaving as expected, Instead of returning the correct nargout it basically returns numel(nigelObj) creating all sorts of problems, such as the too many output args when calling tankObj.nigelDash from base.

This solution relies on the number of declared args in the method declaration to determine nargout at this stage. This does not affect the effective number of output arguments which are still controlled by the number of variables on the left of an assignment. Bear in mind that this will effect the number of output args when called without an explicit assignment.

* fixes

Fixed small bug in buildWorkerCoonfigScript. Now works as intended, it was getting the two modalities mixed up.

Fixed ismethod issue in numArgsFromSub. in nigelObj. references #86.

* Critical fix in rereferencing

Found a critical in rereferencing that was actually preventing the rereferencing from happening.

* bugfix getspiketime (when sorted)

getspiketime was returning an empty array ehen called with optional "class" input. (Was looking at the wrong field of the event file)

fixed.

* Feature/new sort (#88)

* Sort new features

Added a pletora of features to the Sort interface.
Fixed and improved the way the SortFiles are saved and loaded, (getClus getSort). Fixed small bugs here and there,

HighDimsUi now has the same interface language as dashboard (with nigelpanels etc). A new button was added to find the most convenient projection according to LDA. When pressed moves the plane visualized in featuresUI in the position that best separates the selected cluster.
Thanks DataHigh!

ginput
Changed the cross-hair color to improve visibility.

multicallbackwrap wasn't really working. fixed.

NigelButton
fixed a small bug that was overwriting WindowButtonUpFnc of the figure it was put on. Now it uses multiCallbackWrap to avoid overwriting.
FaturesUI
The 2D graph now cna be zoomed and panned. Use the MouseWheel to zoom. MouseWheel + alt or control to pan horizontally and vertically.

Saving performance greatly improved by saving only the clusters that actually need saving. Each channels starts with a UnsavedChanges target to false and a ConfirmedChanges to false. When a change is done the UnsavedChanges goes to true. When confirmed, ConfirmedChanges goes to true.
SpikeImage; SortUi;

* Fixed zooming in FeaturesUI

Now the two graphs have linked axes that change and shift together.

Also, navigation is now homogeneous between the two figures

* Fixed bug in Sort/savedata

fixed a bug in savedata. Program was crashing when a channel was turned off in mask

* performance update

Small performance update in plotting and updating spike profiles and features.

* Added pca and random projection

Added the possibility to project data onto the plane of max variance as well as to a random projection plane.

This is accessible from the HighDimsUi

* Feature/new sd (#92)

# New Spike Detection
Added by: Federico (FB)

## Features
### Change in Structure
`doSD` has been essentially re-written. 
* All the SD algorithms were moved to their own functions in the block private folder. 
* The same was done for feature extraction and artifact rejection.

#### Motivation
We want the pipeline to be more flexible, particularly in the spike detection step where many labs or users have their own preferred method. Reorganizing the structure of `doSD` in this way allows the specification of SD choices both in the `defaults.SD` file, as well as on an ad hoc basis through a user interface.

#### To-Do
* A short wiki entry will follow with the style specifications and naming convention of the files.

### Spike Detection Algorithm Updates
* Revised and fixed `AdaptThresh`, `HardThresh`, `SNEO`, and `TIFCO`.
* Fixed associated `SD` parameters.

### `configSD`
Added a GUI to configure the SD parameters. 

#### Strategy
It randomly extracts 1 minute of data from the recording, providing a graphical interface that displays the data and any spikes detected as the end-user tries different parameter configurations until they are satisfied that the current parameter settings can detect spikes well in the data.  and you can try different parameters on the extracted data.
* Artifact rejection parameters can be selected in the same way.
* The "current channel" can be changed by the end-user.

* noncritical bugfixes

Fixed a potential bug in rereferencing

Changed swtteo to compute wavelet coefficient at runtime instead of during the parameters loading. This makes it possible to try different wavelets in the configSD intereface

* bugfix

Fixed a couple of glitches in the configSD interface,
Also, SD defaults are modified to some more sensible values

* Fixed plotwaves

* Explore data class added

Added the explore data class to view snippets of data interactively.

added datascrollerAxis class: mimics timescrolleraxis but with data instead of events and videos.It's used by exploredata class.

added the possibility of plotting plotWaves into an existing axis

* plotWaves reducees plots

Now plotwaves reduces plots as well. Zooming is not suggested because of this. Inside the ExplroeData utility zooming is handled from the dataScrollerAxis

dataScrollerAxis now uses the full lineplotreducer utility and zooming is therefore enabled

Also fixed a small issue with nigelColors

* bigfix

Fixed small bugs and glitches for plotWaves and DataScrollerAxis

* Spike Overlay

Added the spike Overlay for plotWaved. It works by purgin the y-reduced signal by all non spike parts and plotting it on top of either CAR or Filt already plotted.
It is selected by passing Spikes as first input

* exploreData bugfix

fixed small glitch

* Updates to get RMS values of filtered data

* not sure if change to analyzeRMS.m is technically correct, but it ran
*updated block methods list to reflect changes in plotWaves

* Visualization bugfix

Added the empty case to ToString

Added a fialsafe in case time is not set properly in block.
fixed the usage of reduce_to_width

Co-authored-by: Federico <[email protected]>
Co-authored-by: Page Hayley <[email protected]>
  • Loading branch information
3 people authored Nov 2, 2020
1 parent 5425644 commit 1942e1a
Show file tree
Hide file tree
Showing 63 changed files with 3,513 additions and 745 deletions.
9 changes: 9 additions & 0 deletions +nigeLab/+defaults/+SD/ART_HardThresh.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
function pars = ART_HardThresh()
%% function defining defualt parameters for HARD THRESHOLD spike detection algorithm

pars.Thresh = 70; % [uV] Fixed voltage threshold for detection;
pars.Samples = 4; % [ms] Window to ignore around artifact (suggest: 4 ms MIN for stim rebound)

pars.Polarity = 1;

end
5 changes: 5 additions & 0 deletions +nigeLab/+defaults/+SD/FEAT_ica.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
function pars = FEAT_ica()
%% function defining defualt parameters for ICA based feature extraction
pars = struct();

end
10 changes: 10 additions & 0 deletions +nigeLab/+defaults/+SD/FEAT_pca.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
function pars = FEAT_pca()
%% function defining defualt parameters for PCA based feature extraction
pars.ExplVar = .95; % Explained Variance to retain durin PCA
% decomposition.
% Takes precedence over NOut. Set to Inf to
% use NOut.

pars.NOut = 12; % Number of feature inputs for clustering.

end
10 changes: 10 additions & 0 deletions +nigeLab/+defaults/+SD/FEAT_wavelet.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
function pars = FEAT_wavelet()
%% function defining defualt parameters for wavelet feature extraction

pars.WaveName = 'bior1.3'; % 'haar' 'bior1.3' 'db4' 'sym8' all examples
[pars.LoD,pars.HiD] = wfilters(pars.WaveName); % get wavelet decomposition parameters
pars.NOut = 12; % Number of feature inputs for clustering
pars.NScales = 3; % Number of scales for wavelet decomposition
%

end
10 changes: 10 additions & 0 deletions +nigeLab/+defaults/+SD/SD_AdaptThresh.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
function pars = SD_AdaptThresh()
%% function defining defualt parameters for SNEO spike detection algorithm

pars.FilterLength = 60; % [ms] Length of the adaptive filter window
pars.Polarity = -1; % polarity of the detection. If positive looks for positive crossings. Negative otherwise.
pars.MinThresh = 15; % [uV] Fixed minimum voltage threshold for detection;
pars.MultCoeff = 4.5; % moltiplicative factor for the adaptive threshold (signal absolute median);
pars.RefrTime = 0.5; % [ms] Refractory time.
pars.PeakDur = 1; % [ms] Peak duration or pulse lifetime period
end
9 changes: 9 additions & 0 deletions +nigeLab/+defaults/+SD/SD_HardThresh.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
function pars = SD_HardThresh()
%% function defining defualt parameters for HARD THRESHOLD spike detection algorithm

pars.Polarity = -1; % polarity of the detection. If positive looks for positive crossings. Negative otherwise.
pars.Thresh = 50; % [uV] Fixed voltage threshold for detection;
pars.RefrTime = 0.5; % [ms] Refractory time.
pars.PeakDur = 1; % [ms] Peak duration or pulse lifetime period
pars.NSaround = 7;
end
9 changes: 9 additions & 0 deletions +nigeLab/+defaults/+SD/SD_PTSD.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
function pars = SD_PTSD()
%% function defining defualt parameters for SNEO spike detection algorithm

% pars.MultCoeff = 4.5; % Multiplication coefficient for noise
pars.Thresh = 50;
pars.RefrTime = 0.5; % [ms] Refractory time.
pars.PeakDur = 2; % [ms] Peak duration or pulse lifetime period
pars.AlignFlag = 0;
end
10 changes: 10 additions & 0 deletions +nigeLab/+defaults/+SD/SD_SNEO.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
function pars = SD_SNEO()
%% function defining defualt parameters for SNEO spike detection algorithm

pars.MultCoeff = 4.5; % Multiplication coefficient for noise
pars.SmoothN = 5; % Number of samples to use for smoothed nonlinear energy operator window
pars.NSaround = 7; % Number of samples around the peak to "look" for negative peak
pars.RefrTime = 0.5; % [ms] Refractory time.
pars.PeakDur = 1; % [ms] Peak duration or pulse lifetime period
pars.Polarity = -1;
end
16 changes: 16 additions & 0 deletions +nigeLab/+defaults/+SD/SD_SWTTEO.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
function pars = SD_SWTTEO()
%% function defining defualt parameters for SWTTEO spike detection algorithm
pars.wavLevel = 4; % Wavelet decomposition level
pars.waveName = 'sym5'; % wavelet type

pars.winType = @hamming; % function handle for the smoothing window type; This is fed to window function
pars.smoothN = 40; % Number of samples for the smoothing operator. Set to 0 to turn off smoothing
pars.winPars = {'symmetric'}; % Optional parameters for the smoothing window

pars.RefrTime = 1; % [ms] refractory time
pars.MultCoeff = 3.5; % Moltiplication coefficient for SWTTEO thresholding
pars.Polarity = -1;
pars.PeakDur = 2; % [ms] Peak duration or pulse lifetime period


end
15 changes: 15 additions & 0 deletions +nigeLab/+defaults/+SD/SD_TIFCO.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
function pars = SD_TIFCO()
%% function defining defualt parameters for TIFCO spike detection algorithm
pars.fMin = 300; % [Hz] lower bound for the gabor based time frequency decomposition
pars.fMax = 3500; % [Hz] higher bound for the gabor based time frequency decomposition

pars.winType = @hamming; % function handle for the smoothing window type; This is fed to window function
pars.winL = 1; % [s] Length for the time-frequency window decomposition
pars.winPars = {'symmetric'}; % Optional parameters for the smoothing window

pars.RefrTime = 1; % [ms] refractory time
pars.MultCoeff = 4.5; % Multiplication coefficient for noise
pars.Polarity = -1; % Detection polarity (look for positive or negative peaks)
pars.PeakDur = 1; % [ms] Peak duration or pulse lifetime period

end
8 changes: 8 additions & 0 deletions +nigeLab/+defaults/+SD/WIP_SD_MTEO.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
function pars = MTEO()
%% function defining defualt parameters for MTEO spike detection algorithm

pars.multcoeff = 4.5; % Multiplication coefficient for noise
pars.smoothN = 5; % Number of samples to use for smoothed nonlinear energy operator window
pars.nsaround = 7; % Number of samples around the peak to "look" for negative peak

end
8 changes: 8 additions & 0 deletions +nigeLab/+defaults/+SD/WIP_SD_WTEO.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
function pars = SD_WTEO()
%% function defining defualt parameters for WTEO spike detection algorithm

pars.multcoeff = 4.5; % Multiplication coefficient for noise
pars.smoothN = 5; % Number of samples to use for smoothed nonlinear energy operator window
pars.nsaround = 7; % Number of samples around the peak to "look" for negative peak

end
11 changes: 9 additions & 2 deletions +nigeLab/+defaults/AutoClustering.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,15 @@

%% PARAMS YOU MIGHT CHANGE
pars = struct;
pars.MethodName = 'KMEANS'; % Can be: 'KMEANS' or 'SPC'
pars.NMaxClus = 9; % Maximum # of clusters
pars.MethodName = 'KMEANS'; % Can be: 'KMEANS' or 'SPC'
pars.NMaxClus = 9; % Maximum # of clusters
pars.ID.Clusters = 'kmeans'; % Attached to the cluster folder







%% UNLIKELY TO CHANGE
% Parameters for each type stored as individual files in ~/+Autoclusters
Expand Down
200 changes: 90 additions & 110 deletions +nigeLab/+defaults/SD.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function pars = SD(varargin)
function varargout = SD(varargin)
%% defaults.SD Initialize parameters for spike detection
%
% pars = nigeLab.defaults.SD('NAME',value,...);
Expand All @@ -11,129 +11,109 @@
% By: MAECI 2018 collaboration (Max Murphy & Federico Barban)
% 01/09/2019 :: 4.0.0 -> 4.0.1 = Fix FEAT_NAMES generation

%% DEFAULTS
pars = struct;

% General settings
pars.VERSION = 'v4.0.1'; % Version, to be passed with parameters
pars.LIBDIR = 'C:\MyRepos\_SD\APP_Code'; % Location of sub-functions

% %% OLD SPIKE DETECTION PARAMETERS
% % Parameters
% pars.ARTIFACT_THRESH = 450; % Threshold for artifact

% Folder tags
pars.USE_CAR = true; % By def. use common spatial reference
% pars.PRE_STIM_BLANKING = 0.5; % Window to blank before specifieid stim times (ms)
% pars.POST_STIM_BLANKING = 1.5; % Window to blank after specified stim times (ms)
% pars.ARTIFACT_SPACE = 4; % Window to ignore around artifact (suggest: 4 ms MIN for stim rebound)
% pars.MULTCOEFF = 4.5; % Multiplication coefficient for noise
% pars.PKDURATION = 1.0; % Pulse lifetime period (suggest: 2 ms MAX)
% pars.REFRTIME = 0.5; % Refractory period (suggest: 2 ms MAX).
% pars.PKDETECT = 'sneo';% 'both' or 'pos' or 'neg' or 'adapt' or 'sneo' for peak type
% pars.ALIGNFLAG = 1; % Alignment flag for detection
% % [0 -> highest / 1 -> most negative]
% pars.P2PAMP = 60; % Minimum peak-to-peak amplitude

% File tags
pars.DELETE_OLD_PATH = false; % Remove old files
pars.USE_EXISTING_SPIKES = false; % Use existing spikes on directory
pars.DO_AUTO_CLUSTERING = true; % If false, skips "clustering" portion
% (v2017a in order to use Isilon cluster)
% pars.ART_DIST = 1/35; % Max. time between stimuli (sec)
% pars.NWIN = 120; % Number of windows for automatic thresholding
% pars.WINDUR = 200*1e-3; % Minimum window length (msec)
% pars.INIT_THRESH = 50; % Pre-adaptive spike threshold (micro-volts)
% pars.ART_RATE = 0.0035; % Empirically determined rate for artifacts based on artifact rejection
% pars.M = (-7/3); % See ART_RATE
% pars.B = 1.05; % See ART_RATE
%
%
% % Parameters
% pars.MIN_SPK = 100; % Minimum spikes before sorting
% pars.TEMPSD = 3.5; % Cluster template max radius for template matching
% pars.TSCALE = 3.5; % Scaling for timestamps of spikes as a feature

% % Isilon cluster settings
pars.USE_CLUSTER = false; % Must already have clustering done


%% SPIKE DETECTION PARAMETERS
% Parameters
pars.ARTIFACT_THRESH = 450; % Threshold for artifact
%% User defined parameters for spike detection

pars.STIM_TS = []; % Pre-specified stim times
pars.ARTIFACT = []; % Pre-specified artifact times
pars.PRE_STIM_BLANKING = 0.5; % Window to blank before specifieid stim times (ms)
pars.POST_STIM_BLANKING = 1.5; % Window to blank after specified stim times (ms)
pars.ARTIFACT_SPACE = 4; % Window to ignore around artifact (suggest: 4 ms MIN for stim rebound)
pars.MULTCOEFF = 4.5; % Multiplication coefficient for noise
pars.PKDURATION = 1.0; % Pulse lifetime period (suggest: 2 ms MAX)
pars.REFRTIME = 0.5; % Refractory period (suggest: 2 ms MAX).
pars.PKDETECT = 'sneo';% 'both' or 'pos' or 'neg' or 'adapt' or 'sneo' for peak type
pars.ADPT_N = 60; % Number of ms to use for adaptive filter
pars.SNEO_N = 5; % Number of samples to use for smoothed nonlinear energy operator window
pars.NS_AROUND = 7; % Number of samples around the peak to "look" for negative peak
pars.ADPT_MIN = 15; % Minimum for adaptive threshold (fixed)
pars.ALIGNFLAG = 1; % Alignment flag for detection
% [0 -> highest / 1 -> most negative]
pars.P2PAMP = 60; % Minimum peak-to-peak amplitude
pars.W_PRE = 0.4; % Pre-spike window (ms)
pars.W_POST = 0.8; % Post-spike window (ms)
pars.ART_DIST = 1/35; % Max. time between stimuli (sec)
pars.NWIN = 120; % Number of windows for automatic thresholding
pars.WINDUR = 200*1e-3; % Minimum window length (msec)
pars.INIT_THRESH = 50; % Pre-adaptive spike threshold (micro-volts)
pars.PRESCALED = true; % Whether data has been pre-scaled to micro-volts.
pars.FIXED_THRESH = 50; % If alignment is 'neg' or 'pos' this can be set to fix the detection threshold level
pars.ART_RATE = 0.0035; % Empirically determined rate for artifacts based on artifact rejection
pars.M = (-7/3); % See ART_RATE
pars.B = 1.05; % See ART_RATE

% Spike features and sorting settings (SPC pars in SPIKECLUSTER_SPC)
pars.SC_VER = 'SPC'; % Version of spike clustering

% Parameters
pars.N_INTERP_SAMPLES = 250; % Number of interpolated samples for spikes
pars.MIN_SPK = 100; % Minimum spikes before sorting
pars.TEMPSD = 3.5; % Cluster template max radius for template matching
pars.TSCALE = 3.5; % Scaling for timestamps of spikes as a feature
pars.USE_TS_FEATURE = false; % Add timestamp as an additional feature for SPC?
pars.FEAT = 'wav'; % 'wav' or 'pca' or 'ica' for spike features
pars.WAVELET = 'bior1.3';% 'haar' 'bior1.3' 'db4' 'sym8' all examples
[pars.LoD,pars.HiD] = wfilters(pars.WAVELET); % get wavelet decomposition parameters
pars.NINPUT = 12; % Number of feature inputs for clustering
pars.NSCALES = 3; % Number of scales for wavelet decomposition

%% PARSE VARARGIN
if numel(varargin)==1
varargin = varargin{1};
if numel(varargin) ==1
varargin = varargin{1};
end
end

for iV = 1:2:length(varargin)
pars.(upper(varargin{iV}))=varargin{iV+1};
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% Spike Detection
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
pars.WPre = 0.4; % Pre-spike window (ms)
pars.WPost = 0.8; % Post-spike window (ms)

%% PARSE OTHER PARAMETERS BASED ON SELECTED PARAMETERS
switch pars.PKDETECT
case 'neg'
pars.SD_VER = [pars.FEAT '-neg' num2str(pars.FIXED_THRESH)];
case 'pos'
pars.SD_VER = [pars.FEAT '-pos' num2str(pars.FIXED_THRESH)];
case 'adapt'
pars.SD_VER = [pars.FEAT '-adapt'];
case 'both'
pars.SD_VER = [pars.FEAT '-PT'];
case 'sneo'
pars.SD_VER = [pars.FEAT '-sneo'];
otherwise
pars.SD_VER = [pars.FEAT '-new'];
end
pars.SDMethodName = 'SWTTEO';
pars.ID.Spikes = 'SWTTEO'; % implemented to date (2020/06/16):
% SNEO, SWTTEO, WTEO, TIFCO, SWT,
% PTSD, fixed and variable Threshold.
% See documentation for references.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% Artefact Rejection
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

pars.ArtefactRejMethodName = 'HardThresh';
pars.ID.Artifact = 'HardThresh'; % implemented to date (2020/06/16):
% HardThresh (hard threshold)

if pars.USE_CAR
pars.ID.Artifact = [pars.SD_VER '_CAR'];
pars.ID.Spikes = [pars.SD_VER '_CAR'];
pars.ID.SpikeFeatures = [pars.SD_VER '_CAR'];
pars.ID.Clusters = [pars.SD_VER '_' pars.SC_VER '_CAR'];
pars.ID.Sorted = [pars.SD_VER '_' pars.SC_VER '_CAR'];
else
pars.ID.Artifact = pars.SD_VER;
pars.ID.Spikes = pars.SD_VER;
pars.ID.SpikeFeatures = pars.SD_VER;
pars.ID.Clusters = [pars.SD_VER '_' pars.SC_VER];
pars.ID.Sorted = [pars.SD_VER '_' pars.SC_VER];


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% Feature Extraction
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

pars.ID.SpikeFeatures = 'wavelet';
pars.InterpSamples = 250; % Number of interpolated
% samples per spike. Can help
% with feature extraction.
pars.FeatureExtractionMethodName = 'wavelet'; % implemented to date (2020/06/16):
% wavelet, pca







%% UNLIKELY TO CHANGE
% Parameters for each type stored as individual files in ~/+SD
SDPath = fullfile(nigeLab.utils.getNigelPath,...
'+nigeLab','+defaults','+SD');
% Load all the method-specific parameters:
SDConfigFiles = dir(fullfile(SDPath,'*.m'));
for ff = SDConfigFiles(:)'
parName = ff.name(1:end-2); % dropping .m
pars.(parName) = eval(sprintf('nigeLab.defaults.SD.%s',...
parName));
end

switch pars.FEAT
case 'raw'
pars.FEAT_NAMES = cell(1,2*pars.NINPUT + 1);
for ii = 1:pars.NINPUT
pars.FEAT_NAMES{ii} = sprintf('wav-%02d',ii);
end
for ik = 1:pars.NINPUT
pars.FEAT_NAMES{ii+ik} = sprintf('raw-%02d',ik);
end
pars.FEAT_NAMES{ii+ik+1} = 'raw-mean';
otherwise
pars.FEAT_NAMES = cell(1,pars.NINPUT);
for ii = 1:pars.NINPUT
pars.FEAT_NAMES{ii} = sprintf('%s-%02d',pars.FEAT,ii);
%% Parse output
if nargin < 1
varargout = {pars};
else
varargout = cell(1,nargin);
f = fieldnames(pars);
for i = 1:nargin
idx = ismember(lower(f),lower(varargin{i}));
if sum(idx) == 1
varargout{i} = pars.(f{idx});
end
end
end

end
end
Loading

0 comments on commit 1942e1a

Please sign in to comment.