+ std::cout << " ------" << std::endl;
+
+ std::cout << "\n\n" << std::endl;
+ std::cout << "X spacing " << f->GetXSpacing() << std::endl;
+ std::cout << "Y spacing " << f->GetYSpacing() << std::endl;
+ std::cout << "Z spacing " << f->GetZSpacing() << std::endl;
+
+//------------------------------
+
+ // Let'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 << "View Position (0x0018,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;
+
+ std::string strImagePositionPatient =
+ f->GetEntryString(0x0020,0x0032);
+ if ( strImagePositionPatient != GDCM_NAME_SPACE::GDCM_UNFOUND
+ && strImagePositionPatient != "" )
+ std::cout << "ImagePositionPatient (0x0020,0x0032)= ["
+ << strImagePositionPatient << "]" << std::endl;
+
+ std::string strImagePositionPatientRET =
+ f->GetEntryString(0x0020,0x0030);
+ if ( strImagePositionPatientRET != GDCM_NAME_SPACE::GDCM_UNFOUND
+ && strImagePositionPatientRET != "" )
+ std::cout << "ImagePositionPatientRET (0x0020,0x0030)= ["
+ << strImagePositionPatientRET << "]" << std::endl;
+
+ float iop[6];
+ /*bool riop = */f->GetImageOrientationPatient(iop);
+ float ipp[3];
+ /*bool ripp = */f->GetImagePositionPatient(ipp);
+
+ std::cout << "Image Position (0x0020,0x0032|0x0030) : "
+ << ipp[0] << " , " << ipp[1] << " , "<< ipp[2]
+ << std::endl;
+ std::cout << "Image Orientation (0x0020,0x0037|0x0035) : "
+ << iop[0] << " , " << iop[1] << " , "<< iop[2] << " , "
+ << iop[3] << " , " << iop[4] << " , "<< iop[5]
+ << 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();
+/*
+std::vector <double> valueVector;
+GDCM_NAME_SPACE::DataEntry *e_0018_5212 = f->GetDataEntry(0x0018, 0x5212);
+bool resJP = e_0018_5212->GetDSValue(valueVector);
+if (resJP) {
+ double test;
+ for ( int i=0; i < 3; i++ ) {
+ test = valueVector[i];
+ std::cout << " test " << test << std::endl;
+ }
+}
+//e_0018_5212->Delete();
+*/
+
+}
+//------------------------------