]> Creatis software - gdcm.git/commitdiff
Orienation : iop is float.
authorjpr <jpr>
Mon, 28 Nov 2005 11:54:45 +0000 (11:54 +0000)
committerjpr <jpr>
Mon, 28 Nov 2005 11:54:45 +0000 (11:54 +0000)
(again)

Example/PrintFile.cxx
Testing/TestFileAccessors.cxx
gdcmPython/gdcm.i
src/gdcmFile.cxx
src/gdcmFile.h
src/gdcmOrientation.cxx
src/gdcmOrientation.h
src/gdcmSerieHelper.cxx

index 77a4920fdb770bf1e4850d8afecb0a03d8a42dd4..8e42f004dfa91d426524ca02ee106f65ef54e751 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: PrintFile.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/11/28 10:55:00 $
-  Version:   $Revision: 1.74 $
+  Date:      $Date: 2005/11/28 11:54:45 $
+  Version:   $Revision: 1.75 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -227,6 +227,12 @@ int main(int argc, char *argv[])
          f->AddForceLoadElement((uint32_t)elemsToForceLoad[2*ri], 
                                 (uint32_t)elemsToForceLoad[2*ri+1] ); 
       }
+// TODO : find why such a polution
+// To avoid polluting the output with messages 
+// 'Last system error was : No such file or directory'
+
+errno = 0; 
+
 
       bool res = f->Load();
       // gdcm::File::IsReadable() is no usable here, because we deal with
