+
+//----------------------------------------------------------------------------
+/**
+ * \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;
+}