-
Notifications
You must be signed in to change notification settings - Fork 0
/
ImageInfo.cpp
146 lines (124 loc) · 6.03 KB
/
ImageInfo.cpp
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
/* ----------------------------------------------------------------------------
ImageInfo.cpp
MIView - Medical Image Viewer
Copyright (C) 2009-2011 Gregory Book
MIView is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------- */
#include "MainFrame.h"
//#include "LogWindow.h"
#include "ImageData.h"
#include "ImageInfo.h"
ImageInfo::ImageInfo(void)
{
}
ImageInfo::~ImageInfo(void)
{
}
void ImageInfo::InitializeVariables() {
dirPath = "";
minPixelValues = Color(DBL_MAX, DBL_MAX, DBL_MAX, DBL_MAX);
maxPixelValues = Color(DBL_MIN, DBL_MIN, DBL_MIN, DBL_MIN);
ImageXSize = ImageYSize = ImageZSize = ImageTSize = 1;
VolumeXSize = VolumeYSize = VolumeZSize = VolumeTSize = 1;
origin = XYZTriplet(0.0, 0.0, 0.0);
PixelByteSize = 0;
BitsStored = 0;
BitsAllocated = 0;
HighBitPosition = 0;
SamplesPerPixel = 0;
IsRGB = false;
IsSignedPixelData = false;
IsMultiSlice = false;
IsMultiFile = false;
IsMonochrome = false;
// PlanarConfiguration = 0;
}
// --------------------------------------------------------
// ---------- GetMaxPixelValue ----------------------------
// --------------------------------------------------------
double ImageInfo::GetMaxPixelValue()
{
double maxPixVal = 0.0;
/* compare red and green */
if (maxPixelValues.Red() > maxPixelValues.Green())
maxPixVal = maxPixelValues.Red();
else
maxPixVal = maxPixelValues.Green();
/* compare the previous max to the blue */
if (maxPixVal > maxPixelValues.Blue())
maxPixVal = maxPixVal;
else
maxPixVal = maxPixelValues.Blue();
return maxPixVal;
}
Color ImageInfo::GetMinPixelValues() { return minPixelValues; }
Color ImageInfo::GetMaxPixelValues() { return maxPixelValues; }
bool ImageInfo::GetIsMultiSlice() { return IsMultiSlice; }
bool ImageInfo::GetIsMultiFile() { return IsMultiFile; }
bool ImageInfo::GetIsMonochrome() { return IsMonochrome; }
bool ImageInfo::GetIsRGB() { return IsRGB; }
bool ImageInfo::GetIsSignedPixelData() { return IsSignedPixelData; }
int ImageInfo::GetPixelType() { return PixelType; }
int ImageInfo::GetSamplesPerPixel() { return SamplesPerPixel; }
int ImageInfo::GetPixelByteSize() { return PixelByteSize; }
int ImageInfo::GetBitsStored() { return BitsStored; }
int ImageInfo::GetBitsAllocated() { return BitsAllocated; }
int ImageInfo::GetHighBitPosition() { return HighBitPosition; }
int ImageInfo::GetPlanarConfiguration() { return PlanarConfiguration; }
wxString ImageInfo::GetPixelTypeStr() { return PixelTypeStr; } /* can be: 8U, 8S, 16U, 16S, 32U, 32S, FD */
wxString ImageInfo::GetDirPath() { return dirPath; }
wxString ImageInfo::GetFilePrefix() { return filePrefix; }
wxArrayString ImageInfo::GetFileList() { return fileList; }
int ImageInfo::GetImageXSize() { return ImageXSize; }
int ImageInfo::GetImageYSize() { return ImageYSize; }
int ImageInfo::GetImageZSize() { return ImageZSize; }
int ImageInfo::GetImageTSize() { return ImageTSize; }
int ImageInfo::GetVolumeXSize() { return VolumeXSize; }
int ImageInfo::GetVolumeYSize() { return VolumeYSize; }
int ImageInfo::GetVolumeZSize() { return VolumeZSize; }
int ImageInfo::GetVolumeTSize() { return VolumeTSize; }
XYZTriplet ImageInfo::GetOrigin() { return origin; }
XYZTriplet ImageInfo::GetSpacing() { return spacing; }
int ImageInfo::GetFileType() { return fileType; }
int ImageInfo::GetImageType() { return imageType; }
int ImageInfo::GetVolumeType() { return volumeType; }
void ImageInfo::SetMinPixelValues(Color value) { minPixelValues = value; }
void ImageInfo::SetMaxPixelValues(Color value) { maxPixelValues = value; }
void ImageInfo::SetIsMultiSlice(bool value) { IsMultiSlice = value; }
void ImageInfo::SetIsMultiFile(bool value) { IsMultiFile = value; }
void ImageInfo::SetIsMonochrome(bool value) { IsMonochrome = value; }
void ImageInfo::SetIsRGB(bool value) { IsRGB = value; }
void ImageInfo::SetIsSignedPixelData(bool value) { IsSignedPixelData = value; }
void ImageInfo::SetPixelType(int value) { PixelType = value; }
void ImageInfo::SetSamplesPerPixel(int value) { SamplesPerPixel = value; }
void ImageInfo::SetPixelByteSize(int value) { PixelByteSize = value; }
void ImageInfo::SetBitsStored(int value) { BitsStored = value; }
void ImageInfo::SetBitsAllocated(int value) { BitsAllocated = value; }
void ImageInfo::SetHighBitPosition(int value) { HighBitPosition = value; }
void ImageInfo::SetPlanarConfiguration(int value) { PlanarConfiguration = value; }
void ImageInfo::SetPixelTypeStr(wxString value) { PixelTypeStr = value; }
void ImageInfo::SetDirPath(wxString value) { dirPath = value; }
void ImageInfo::SetFilePrefix(wxString value) { filePrefix = value; }
void ImageInfo::SetFileList(wxArrayString value) { fileList = value; }
void ImageInfo::SetImageXSize(int value) { ImageXSize = value; }
void ImageInfo::SetImageYSize(int value) { ImageYSize = value; }
void ImageInfo::SetImageZSize(int value) { ImageZSize = value; }
void ImageInfo::SetImageTSize(int value) { ImageTSize = value; }
void ImageInfo::SetVolumeXSize(int value) { VolumeXSize = value; }
void ImageInfo::SetVolumeYSize(int value) { VolumeYSize = value; }
void ImageInfo::SetVolumeZSize(int value) { VolumeZSize = value; }
void ImageInfo::SetVolumeTSize(int value) { VolumeTSize = value; }
void ImageInfo::SetOrigin(XYZTriplet value) { origin = value; }
void ImageInfo::SetSpacing(XYZTriplet value) { spacing = value; }
void ImageInfo::SetFileType(int value) { fileType = value; }
void ImageInfo::SetImageType(int value) { imageType = value; }
void ImageInfo::SetVolumeType(int value) { volumeType = value; }