+ planarConfig = f->GetPlanarConfiguration();
+ std::cout << " PlanarConfiguration= [" << planarConfig
+ << "] "<< std::endl;
+ }
+ std::cout << " PhotometricInterpretation= ["
+ << f->GetEntryString(0x0028,0x0004)
+ << "] "<< std::endl;
+
+ int numberOfScalarComponents=f->GetNumberOfScalarComponents();
+ std::cout << " NumberOfScalarComponents = " << numberOfScalarComponents
+ <<std::endl
+ << " LUT = " << (f->HasLUT() ? "TRUE" : "FALSE")
+ << std::endl;
+
+ if ( f->GetDataEntry(0x0002,0x0010) )
+ if ( f->GetDataEntry(0x0002,0x0010)->IsNotLoaded() )
+ {
+ std::cout << "Transfer Syntax not loaded. " << std::endl
+ << "Better you increase MAX_SIZE_LOAD_ELEMENT_VALUE"
+ << std::endl;
+ f->Delete();
+ return 0;
+ }
+
+ std::string transferSyntaxName = f->GetTransferSyntaxName();
+ std::cout << " TransferSyntaxName= [" << transferSyntaxName << "]"
+ << std::endl;
+ std::cout << " SwapCode= " << f->GetSwapCode() << std::endl;
+ 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'
+ // ---------------------------------------------------------