+ // Lets's get and print some usefull fields about 'Orientation'
+ // ------------------------------------------------------------
+
+ std::string strPatientPosition =
+ f->GetEntryValue(0x0018,0x5100);
+ if ( strPatientPosition != gdcm::GDCM_UNFOUND
+ && strPatientPosition != "" )
+ std::cout << "PatientPosition (0x0010,0x5100)= ["
+ << strPatientPosition << "]" << std::endl;
+
+ std::string strPatientOrientation =
+ f->GetEntryValue(0x0020,0x0020);
+ if ( strPatientOrientation != gdcm::GDCM_UNFOUND
+ && strPatientOrientation != "")
+ std::cout << "PatientOrientation (0x0020,0x0020)= ["
+ << strPatientOrientation << "]" << std::endl;
+
+ std::string strImageOrientationPatient =
+ f->GetEntryValue(0x0020,0x0037);
+ if ( strImageOrientationPatient != gdcm::GDCM_UNFOUND
+ && strImageOrientationPatient != "" )
+ std::cout << "ImageOrientationPatient (0x0020,0x0037)= ["
+ << strImageOrientationPatient << "]" << std::endl;
+
+ std::string strImageOrientationRET =
+ f->GetEntryValue(0x0020,0x0035);
+ if ( strImageOrientationRET != gdcm::GDCM_UNFOUND
+ && strImageOrientationRET != "" )
+ std::cout << "ImageOrientationRET (0x0020,0x0035)= ["
+ << strImageOrientationRET << "]" << std::endl;
+
+ // Let's compute 'user friendly' results about 'Orientation'
+ // ---------------------------------------------------------
+
+ gdcm::Orientation o;
+
+ if ( strImageOrientationPatient != gdcm::GDCM_UNFOUND ||
+ strImageOrientationRET != gdcm::GDCM_UNFOUND )
+ {
+
+ gdcm::OrientationType orient = o.GetOrientationType( f );
+
+ std::cout << "TypeOrientation = " << orient << " (-> "
+ << o.GetOrientationTypeString(orient) << " )" << std::endl;
+ }
+
+ std::string ori = o.GetOrientation ( f );
+ if (ori != "\\" )
+ std::cout << "Orientation [" << ori << "]" << std::endl;
+
+