15 #ifndef GDCMPIXELFORMAT_H
16 #define GDCMPIXELFORMAT_H
60 unsigned short samplesperpixel = 1,
61 unsigned short bitsallocated = 8,
62 unsigned short bitsstored = 8,
63 unsigned short highbit = 7,
64 unsigned short pixelrepresentation = 0 ) :
65 SamplesPerPixel(samplesperpixel),
66 BitsAllocated(bitsallocated),
67 BitsStored(bitsstored),
69 PixelRepresentation(pixelrepresentation) {}
79 unsigned short GetSamplesPerPixel()
const;
80 void SetSamplesPerPixel(
unsigned short spp)
83 SamplesPerPixel = spp;
84 assert( SamplesPerPixel == 1 || SamplesPerPixel == 3 || SamplesPerPixel == 4 );
88 unsigned short GetBitsAllocated()
const
92 void SetBitsAllocated(
unsigned short ba)
100 unsigned short GetBitsStored()
const
102 assert( BitsStored <= BitsAllocated );
105 void SetBitsStored(
unsigned short bs)
107 if( bs <= BitsAllocated )
110 SetHighBit( BitsStored - 1 );
115 unsigned short GetHighBit()
const
117 assert( HighBit < BitsStored );
120 void SetHighBit(
unsigned short hb)
122 if( hb < BitsStored )
127 unsigned short GetPixelRepresentation()
const
129 return (
unsigned short)(PixelRepresentation ? 1 : 0);
131 void SetPixelRepresentation(
unsigned short pr)
133 PixelRepresentation = (
unsigned short)(pr ? 1 : 0);
137 ScalarType GetScalarType()
const;
141 void SetScalarType(ScalarType st);
142 const char *GetScalarTypeAsString()
const;
149 uint8_t GetPixelSize()
const;
152 void Print(std::ostream &os)
const;
155 int64_t GetMin()
const;
158 int64_t GetMax()
const;
165 return GetScalarType() == st;
169 return GetScalarType() != st;
174 SamplesPerPixel == pf.SamplesPerPixel &&
175 BitsAllocated == pf.BitsAllocated &&
176 BitsStored == pf.BitsStored &&
177 HighBit == pf.HighBit &&
178 PixelRepresentation == pf.PixelRepresentation;
183 SamplesPerPixel != pf.SamplesPerPixel ||
184 BitsAllocated != pf.BitsAllocated ||
185 BitsStored != pf.BitsStored ||
186 HighBit != pf.HighBit ||
187 PixelRepresentation != pf.PixelRepresentation;
196 unsigned short SamplesPerPixel;
198 unsigned short BitsAllocated;
200 unsigned short BitsStored;
202 unsigned short HighBit;
204 unsigned short PixelRepresentation;
215 #endif //GDCMPIXELFORMAT_H