+//------------------------------
+if (!noex)
+{
+ // Lets's get and print some usefull fields about 'Orientation'
+ // ------------------------------------------------------------
+
+ std::string strPatientPosition =
+ f->GetEntryString(0x0018,0x5100);
+ if ( strPatientPosition != GDCM_NAME_SPACE::GDCM_UNFOUND
+ && strPatientPosition != "" )
+ std::cout << "PatientPosition (0x0010,0x5100)= ["
+ << strPatientPosition << "]" << std::endl;
+
+ std::string strViewPosition =
+ f->GetEntryString(0x0018,0x5101);
+ if ( strViewPosition != GDCM_NAME_SPACE::GDCM_UNFOUND
+ && strViewPosition != "" )
+ std::cout << "strViewPosition (0x0010,0x5101)= ["
+ << strViewPosition << "]" << std::endl;
+
+ std::string strPatientOrientation =
+ f->GetEntryString(0x0020,0x0020);
+ if ( strPatientOrientation != GDCM_NAME_SPACE::GDCM_UNFOUND
+ && strPatientOrientation != "")
+ std::cout << "PatientOrientation (0x0020,0x0020)= ["
+ << strPatientOrientation << "]" << std::endl;
+
+ std::string strImageOrientationPatient =
+ f->GetEntryString(0x0020,0x0037);
+ if ( strImageOrientationPatient != GDCM_NAME_SPACE::GDCM_UNFOUND
+ && strImageOrientationPatient != "" )
+ std::cout << "ImageOrientationPatient (0x0020,0x0037)= ["
+ << strImageOrientationPatient << "]" << std::endl;
+
+ std::string strImageOrientationRET =
+ f->GetEntryString(0x0020,0x0035);
+ if ( strImageOrientationRET != GDCM_NAME_SPACE::GDCM_UNFOUND
+ && strImageOrientationRET != "" )
+ {
+ std::cout << "ImageOrientationRET (0x0020,0x0035)= ["
+ << strImageOrientationRET << "]" << std::endl;
+ }
+
+ // Let's compute 'user friendly' results about 'Orientation'
+ // ---------------------------------------------------------
+
+ GDCM_NAME_SPACE::Orientation *o = GDCM_NAME_SPACE::Orientation::New();
+
+
+ if ( strImageOrientationPatient != GDCM_NAME_SPACE::GDCM_UNFOUND ||
+ strImageOrientationRET != GDCM_NAME_SPACE::GDCM_UNFOUND )
+ {
+
+ GDCM_NAME_SPACE::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;
+ o->Delete();
+}
+//-------------------------------
+