-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgetCardiacData.m
52 lines (42 loc) · 1.93 KB
/
getCardiacData.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
function [] = getCardiacData ()
%% REMEMBER TO SET CORRECT FS!!!
%User input variables
Fs = 200 ; %sampling rate (in Hz or fps)
tic
%%Hopefully this wrapper script will allow for user to select folders
%%containing tiff stacks of CM data to analyze, then run through specific
%%cAP data scripts to analyzed APD, risetime, etc.
%Author: Steven Boggess ([email protected])
%%Thanks to Julia and Ben for their guidance and support~
%%Input variables to change:
%% Find FS to set the aqc frequency. All tiff stacks must be of the same frequency to work with this current configuration
%Get all tif filenames from a selected folder
folder_name = uigetdir('C:\Users\Steven Boggess\Documents\Miller Lab\Data\', 'Select Folder Containing Tiff Stacks to Analyze');
% f = dir ([folder_name,'\*.tif']); %cell array containing info of all tif files in directory
f = rdir ([folder_name,'\**\*.tif']);% Will search all subfolders as well.
filenames = {f.name}; %tif filenames collected
disp(folder_name);
tifStacks = cell(numel(filenames),1);
for i=1:numel(filenames)
if strfind(filenames{i} , 'vm')
tiffname = fullfile(filenames{i});
[pathstr,name,ext] = fileparts(filenames{i});
filename = name;
% disp (tiffname); %Show the file you are working with
tifStacks = apdCalc(tiffname,Fs,filename,folder_name);
else if strfind(filenames{i} , 'Vm')
tiffname = fullfile(filenames{i});
[pathstr,name,ext] = fileparts(filenames{i});
filename = name;
% disp (tiffname); %Show the file you are working with
tifStacks = apdCalc(tiffname,Fs,filename,folder_name);
else
disp ('not a vm trace');
end
end
end
fprintf(['While it is always best to believe in one’s self, \n' ...
' a little help from others can be a great blessing. --Iroh \n' ...
' ']);
toc
end