-
Notifications
You must be signed in to change notification settings - Fork 0
/
O_Get_Image_File.m
32 lines (20 loc) · 1.37 KB
/
O_Get_Image_File.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
function [im]=O_Get_Image_File(DirName,Nums,NumberLengths,BaseName,FileType,Image_Retrieval_data)
if strcmpi(FileType,'FileType1')
% NameType #1
% example: LKB1_PML_S0003(P4)_C02_M0000_ORG.tif
FileName=[BaseName '_S' sprintf(['%0' num2str(NumberLengths(1)) 'd'],Nums.S) '(P' num2str(Nums.P) ')_C' sprintf(['%0' num2str(NumberLengths(3)) 'd'],Nums.Channal-1) '_M' sprintf(['%0' num2str(NumberLengths(4)) 'd'],Nums.M) '_ORG.tif'];
im=double(imread([DirName '\' FileName]));
elseif strcmpi(FileType,'FileType2')
% NameType #2
% example: LKB1_PML_S0003(P4)_C02_M0000_ORG.tif
FileName=[BaseName '_S' sprintf(['%0' num2str(NumberLengths(1)) 'd'],Nums.S) '(TR' num2str(Nums.P) ')_C' sprintf(['%0' num2str(NumberLengths(3)) 'd'],Nums.Channal-1) '_M' sprintf(['%0' num2str(NumberLengths(4)) 'd'],Nums.M) '_ORG.tif'];
im=double(imread([DirName '\' FileName]));
elseif strcmpi(FileType,'FileType3')
Rows='ABCDEFGH';
FileName=[BaseName '_S' sprintf(['%0' num2str(NumberLengths(1)) 'd'],Nums.S) '(' Rows(Nums.Row) num2str(Nums.Column)...
'-' Rows(Nums.Row) num2str(Nums.Column) ')_C' sprintf(['%0' num2str(NumberLengths(2)) 'd'],Nums.Channal-1) ...
'(' Image_Retrieval_data.ch_names{Nums.Channal} ')_M' sprintf(['%0' num2str(NumberLengths(3)) 'd'],Nums.M) ...
'_ORG.tif'];
im=double(imread([DirName '\' FileName]));
elseif strcmpi(FileType,'Operetta')
end