-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjkimagescm.m
48 lines (44 loc) · 1009 Bytes
/
jkimagescm.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
function jkimagescm(fn,varargin)
[a, b] = strtok(fn,'.');
if isempty(b)
fn = [fn, '.align'];
elseif ~strcmp(b, '.align')
fn = [a,'.align'];
end
try
cd(['D:\2p\JK\', strtok(fn,'_')])
load(fn,'-mat')
catch
try
cd(['D:\TPM\', strtok(fn,'_')])
load(fn,'-mat')
catch
try
cd(['Y:\JK_temp\2p\', strtok(fn,'_')])
load(fn,'-mat')
catch
error('Wrong directory')
end
end
end
ind = 1;
if nargin > 1
ind = varargin{1};
end
figure, hold on,
% [mouse, remain] = strtok(fn,'_');
% pod = strtok(remain,'_');
% title(['JK', mouse, ', POD ', pod],'FontSize',15')
if iscell(m)
if length(ind) == 1
imagesc(m{ind}), axis image, axis off
else
nrow = floor(sqrt(length(ind)));
ncol = ceil(length(ind)/nrow);
for i = 1 : length(ind)
subplot(nrow, ncol, i), imagesc(m{ind(i)}), axis image, axis off
end
end
else
imagesc(m), axis image, axis off
end