forked from evodevosys/AroSpotFindingSuite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
auto_trim_directory.m
executable file
·33 lines (29 loc) · 1000 Bytes
/
auto_trim_directory.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
function [] = auto_trim_directory()
run('Aro_parameters.m');
current_files = dir(strcat(RawImageDir, filesep, '*.tif'));
tif_files = {current_files.name};
% make dye subfolders in ImageData folder if they don't already exist
for d = 1:length(dyesUsed)
if ~exist([ImageDir filesep dyesUsed{d}], 'dir')
mkdir([ImageDir filesep dyesUsed{d}]);
end
end
ParRawImageDir = [RawImageDir];
ParImageDir = [ImageDir];
PardyesUsed = dyesUsed;
parfor i = 1:numel(tif_files)
name = tif_files{i};
RawImageDir = ParRawImageDir;
ImageDir = ParImageDir;
dyesUsed = PardyesUsed;
dye = dyesUsed{1};
number_extension = strsplit(name, '-');
number = strsplit(number_extension{2}, '.');
number = number{1};
output_name = [dye number '.tif'];
disp(strcat(RawImageDir, filesep, name));
disp(strcat(ImageDir, filesep, dye, filesep, name));
auto_trim(strcat(RawImageDir, filesep, name), strcat(ImageDir, filesep, dye, filesep, output_name));
end
clear;
return;