index c48a69cf4e9185fb64b8cf9f56cc9a2103dd4776..6e321a2585c15fd1d09440482a18afbbc4fd325f 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: TestFileAccessors.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/11/25 15:56:31 $
-  Version:   $Revision: 1.6 $
+  Date:      $Date: 2005/11/28 11:54:46 $
+  Version:   $Revision: 1.7 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -54,7 +54,7 @@ int TestFileAccessors(int, char *[])
 {
    int i = 0;
 
-   double iop[6];
+   float iop[6];
 
    while( gdcmDataImages[i] != 0 )
    {
index a1d6ea19ad4d633b7f23e1a76d7058b459ee0c8e..26ec3cc1de6be00c0ac260965aec8441e8ab0a38 100644 (file)
@@ -86,13 +86,13 @@ using namespace gdcm;
 
 ////////////////////////////////////////////////
 // Redefine all types used
-typedef char int8_t;
-typedef unsigned char uint8_t;
-typedef short int16_t;
-typedef unsigned short uint16_t;
-typedef int int32_t;
-typedef unsigned int uint32_t;
-typedef long long int64_t;
+typedef char               int8_t;
+typedef unsigned char      uint8_t;
+typedef short              int16_t;
+typedef unsigned short     uint16_t;
+typedef int                int32_t;
+typedef unsigned int       uint32_t;
+typedef long long          int64_t;
 typedef unsigned long long uint64_t;
 
 ////////////////////////////////////////////////
index 2c6928956289de5d23e0a8efa80a097382e54734..5eeaab46cc3f99d11719e19b6c1f9aa6aa1806b2 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmFile.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/11/25 13:56:31 $
-  Version:   $Revision: 1.309 $
+  Date:      $Date: 2005/11/28 11:54:51 $
+  Version:   $Revision: 1.310 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -773,10 +773,10 @@ float File::GetZOrigin()
   * @return true when one of the tag is found
   *         false when nothing is found
   */
-bool File::GetImageOrientationPatient( double iop[6] )
+bool File::GetImageOrientationPatient( float iop[6] )
 {
    std::string strImOriPat;
-   //iop is supposed to be double[6]
+   //iop is supposed to be float[6]
    iop[0] = iop[4] = 1.;
    iop[1] = iop[2] = iop[3] = iop[5] = 0.;
 
index 84dca96545a74841b4063253a2e755880d12be7b..af09e7978a2eba87a9a053eed020e35b508c2dd0 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmFile.h,v $
   Language:  C++
-  Date:      $Date: 2005/11/25 13:56:31 $
-  Version:   $Revision: 1.121 $
+  Date:      $Date: 2005/11/28 11:54:51 $
+  Version:   $Revision: 1.122 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -125,7 +125,7 @@ public:
    float GetYOrigin();
    float GetZOrigin();
 
-   bool GetImageOrientationPatient( double iop[6] );
+   bool GetImageOrientationPatient( float iop[6] );
 
    int GetBitsStored();
    int GetBitsAllocated();
index 47fed19256c29d7dd09c21a4fd3f8f8583335ebe..7e54d554e5518e01359c97dd5333b6183d12659a 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmOrientation.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/11/25 13:56:32 $
-  Version:   $Revision: 1.20 $
+  Date:      $Date: 2005/11/28 11:54:51 $
+  Version:   $Revision: 1.21 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -84,7 +84,7 @@ const char* Orientation::GetOrientationTypeString(OrientationType const o)
 ///        (Axial, Coronal, Sagital, ...) of the image
 OrientationType Orientation::GetOrientationType( File *f )
 {
-   double iop[6];
+   float iop[6];
    bool succ = f->GetImageOrientationPatient( iop );
    if ( !succ )
    {
@@ -292,7 +292,7 @@ have multiple letters in as described under "refinements" in C.7.6.1.1.1):
  */
 std::string Orientation::GetOrientation ( File *f )
 {
-   double iop[6];
+   float iop[6];
    if ( !f->GetImageOrientationPatient( iop ) )
    return GDCM_UNFOUND;
 
@@ -304,7 +304,7 @@ std::string Orientation::GetOrientation ( File *f )
 }
 
 
-std::string Orientation::GetSingleOrientation ( double *iop)
+std::string Orientation::GetSingleOrientation ( float *iop)
 {
    std::string orientation;
 
index e1522fd389760b3717c5695dbe973718614fbb07..8e1c6d1992a632eb90750e95942ec0701252ee3f 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmOrientation.h,v $
   Language:  C++
-  Date:      $Date: 2005/11/25 13:56:32 $
-  Version:   $Revision: 1.14 $
+  Date:      $Date: 2005/11/28 11:54:51 $
+  Version:   $Revision: 1.15 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -117,7 +117,7 @@ private:
    double CalculLikelyhood2Vec(vector3D const &refA, vector3D const &refB, 
                                vector3D const &ori1, vector3D const &ori2);
    vector3D ProductVectorial(vector3D const &vec1, vector3D const &vec2);
-   std::string GetSingleOrientation ( double *iop);
+   std::string GetSingleOrientation ( float *iop);
 };
 } // end namespace gdcm
 //-----------------------------------------------------------------------------
index 5adbd99b1ffb1c8bea84c73f573438d71cc06f62..72fc5f625c0d30ad853ef73d58edb721c1bcb31b 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmSerieHelper.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/11/25 13:56:32 $
-  Version:   $Revision: 1.36 $
+  Date:      $Date: 2005/11/28 11:54:51 $
+  Version:   $Revision: 1.37 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -391,7 +391,7 @@ XCoherentFileSetmap SerieHelper::SplitOnOrientation(FileList *fileSet)
    int nb = fileSet->size();
    if (nb == 0 )
       return CoherentFileSet;
-   double iop[6];
+   float iop[6];
 
    std::string strOrient;
    std::ostringstream ossOrient;   
@@ -568,14 +568,14 @@ bool SerieHelper::ImagePositionPatientOrdering( FileList *fileList )
 //based on Jolinda Smith's algorithm
 {
    //iop is calculated based on the file file
-   double cosines[6];
-   double normal[3];
-   double ipp[3];
-   double dist;
-   double min = 0, max = 0;
+   float cosines[6];
+   float normal[3];
+   float ipp[3];
+   float dist;
+   float min = 0, max = 0;
    bool first = true;
 
-   std::multimap<double,File *> distmultimap;
+   std::multimap<float,File *> distmultimap;
    // Use a multimap to sort the distances from 0,0,0
    for ( FileList::const_iterator 
          it = fileList->begin();
@@ -603,7 +603,7 @@ bool SerieHelper::ImagePositionPatientOrdering( FileList *fileList )
             dist += normal[i]*ipp[i];
          }
     
-         distmultimap.insert(std::pair<const double,File *>(dist, *it));
+         distmultimap.insert(std::pair<const float,File *>(dist, *it));
 
          max = min = dist;
          first = false;
@@ -620,7 +620,7 @@ bool SerieHelper::ImagePositionPatientOrdering( FileList *fileList )
             dist += normal[i]*ipp[i];
          }
 
-         distmultimap.insert(std::pair<const double,File *>(dist, *it));
+         distmultimap.insert(std::pair<const float,File *>(dist, *it));
 
          min = (min < dist) ? min : dist;
          max = (max > dist) ? max : dist;
@@ -638,7 +638,7 @@ bool SerieHelper::ImagePositionPatientOrdering( FileList *fileList )
 
    // Check to see if image shares a common position
     bool ok = true;
-    for (std::multimap<double, File *>::iterator it2 = distmultimap.begin();
+    for (std::multimap<float, File *>::iterator it2 = distmultimap.begin();
                                                  it2 != distmultimap.end();
                                                  ++it2)
     {
@@ -661,7 +661,7 @@ bool SerieHelper::ImagePositionPatientOrdering( FileList *fileList )
 
    if (DirectOrder)
    {  
-      for (std::multimap<double, File *>::iterator it3 = distmultimap.begin();
+      for (std::multimap<float, File *>::iterator it3 = distmultimap.begin();
                                                    it3 != distmultimap.end();
                                                  ++it3)
       {
@@ -670,7 +670,7 @@ bool SerieHelper::ImagePositionPatientOrdering( FileList *fileList )
    }
    else // user asked for reverse order
    {
-      std::multimap<double, File *>::const_iterator it4;
+      std::multimap<float, File *>::const_iterator it4;
       it4 = distmultimap.end();
       do
       {