return (size_t)0;
}
}
+
// Just to 'see' was was actually read on disk :-(
// Some troubles expected
-//FILE * fpSpurious;
-//fpSpurious=fopen("SpuriousFile.raw","w");
-//fwrite(destination,lgrTotale, 1,fpSpurious);
-//fclose(fpSpurious);
-
+FILE * fpSpurious;
+fpSpurious=fopen("SpuriousFile.raw","w");
+fwrite(destination,lgrTotale, 1,fpSpurious);
+fclose(fpSpurious);
// *Try* to deal with the color
// Planar configuration = 2 : 1 gray Plane + 3 LUT
// Well ... supposed to be !
- // See US-PAL-8-10x-echo.dcm, PlanarConfiguration=0,PhotometricInterpretation=PALETTE COLOR
+ // See US-PAL-8-10x-echo.dcm: PlanarConfiguration=0,PhotometricInterpretation=PALETTE COLOR
// and heuristic has to be found :-(
std::string str_PhotometricInterpretation = gdcmHeader::GetPubElValByNumber(0x0028,0x0004);
-// $Header: /cvs/public/gdcm/src/Attic/gdcmHeaderHelper.cxx,v 1.9 2003/10/02 11:26:16 malaterre Exp $
+// $Header: /cvs/public/gdcm/src/Attic/gdcmHeaderHelper.cxx,v 1.10 2003/10/03 14:26:11 jpr Exp $
#include "gdcmHeaderHelper.h"
dbg.Verbose(0, "gdcmHeader::GetPixelSize: Unknown pixel type");
return 0;
}
+
+//----------------------------------------------------------------------------
+/**
+ * \ingroup gdcmHeaderHelper
+ * \brief gets the info from 0028,0004 : Photometric Interp
+ * \ else 1.
+ * @return 1 if Gray level, 3 if Color
+ */
+int gdcmHeaderHelper::GetNumberOfScalarComponents() {
+ std::string PhotometricInterpretation =
+ gdcmHeader::GetPubElValByNumber(0x0028,0x0004);
+
+// The compiler will optimze, if it feels like !
+
+ if (PhotometricInterpretation == GDCM_UNFOUND) return 1;
+ if (PhotometricInterpretation == "MONOCHROME1") return 1;
+ if (PhotometricInterpretation == "MONOCHROME2") return 1;
+
+ return 3;
+}
//----------------------------------------------------------------------------
/**
* \ingroup gdcmHeaderHelper
-// $Header: /cvs/public/gdcm/src/Attic/gdcmHeaderHelper.h,v 1.3 2003/09/11 13:44:17 jpr Exp $
+// $Header: /cvs/public/gdcm/src/Attic/gdcmHeaderHelper.h,v 1.4 2003/10/03 14:26:11 jpr Exp $
#ifndef GDCMHEADERHELPER_H
#define GDCMHEADERHELPER_H
float GetXSpacing();
float GetYSpacing();
float GetZSpacing();
-
+
+ int GetNumberOfScalarComponents();
+
std::string GetStudyUID();
std::string GetSeriesUID();
std::string GetClassUID();
ModalityType GetModality();
void GetImageOrientationPatient( float* iop );
+
};