PixelFormat.
More...
#include <gdcmPixelFormat.h>
|
enum | ScalarType {
UINT8,
INT8,
UINT12,
INT12,
UINT16,
INT16,
UINT32,
INT32,
UINT64,
INT64,
FLOAT16,
FLOAT32,
FLOAT64,
SINGLEBIT,
UNKNOWN
} |
|
|
bool | Validate () |
| When image with 24/24/23 was read, need to validate. More...
|
|
PixelFormat.
- Note
- By default the Pixel Type will be instanciated with the following parameters:
- SamplesPerPixel : 1
- BitsAllocated : 8
- BitsStored : 8
- HighBit : 7
- PixelRepresentation : 0
Fundamentally PixelFormat is very close to what DICOM allows. It will be very hard to extend this class for the upcoming DICOM standard where Floating 32 and 64bits will be allowed.
It is also very hard for this class to fully support 64bits integer type (see GetMin / GetMax signature restricted to 64bits signed).
- Examples:
- CreateARGBImage.cxx, CreateCMYKImage.cxx, csa2img.cxx, FixJAIBugJPEGLS.cxx, GetJPEGSamplePrecision.cxx, iU22tomultisc.cxx, and threadgdcm.cxx.
Enumerator |
---|
UINT8 |
|
INT8 |
|
UINT12 |
|
INT12 |
|
UINT16 |
|
INT16 |
|
UINT32 |
|
INT32 |
|
UINT64 |
|
INT64 |
|
FLOAT16 |
|
FLOAT32 |
|
FLOAT64 |
|
SINGLEBIT |
|
UNKNOWN |
|
gdcm::PixelFormat::PixelFormat |
( |
unsigned short |
samplesperpixel = 1 , |
|
|
unsigned short |
bitsallocated = 8 , |
|
|
unsigned short |
bitsstored = 8 , |
|
|
unsigned short |
highbit = 7 , |
|
|
unsigned short |
pixelrepresentation = 0 |
|
) |
| |
|
inlineexplicit |
unsigned short gdcm::PixelFormat::GetBitsAllocated |
( |
| ) |
const |
|
inline |
unsigned short gdcm::PixelFormat::GetBitsStored |
( |
| ) |
const |
|
inline |
unsigned short gdcm::PixelFormat::GetHighBit |
( |
| ) |
const |
|
inline |
HighBit see Tag (0028,0102) US High Bit.
int64_t gdcm::PixelFormat::GetMax |
( |
| ) |
const |
return the max possible of the pixel
int64_t gdcm::PixelFormat::GetMin |
( |
| ) |
const |
return the min possible of the pixel
unsigned short gdcm::PixelFormat::GetPixelRepresentation |
( |
| ) |
const |
|
inline |
PixelRepresentation: 0 or 1, see Tag (0028,0103) US Pixel Representation.
uint8_t gdcm::PixelFormat::GetPixelSize |
( |
| ) |
const |
return the size of the pixel This is the number of words it would take to store one pixel
- Warning
- the return value takes into account the SamplesPerPixel
-
in the rare case when BitsAllocated == 12, the function assume word padding and value returned will be identical as if BitsAllocated == 16
- Examples:
- threadgdcm.cxx.
unsigned short gdcm::PixelFormat::GetSamplesPerPixel |
( |
| ) |
const |
Samples Per Pixel see (0028,0002) US Samples Per Pixel DICOM - only allows 1, 3 and 4 as valid value. Other value are undefined behavior.
- Examples:
- threadgdcm.cxx.
ScalarType gdcm::PixelFormat::GetScalarType |
( |
| ) |
const |
ScalarType does not take into account the sample per pixel.
const char* gdcm::PixelFormat::GetScalarTypeAsString |
( |
| ) |
const |
bool gdcm::PixelFormat::IsCompatible |
( |
const TransferSyntax & |
ts | ) |
const |
bool gdcm::PixelFormat::IsValid |
( |
| ) |
const |
bool gdcm::PixelFormat::operator!= |
( |
ScalarType |
st | ) |
const |
|
inline |
bool gdcm::PixelFormat::operator!= |
( |
const PixelFormat & |
pf | ) |
const |
|
inline |
bool gdcm::PixelFormat::operator== |
( |
ScalarType |
st | ) |
const |
|
inline |
bool gdcm::PixelFormat::operator== |
( |
const PixelFormat & |
pf | ) |
const |
|
inline |
void gdcm::PixelFormat::Print |
( |
std::ostream & |
os | ) |
const |
void gdcm::PixelFormat::SetBitsAllocated |
( |
unsigned short |
ba | ) |
|
|
inline |
void gdcm::PixelFormat::SetBitsStored |
( |
unsigned short |
bs | ) |
|
|
inline |
void gdcm::PixelFormat::SetHighBit |
( |
unsigned short |
hb | ) |
|
|
inline |
void gdcm::PixelFormat::SetPixelRepresentation |
( |
unsigned short |
pr | ) |
|
|
inline |
void gdcm::PixelFormat::SetSamplesPerPixel |
( |
unsigned short |
spp | ) |
|
|
inline |
void gdcm::PixelFormat::SetScalarType |
( |
ScalarType |
st | ) |
|
Set PixelFormat based only on the ScalarType
- Warning
- : You need to call SetScalarType before SetSamplesPerPixel
bool gdcm::PixelFormat::Validate |
( |
| ) |
|
|
protected |
std::ostream& operator<< |
( |
std::ostream & |
_os, |
|
|
const PixelFormat & |
pf |
|
) |
| |
|
friend |
The documentation for this class was generated from the following file: