-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 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
1 parent
5425644
commit 1942e1a
Showing
63 changed files
with
3,513 additions
and
745 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.