+ gdcmWarningMacro( "wrong Image Orientation Patient (0020,0035). "
+ << "Less than 6 values were found." );
+ return false;
+ }
+ return true;
+ }
+ return false;
+}
+
+/**
+ * \brief gets the cosine of image X axis, against patient X axis
+ * (Sorry, but Python needs it :-( )
+ * @return cosine of image X axis, against patient X axis
+ */
+float File::GetXCosineOnX()
+{
+ float iop[6];
+ GetImageOrientationPatient( iop );
+ return(iop[0]);
+}
+
+/**
+ * \brief gets the cosine of image X axis, against patient Y axis
+ * (Sorry, but Python needs it :-( )
+ * @return cosine of image X axis, against patient Y axis
+ */
+float File::GetXCosineOnY()
+{
+ float iop[6];
+ GetImageOrientationPatient( iop );
+ return(iop[1]);
+}
+
+/**
+ * \brief gets the cosine of image X axis, against patient Z axis
+ * (Sorry, but Python needs it :-( )
+ * @return cosine of image X axis, against patient Z axis
+ */
+float File::GetXCosineOnZ()
+{
+ float iop[6];
+ GetImageOrientationPatient( iop );
+ return(iop[2]);
+}
+
+/**
+ * \brief gets the cosine of image Y axis, against patient X axis
+ * (Sorry, but Python needs it :-( )
+ * @return cosine of image Y axis, against patient X axis
+ */
+float File::GetYCosineOnX()
+{
+ float iop[6];
+ GetImageOrientationPatient( iop );
+ return(iop[3]);
+}
+
+/**
+ * \brief gets the cosine of image Y axis, against patient Y axis
+ * (Sorry, but Python needs it :-( )
+ * @return cosine of image Y axis, against patient Y axis
+ */
+float File::GetYCosineOnY()
+{
+ float iop[6];
+ GetImageOrientationPatient( iop );
+ return(iop[4]);
+}
+
+/**
+ * \brief gets the cosine of image Y axis, against patient Z axis
+ * (Sorry, but Python needs it :-( )
+ * @return cosine of image Y axis, against patient Z axis
+ */
+float File::GetYCosineOnZ()
+{
+ float iop[6];
+ GetImageOrientationPatient( iop );
+ return(iop[5]);
+}
+/**
+ * \brief gets the info from 0020,0032 : Image Position Patient
+ * or from 0020 0030 : Image Position (RET)
+ *
+ * @param ipp adress of the (3)float array to receive values.
+ * (defaulted as 0.,0.,0. if nothing -or inconsistent stuff-
+ * is found.
+ * @return true when one of the tag -with consistent values- is found
+ * false when nothing or inconsistent stuff - is found
+ */
+bool File::GetImagePositionPatient( float ipp[3] )
+{
+ std::string strImPosiPat;
+ //ipp is supposed to be float[3]
+ ipp[0] = ipp[1] = ipp[2] = 0.;
+
+ // 0020 0032 DS REL Image Position (Patient)
+ strImPosiPat = GetEntryString(0x0020,0x0032);
+ if ( strImPosiPat != GDCM_UNFOUND )
+ {
+ if ( sscanf( strImPosiPat.c_str(), "%f \\ %f \\%f ",
+ &ipp[0], &ipp[1], &ipp[2]) != 3 )
+ {
+ gdcmWarningMacro( "Wrong Image Position Patient (0020,0032)."
+ << " Less than 3 values were found." );
+ return false;
+ }
+ return true;
+ }
+ //For ACR-NEMA
+ // 0020 0030 DS REL Image Position (RET)
+ else if ( (strImPosiPat = GetEntryString(0x0020,0x0030)) != GDCM_UNFOUND )
+ {
+ if ( sscanf( strImPosiPat.c_str(), "%f \\ %f \\%f ",
+ &ipp[0], &ipp[1], &ipp[2]) != 3 )
+ {
+ gdcmWarningMacro( "wrong Image Position Patient (0020,0030). "
+ << "Less than 3 values were found." );
+ return false;