[Dcmlib] PixelType: OS ?
Mathieu Malaterre
mathieu.malaterre at kitware.com
Tue Jun 8 19:14:32 CEST 2004
Salut,
J'ai un petit probleme en essayant de lire une image j'ai un pixel type
'OS' est-ce que c'est possible ?
Merci
Mathieu
std::string gdcmHeaderHelper::GetPixelType() {
std::string BitsAlloc;
BitsAlloc = GetEntryByNumber(0x0028, 0x0100);
if (BitsAlloc == GDCM_UNFOUND) { // Bits Allocated
dbg.Verbose(0, "gdcmHeader::GetPixelType: unfound Bits Allocated");
BitsAlloc = std::string("16");
}
if (BitsAlloc == "12") // It will be unpacked
BitsAlloc = std::string("16");
else if (BitsAlloc == "24") // (in order no to be messed up
BitsAlloc = std::string("8"); // by old RGB images)
std::string Signed;
Signed = GetEntryByNumber(0x0028, 0x0103);
if (Signed == GDCM_UNFOUND) { // "Pixel Representation"
dbg.Verbose(0, "gdcmHeader::GetPixelType: unfound Pixel
Representation");
BitsAlloc = std::string("0");
}
if (BitsAlloc == "64") // to help users that want to deal with DOUBLE
return("FD");
if (Signed == "0")
Signed = std::string("U");
else
Signed = std::string("S");
return( BitsAlloc + Signed);
}
More information about the Dcmlib
mailing list