-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathImageInfoContainer.m
More file actions
57 lines (46 loc) · 1.74 KB
/
ImageInfoContainer.m
File metadata and controls
57 lines (46 loc) · 1.74 KB
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
53
54
55
56
classdef ImageInfoContainer < handle
properties
ImageInfos = ImageInfo.empty;
SelectedImage = "";
end
methods
function obj = ImageInfoContainer(imageFileList)
for ind=1:length(imageFileList)
currentImageFile = imageFileList(ind);
directory = Path.GetDirectoryName(currentImageFile);
if contains(directory, 'sol')
category = directory;
else
category = "";
end
obj.ImageInfos(ind) = ImageInfo(currentImageFile, category);
end
obj.SelectedImage = obj.ImageInfos(1).GetIndentifier();
end
function SetSelectedImage(obj, newSelectedImage)
obj.SelectedImage = newSelectedImage;
end
function imageInfo = GetSelectedImageInfo(obj)
imageInfo = obj.GetImageInfo(obj.SelectedImage);
end
function image = GetSelectedImage(obj)
imageInfo = obj.GetSelectedImageInfo();
image = imageInfo.GetImage();
end
function imageInfo = GetImageInfo(obj, identifier)
for ind=1:length(obj.ImageInfos)
currentImageInfo = obj.ImageInfos(ind);
if strcmp(identifier, currentImageInfo.GetIndentifier())
imageInfo = currentImageInfo;
break;
end
end
end
function identifiers = GetAllImageIdentifiers(obj)
for ind=1:length(obj.ImageInfos)
currentImageInfo = obj.ImageInfos(ind);
identifiers{ind} = currentImageInfo.GetIndentifier();
end
end
end
end