]> Creatis software - gdcm.git/blobdiff - src/gdcmFile.cxx
Comments
[gdcm.git] / src / gdcmFile.cxx
index 0eb156243c0c753fcadb7844cba04e4d2c1c46bf..858dec827fc82bb2f15deedf5c097d97a6c88f95 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmFile.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/09/05 08:20:08 $
-  Version:   $Revision: 1.266 $
+  Date:      $Date: 2005/09/21 16:53:59 $
+  Version:   $Revision: 1.270 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
 // SUPINE
 
 // CS 2 Patient Orientation (0020 0020)
-//               When the coordinates of the image 
-//               are always present, this field is almost never used.
-//               Better we don't trust it too much ...
-//               Found Values are :      L\P
-//                                       L\FP
-//                                       P\F
-//                                       L\F
-//                                       P\FR
-//                                       R\F
+//    When the coordinates of the image 
+//    are always present, this field is almost never used.
+//    Better we don't trust it too much ...
+//    Found Values are :
+//     L\P
+//     L\FP
+//     P\F
+//     L\F
+//     P\FR
+//     R\F
 //
 // (0020|0037) [Image Orientation (Patient)] [1\0\0\0\1\0 ]
 
-                                      
+               
 // ---------------------------------------------------------------
 //
 #include "gdcmFile.h"
@@ -753,9 +754,11 @@ float File::GetZOrigin()
 
 /**
   * \brief gets the info from 0020,0037 : Image Orientation Patient
+  *                   or from 0020 0035 : Image Orientation (RET)
   * (needed to organize DICOM files based on their x,y,z position)
   * @param iop adress of the (6)float array to receive values
-  * @return cosines of image orientation patient
+  * @return true when one of the tag is found
+  *         false when nothong is found
   */
 bool File::GetImageOrientationPatient( float iop[6] )
 {
@@ -769,7 +772,8 @@ bool File::GetImageOrientationPatient( float iop[6] )
       if ( sscanf( strImOriPat.c_str(), "%f \\ %f \\%f \\%f \\%f \\%f ", 
           &iop[0], &iop[1], &iop[2], &iop[3], &iop[4], &iop[5]) != 6 )
       {
-         gdcmWarningMacro( "Wrong Image Orientation Patient (0020,0037). Less than 6 values were found." );
+         gdcmWarningMacro( "Wrong Image Orientation Patient (0020,0037)."
+                        << " Less than 6 values were found." );
          return false;
       }
    }
@@ -780,13 +784,16 @@ bool File::GetImageOrientationPatient( float iop[6] )
       if ( sscanf( strImOriPat.c_str(), "%f \\ %f \\%f \\%f \\%f \\%f ", 
           &iop[0], &iop[1], &iop[2], &iop[3], &iop[4], &iop[5]) != 6 )
       {
-         gdcmWarningMacro( "wrong Image Orientation Patient (0020,0035). Less than 6 values were found." );
+         gdcmWarningMacro( "wrong Image Orientation Patient (0020,0035). "
+                        << "Less than 6 values were found." );
          return false;
       }
    }
    return true;
 }
 
+
+
 /**
  * \brief   Retrieve the number of Bits Stored (actually used)
  *          (as opposed to number of Bits Allocated)
@@ -1494,7 +1501,7 @@ bool File::Write(std::string fileName, FileType writetype)
    if ( e0000 )
    {
       std::ostringstream sLen;
-      sLen << ComputeGroup0002Length(writetype);
+      sLen << ComputeGroup0002Length( );
       e0000->SetValue(sLen.str());
    }
 
@@ -1684,7 +1691,7 @@ bool File::ReadTag(uint16_t testGroup, uint16_t testElem)
       itemTagGroup = ReadInt16();
       itemTagElem  = ReadInt16();
    }
-   catch ( FormatError e )
+   catch ( FormatError /*e*/ )
    {
       //std::cerr << e << std::endl;
       return false;