ITK
6.0.0
Insight Toolkit
Loading...
Searching...
No Matches
itkMRCHeaderObject.h
Go to the documentation of this file.
1
/*=========================================================================
2
*
3
* Copyright NumFOCUS
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
* https://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 itkMRCHeaderObject_h
19
#define itkMRCHeaderObject_h
20
#include "ITKIOMRCExport.h"
21
22
#include "
itkObjectFactory.h
"
23
#include "
itkLightObject.h
"
24
#include "
itkIntTypes.h
"
25
26
namespace
itk
27
{
28
48
class
ITKIOMRC_EXPORT
MRCHeaderObject
:
public
LightObject
49
{
50
public
:
51
ITK_DISALLOW_COPY_AND_MOVE(
MRCHeaderObject
);
52
54
using
Self
=
MRCHeaderObject
;
55
using
Superclass
=
LightObject
;
56
using
Pointer
=
SmartPointer<Self>
;
57
using
ConstPointer
=
SmartPointer<const Self>
;
58
66
struct
Header
67
{
68
int32_t
nx
;
69
int32_t
ny
;
70
int32_t
nz
;
71
81
int32_t
mode
;
82
84
int32_t
nxstart
;
85
int32_t
nystart
;
86
int32_t
nzstart
;
87
89
int32_t
mx
;
90
int32_t
my
;
91
int32_t
mz
;
92
94
float
xlen
;
95
float
ylen
;
96
float
zlen
;
97
99
float
alpha
;
100
float
beta
;
101
float
gamma
;
102
103
int32_t
mapc
;
104
int32_t
mapr
;
105
int32_t
maps
;
106
107
// These need to be set for proper scaling of
108
// non byte data.
109
float
amin
;
110
float
amax
;
111
float
amean
;
112
113
int16_t
ispg
;
114
int16_t
nsymbt
;
115
116
int32_t
next
;
117
int16_t
creatid
;
118
119
int8_t
notused1
[30];
120
121
// These two values specify the structure of data in the
122
// extended header; their meaning depend on whether the
123
// extended header has the Agard format, a series of
124
// 4-byte integers then real numbers, or has data
125
// produced by SerialEM, a series of short integers.
126
// SerialEM stores a float as two shorts, s1 and s2, by:
127
// value = (sign of s1)*(|s1|*256 + (|s2| modulo 256))
128
// * 2**((sign of s2) * (|s2|/256))
129
130
int16_t
nint
;
// Number of integers per section (Agard format) or
131
// number of bytes per section (SerialEM format)
132
int16_t
nreal
;
// Number of reals per section (Agard format) or
133
// flags for which types of short data (SerialEM format):
134
// 1 = tilt angle * 100 (2 bytes)
135
// 2 = piece coordinates for montage (6 bytes)
136
// 4 = Stage position * 25 (4 bytes)
137
// 8 = Magnification / 100 (2 bytes)
138
// 16 = Intensity * 25000 (2 bytes)
139
// 32 = Exposure dose in e-/A2, a float in 4 bytes
140
// 128, 512: Reserved for 4-byte items
141
// 64, 256, 1024: Reserved for 2-byte items
142
// If the number of bytes implied by these flags does
143
// not add up to the value in nint, then nint and nreal
144
// are interpreted as ints and reals per section
145
147
int8_t
notused2
[28];
148
149
// Explanation of type of data.
150
int16_t
idtype
;
// ( 0 = mono, 1 = tilt, 2 = tilts, 3 = lina, 4 =
151
// lins)
152
int16_t
lens
;
153
int16_t
nd1
;
// for idtype = 1, nd1 = axis (1, 2, or 3)
154
int16_t
nd2
;
155
int16_t
vd1
;
// vd1 = 100. * tilt increment
156
int16_t
vd2
;
// vd2 = 100. * starting angle
157
158
// Used to rotate model to match new rotated image.
159
float
tiltangles
[6];
// 0,1,2 = original: 3,4,5 = current
160
161
// NEW-STYLE MRC image2000 HEADER - IMOD 2.6.20 and above:
162
float
xorg
;
// Origin of image. Used to auto translate model
163
float
yorg
;
// to match a new image that has been translated.
164
float
zorg
;
165
166
char
cmap
[4];
167
char
stamp
[4];
169
float
rms
;
170
171
// ALL HEADERS:
172
int32_t
nlabl
;
173
char
label
[10][80];
174
};
175
177
struct
FeiExtendedHeader
178
{
179
float
atilt
;
180
float
btilt
;
181
float
xstage
;
182
float
ystage
;
183
float
zstage
;
184
float
xshift
;
185
float
yshift
;
186
float
defocus
;
187
float
exptime
;
188
float
meanint
;
189
float
tiltaxis
;
190
float
pixelsize
;
191
float
magnification
;
192
char
notused
[76];
193
};
194
196
enum
197
{
198
MRCHEADER_MODE_UINT8
= 0,
199
MRCHEADER_MODE_INT8
= 0,
200
MRCHEADER_MODE_IN16
= 1,
201
MRCHEADER_MODE_FLOAT
= 2,
202
MRCHEADER_MODE_COMPLEX_INT16
= 3,
203
MRCHEADER_MODE_COMPLEX_FLOAT
= 4,
204
MRCHEADER_MODE_UINT16
= 6,
205
MRCHEADER_MODE_RGB_BYTE
= 16
206
};
207
209
enum
210
{
211
MRCHEADER_MAP_X
= 1,
212
MRCHEADER_MAP_Y
= 2,
213
MRCHEADER_MAP_Z
= 3
214
};
215
216
public
:
218
itkNewMacro(
Self
);
219
221
itkOverrideGetNameOfClassMacro(
MRCHeaderObject
);
222
223
void
224
DeepCopy
(
ConstPointer
h);
225
236
bool
237
SetHeader
(
const
Header
* buffer);
238
239
const
Header
&
240
GetHeader
()
const
;
241
250
bool
251
SetExtendedHeader
(
const
void
* buffer);
252
256
SizeValueType
257
GetExtendedHeaderSize
()
const
;
258
260
SizeValueType
261
GetHeaderSize
()
const
262
{
263
return
sizeof
(
Header
);
264
}
265
269
bool
270
IsOriginalHeaderBigEndian
()
const
;
271
273
Header
m_Header
{};
// FIXME : This should be private and
274
// should have Get/Set Methods.
275
276
protected
:
277
MRCHeaderObject
();
278
~MRCHeaderObject
()
override
;
279
281
void
282
swapHeader
(
bool
bigEndian);
283
285
void
286
PrintSelf
(std::ostream & os,
Indent
indent)
const override
;
287
288
private
:
289
SizeValueType
m_ExtendedHeaderSize
{ 0 };
290
void
*
m_ExtendedHeader
{
nullptr
};
291
292
FeiExtendedHeader
*
m_ExtendedFeiHeader
{
nullptr
};
293
294
bool
m_BigEndianHeader
{};
295
};
296
}
// namespace itk
297
298
#endif
itk::Indent
Control indentation during Print() invocation.
Definition
itkIndent.h:50
itk::LightObject::LightObject
LightObject()
itk::MRCHeaderObject::MRCHeaderObject
MRCHeaderObject()
itk::MRCHeaderObject::m_ExtendedHeader
void * m_ExtendedHeader
Definition
itkMRCHeaderObject.h:290
itk::MRCHeaderObject::GetHeader
const Header & GetHeader() const
itk::MRCHeaderObject::SetHeader
bool SetHeader(const Header *buffer)
itk::MRCHeaderObject::DeepCopy
void DeepCopy(ConstPointer h)
itk::MRCHeaderObject::m_Header
Header m_Header
Definition
itkMRCHeaderObject.h:273
itk::MRCHeaderObject::MRCHEADER_MODE_IN16
@ MRCHEADER_MODE_IN16
Definition
itkMRCHeaderObject.h:200
itk::MRCHeaderObject::MRCHEADER_MODE_RGB_BYTE
@ MRCHEADER_MODE_RGB_BYTE
Definition
itkMRCHeaderObject.h:205
itk::MRCHeaderObject::MRCHEADER_MODE_COMPLEX_FLOAT
@ MRCHEADER_MODE_COMPLEX_FLOAT
Definition
itkMRCHeaderObject.h:203
itk::MRCHeaderObject::MRCHEADER_MODE_INT8
@ MRCHEADER_MODE_INT8
Definition
itkMRCHeaderObject.h:199
itk::MRCHeaderObject::MRCHEADER_MODE_COMPLEX_INT16
@ MRCHEADER_MODE_COMPLEX_INT16
Definition
itkMRCHeaderObject.h:202
itk::MRCHeaderObject::MRCHEADER_MODE_UINT8
@ MRCHEADER_MODE_UINT8
Definition
itkMRCHeaderObject.h:198
itk::MRCHeaderObject::MRCHEADER_MODE_FLOAT
@ MRCHEADER_MODE_FLOAT
Definition
itkMRCHeaderObject.h:201
itk::MRCHeaderObject::MRCHEADER_MODE_UINT16
@ MRCHEADER_MODE_UINT16
Definition
itkMRCHeaderObject.h:204
itk::MRCHeaderObject::SetExtendedHeader
bool SetExtendedHeader(const void *buffer)
itk::MRCHeaderObject::ConstPointer
SmartPointer< const Self > ConstPointer
Definition
itkMRCHeaderObject.h:57
itk::MRCHeaderObject::GetHeaderSize
SizeValueType GetHeaderSize() const
Definition
itkMRCHeaderObject.h:261
itk::MRCHeaderObject::m_BigEndianHeader
bool m_BigEndianHeader
Definition
itkMRCHeaderObject.h:294
itk::MRCHeaderObject::IsOriginalHeaderBigEndian
bool IsOriginalHeaderBigEndian() const
itk::MRCHeaderObject::GetExtendedHeaderSize
SizeValueType GetExtendedHeaderSize() const
itk::MRCHeaderObject::Superclass
LightObject Superclass
Definition
itkMRCHeaderObject.h:55
itk::MRCHeaderObject::Self
MRCHeaderObject Self
Definition
itkMRCHeaderObject.h:54
itk::MRCHeaderObject::m_ExtendedFeiHeader
FeiExtendedHeader * m_ExtendedFeiHeader
Definition
itkMRCHeaderObject.h:292
itk::MRCHeaderObject::swapHeader
void swapHeader(bool bigEndian)
itk::MRCHeaderObject::m_ExtendedHeaderSize
SizeValueType m_ExtendedHeaderSize
Definition
itkMRCHeaderObject.h:289
itk::MRCHeaderObject::PrintSelf
void PrintSelf(std::ostream &os, Indent indent) const override
itk::MRCHeaderObject::MRCHEADER_MAP_Z
@ MRCHEADER_MAP_Z
Definition
itkMRCHeaderObject.h:213
itk::MRCHeaderObject::MRCHEADER_MAP_Y
@ MRCHEADER_MAP_Y
Definition
itkMRCHeaderObject.h:212
itk::MRCHeaderObject::MRCHEADER_MAP_X
@ MRCHEADER_MAP_X
Definition
itkMRCHeaderObject.h:211
itk::MRCHeaderObject::Pointer
SmartPointer< Self > Pointer
Definition
itkMRCHeaderObject.h:56
itk::MRCHeaderObject::~MRCHeaderObject
~MRCHeaderObject() override
itk::SmartPointer
Implements transparent reference counting.
Definition
itkSmartPointer.h:52
itkIntTypes.h
itkLightObject.h
itkObjectFactory.h
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition
itkAnatomicalOrientation.h:30
itk::SizeValueType
unsigned long SizeValueType
Definition
itkIntTypes.h:86
itk::MRCHeaderObject::FeiExtendedHeader
Definition
itkMRCHeaderObject.h:178
itk::MRCHeaderObject::FeiExtendedHeader::pixelsize
float pixelsize
Definition
itkMRCHeaderObject.h:190
itk::MRCHeaderObject::FeiExtendedHeader::xstage
float xstage
Definition
itkMRCHeaderObject.h:181
itk::MRCHeaderObject::FeiExtendedHeader::meanint
float meanint
Definition
itkMRCHeaderObject.h:188
itk::MRCHeaderObject::FeiExtendedHeader::defocus
float defocus
Definition
itkMRCHeaderObject.h:186
itk::MRCHeaderObject::FeiExtendedHeader::magnification
float magnification
Definition
itkMRCHeaderObject.h:191
itk::MRCHeaderObject::FeiExtendedHeader::exptime
float exptime
Definition
itkMRCHeaderObject.h:187
itk::MRCHeaderObject::FeiExtendedHeader::tiltaxis
float tiltaxis
Definition
itkMRCHeaderObject.h:189
itk::MRCHeaderObject::FeiExtendedHeader::notused
char notused[76]
Definition
itkMRCHeaderObject.h:192
itk::MRCHeaderObject::FeiExtendedHeader::btilt
float btilt
Definition
itkMRCHeaderObject.h:180
itk::MRCHeaderObject::FeiExtendedHeader::atilt
float atilt
Definition
itkMRCHeaderObject.h:179
itk::MRCHeaderObject::FeiExtendedHeader::xshift
float xshift
Definition
itkMRCHeaderObject.h:184
itk::MRCHeaderObject::FeiExtendedHeader::zstage
float zstage
Definition
itkMRCHeaderObject.h:183
itk::MRCHeaderObject::FeiExtendedHeader::ystage
float ystage
Definition
itkMRCHeaderObject.h:182
itk::MRCHeaderObject::FeiExtendedHeader::yshift
float yshift
Definition
itkMRCHeaderObject.h:185
itk::MRCHeaderObject::Header
Definition
itkMRCHeaderObject.h:67
itk::MRCHeaderObject::Header::mapr
int32_t mapr
Definition
itkMRCHeaderObject.h:104
itk::MRCHeaderObject::Header::nx
int32_t nx
Definition
itkMRCHeaderObject.h:68
itk::MRCHeaderObject::Header::stamp
char stamp[4]
Definition
itkMRCHeaderObject.h:167
itk::MRCHeaderObject::Header::nystart
int32_t nystart
Definition
itkMRCHeaderObject.h:85
itk::MRCHeaderObject::Header::tiltangles
float tiltangles[6]
Definition
itkMRCHeaderObject.h:159
itk::MRCHeaderObject::Header::nz
int32_t nz
Definition
itkMRCHeaderObject.h:70
itk::MRCHeaderObject::Header::nzstart
int32_t nzstart
Definition
itkMRCHeaderObject.h:86
itk::MRCHeaderObject::Header::gamma
float gamma
Definition
itkMRCHeaderObject.h:101
itk::MRCHeaderObject::Header::nlabl
int32_t nlabl
Definition
itkMRCHeaderObject.h:172
itk::MRCHeaderObject::Header::vd1
int16_t vd1
Definition
itkMRCHeaderObject.h:155
itk::MRCHeaderObject::Header::ylen
float ylen
Definition
itkMRCHeaderObject.h:95
itk::MRCHeaderObject::Header::nreal
int16_t nreal
Definition
itkMRCHeaderObject.h:132
itk::MRCHeaderObject::Header::nxstart
int32_t nxstart
Definition
itkMRCHeaderObject.h:84
itk::MRCHeaderObject::Header::beta
float beta
Definition
itkMRCHeaderObject.h:100
itk::MRCHeaderObject::Header::zorg
float zorg
Definition
itkMRCHeaderObject.h:164
itk::MRCHeaderObject::Header::mapc
int32_t mapc
Definition
itkMRCHeaderObject.h:103
itk::MRCHeaderObject::Header::lens
int16_t lens
Definition
itkMRCHeaderObject.h:152
itk::MRCHeaderObject::Header::nint
int16_t nint
Definition
itkMRCHeaderObject.h:130
itk::MRCHeaderObject::Header::nsymbt
int16_t nsymbt
Definition
itkMRCHeaderObject.h:114
itk::MRCHeaderObject::Header::rms
float rms
Definition
itkMRCHeaderObject.h:169
itk::MRCHeaderObject::Header::label
char label[10][80]
Definition
itkMRCHeaderObject.h:173
itk::MRCHeaderObject::Header::vd2
int16_t vd2
Definition
itkMRCHeaderObject.h:156
itk::MRCHeaderObject::Header::next
int32_t next
Definition
itkMRCHeaderObject.h:116
itk::MRCHeaderObject::Header::maps
int32_t maps
Definition
itkMRCHeaderObject.h:105
itk::MRCHeaderObject::Header::zlen
float zlen
Definition
itkMRCHeaderObject.h:96
itk::MRCHeaderObject::Header::cmap
char cmap[4]
Definition
itkMRCHeaderObject.h:166
itk::MRCHeaderObject::Header::amin
float amin
Definition
itkMRCHeaderObject.h:109
itk::MRCHeaderObject::Header::alpha
float alpha
Definition
itkMRCHeaderObject.h:99
itk::MRCHeaderObject::Header::xorg
float xorg
Definition
itkMRCHeaderObject.h:162
itk::MRCHeaderObject::Header::nd1
int16_t nd1
Definition
itkMRCHeaderObject.h:153
itk::MRCHeaderObject::Header::amean
float amean
Definition
itkMRCHeaderObject.h:111
itk::MRCHeaderObject::Header::ispg
int16_t ispg
Definition
itkMRCHeaderObject.h:113
itk::MRCHeaderObject::Header::mz
int32_t mz
Definition
itkMRCHeaderObject.h:91
itk::MRCHeaderObject::Header::ny
int32_t ny
Definition
itkMRCHeaderObject.h:69
itk::MRCHeaderObject::Header::xlen
float xlen
Definition
itkMRCHeaderObject.h:94
itk::MRCHeaderObject::Header::my
int32_t my
Definition
itkMRCHeaderObject.h:90
itk::MRCHeaderObject::Header::notused1
int8_t notused1[30]
Definition
itkMRCHeaderObject.h:119
itk::MRCHeaderObject::Header::mx
int32_t mx
Definition
itkMRCHeaderObject.h:89
itk::MRCHeaderObject::Header::notused2
int8_t notused2[28]
Definition
itkMRCHeaderObject.h:147
itk::MRCHeaderObject::Header::mode
int32_t mode
Definition
itkMRCHeaderObject.h:81
itk::MRCHeaderObject::Header::amax
float amax
Definition
itkMRCHeaderObject.h:110
itk::MRCHeaderObject::Header::idtype
int16_t idtype
Definition
itkMRCHeaderObject.h:150
itk::MRCHeaderObject::Header::nd2
int16_t nd2
Definition
itkMRCHeaderObject.h:154
itk::MRCHeaderObject::Header::creatid
int16_t creatid
Definition
itkMRCHeaderObject.h:117
itk::MRCHeaderObject::Header::yorg
float yorg
Definition
itkMRCHeaderObject.h:163
ITK
Modules
IO
MRC
include
itkMRCHeaderObject.h
Generated on
unknown
for ITK by
1.13.2
Tarballs of release and nightly generated Doxygen documentation are available in the
InsightSoftwareConsortium/ITKDoxygen
GitHub Releases
.