12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- %Written by Andrey Vinogradov, 2021
- %ADD THE CODE DIRECTORY TO MATLAB PATH [either manually or]:
- %addpath(genpath('your folder'));
- [files,path] = uigetfile('*.h5*', 'Select files for analysis','MultiSelect','on');%(filter)
- if iscell(files)
- list=cellfun(@(x) [path x], files,'UniformOutput',false);
- list=list';
- else
- list={[path files]};
- end
- %% PARAMETERS
- parameters.min_ref_per = 1.5; %detector dead time (in ms)
- parameters.w_pre = 20; %number of pre-event data points stored (def. 20)
- parameters.w_post = 44; %number of post-event data points stored (def. 44)
- %for sampling frequency 24000Hz, pre 20 events, post 44 events
- %Reference values. Adjusted for actual sampling frequency deeper in the code
- % 24000 events/s -> 20/24000, 44/24000 = handles.par.w_post/handles.par.sr
- % pre + post ==> amount of points stored per spike
- parameters.detection = 'both'; %type of threshold 'both','neg' or 'pos'
- parameters.stdmin = 4.5; %minimum threshold (def. 5) for the operation with SWTTEO 4.5 should be selected
- parameters.stdmax = 50; %maximum threshold. Is used for artefact removal
- parameters.interpolation = 'y'; %interpolation for alignment
- parameters.int_factor = 2; %interpolation factor (def. 2)
- parameters.detect_fmin = 200; %high pass filter for detection (def. 300)
- parameters.detect_fmax = 3000; %low pass filter for detection (def. 3000)
- parameters.sort_fmin = 200; %high pass filter for sorting (def. 300)
- parameters.sort_fmax = 3000; %low pass filter for sorting (def. 3000)
- parameters.segments = 1; %nr. of segments in which the data is cutted. --> segmentit voisi analysoida rinnakkain?
- %handles.par.sr = []; %sampling frequency in Hz extracted from the recording file metadata during the processiong
- %setting of the output directory
- csv_directory = uigetdir('title','SELECT YOUR OUTPUT FOLDER');
- %% RUN
- runrunman = FileRunner(parameters, list(:,1),csv_directory); %constructor method application
- [result, runrunman] = runrunman.ReadSpikesFromNextChannel();
- while ~isempty(result)
-
- clear result;
- [result, runrunman] = runrunman.ReadSpikesFromNextChannel();
-
- end
|