forked from smshah87/3D-Barcoding-Spots-Code-GIT
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathOrganize.m
26 lines (20 loc) · 742 Bytes
/
Organize.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
function Organize( hyb, range )
%UNTITLED4 Summary of this function goes here
% Detailed explanation goes here
folder = uigetdir;
for i = hyb(1):hyb(2)
listing(i).listing = dir([folder '/' num2str(i) '/*.tif']);
end
for i = 0:length(listing(hyb(1)).listing)-1
[a, b] = regexp(listing(hyb(1)).listing(i+1).name,'\d*');
roi = ['Pos' listing(hyb(1)).listing(i+1).name(a(end):b(end))];
for j = hyb(1):hyb(2)
file = strfind({listing(j).listing.name}, roi);
pick = ~cellfun(@isempty,file);
filename = listing(j).listing(pick).name;
source = [folder '/' num2str(j) '/' filename];
dest = [folder '/' range '/' roi '/' num2str(j) '.tif'];
copyfile(source, dest);
end
end
end