+
+//----------------------------------------------------------------------------
+/**
+ * \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 !
+
+ //beware of trailing space at end of string
+ if (PhotometricInterpretation.find(GDCM_UNFOUND) < PhotometricInterpretation.length() ||
+ PhotometricInterpretation.find("MONOCHROME1") < PhotometricInterpretation.length() ||
+ PhotometricInterpretation.find("MONOCHROME2") < PhotometricInterpretation.length() ) return 1;
+
+ return 3;
+}