ITK
4.4.0
Insight Segmentation and Registration Toolkit
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
ITK
Modules
Bridge
VtkGlue
include
QuickView.h
Go to the documentation of this file.
1
/*=========================================================================
2
*
3
* Copyright Insight Software Consortium
4
*
5
* Licensed under the Apache License, Version 2.0 (the "License");
6
* you may not use this file except in compliance with the License.
7
* You may obtain a copy of the License at
8
*
9
* http://www.apache.org/licenses/LICENSE-2.0.txt
10
*
11
* Unless required by applicable law or agreed to in writing, software
12
* distributed under the License is distributed on an "AS IS" BASIS,
13
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
* See the License for the specific language governing permissions and
15
* limitations under the License.
16
*
17
*=========================================================================*/
18
#ifndef __QuickView_h
19
#define __QuickView_h
20
21
#include <vector>
22
#include <algorithm>
23
#include <string>
24
25
#include <
itkImage.h
>
26
#include <
itkRGBPixel.h
>
27
#include <
itkIntTypes.h
>
28
33
class
ImageInfo
34
{
35
public
:
36
typedef
itk::Image<unsigned char, 2>
ImageType
;
37
38
ImageInfo
(
ImageType
*image, std::string description=
""
)
39
{
40
m_Image
= image;
41
m_Description
= description;
42
}
43
44
ImageType::Pointer
m_Image
;
45
std::string
m_Description
;
46
};
47
52
class
RGBImageInfo
53
{
54
public
:
55
typedef
itk::Image<itk::RGBPixel<unsigned char>
, 2>
ImageType
;
56
RGBImageInfo
(
ImageType
*image, std::string description=
""
)
57
{
58
m_Image
= image;
59
m_Description
= description;
60
}
61
62
ImageType::Pointer
m_Image
;
63
std::string
m_Description
;
64
};
65
105
class
QuickView
106
{
107
public
:
108
QuickView
()
109
{
110
m_ShareCamera
=
true
;
111
m_Counter
= 0;
112
m_Snapshot
=
false
;
113
m_SnapshotPath
=
""
;
114
m_SnapshotPrefix
=
"snapshot_"
;
115
m_SnapshotExtension
=
"png"
;
116
}
118
template
<
class
TImage>
void
AddImage
(
119
TImage *,
120
bool
FlipVertical=
true
,
121
std::string Description=
""
);
122
124
template
<
class
TImage>
void
AddRGBImage
(
125
TImage *,
126
bool
FlipVertical=
true
,
127
std::string Description=
""
);
128
132
void
Visualize
(
bool
interact=
true
);
133
134
136
void
ShareCameraOff
()
137
{
138
m_ShareCamera
=
false
;
139
}
140
142
void
ShareCameraOn
()
143
{
144
m_ShareCamera
=
true
;
145
}
146
148
void
SnapshotOn
()
149
{
150
m_Snapshot
=
true
;
151
}
152
154
void
SnapshotOff
()
155
{
156
m_Snapshot
=
false
;
157
}
158
159
void
SetSnapshotPath
(
const
std::string& iPath )
160
{
161
m_SnapshotPath
= iPath;
162
}
163
164
void
SetSnapshotPrefix
(
const
std::string& iPrefix )
165
{
166
m_SnapshotPrefix
= iPrefix;
167
}
168
170
void
SetSnapshotExtension
(
const
std::string& iExtension )
171
{
172
m_SnapshotExtension
= iExtension;
173
std::transform(
174
m_SnapshotExtension
.begin(),
175
m_SnapshotExtension
.end(),
176
m_SnapshotExtension
.begin(),
177
::tolower );
178
}
180
181
private
:
182
std::vector<ImageInfo>
Images
;
// Container for images
183
std::vector<RGBImageInfo>
RGBImages
;
// Container for rgb images
184
itk::IdentifierType
m_Counter
;
185
std::string
m_SnapshotPath
;
186
std::string
m_SnapshotPrefix
;
187
std::string
m_SnapshotExtension
;
188
bool
m_ShareCamera
;
189
bool
m_Snapshot
;
190
};
191
192
#endif
193
Generated on Mon May 13 2013 01:13:35 for ITK by
1.8.3.1