From f80897f63dcbc709e372abe4a248ddbff9f2b33c Mon Sep 17 00:00:00 2001 From: jpr Date: Mon, 28 Nov 2005 11:54:45 +0000 Subject: [PATCH] Orienation : iop is float. (again) --- Example/PrintFile.cxx | 10 ++++++++-- Testing/TestFileAccessors.cxx | 6 +++--- gdcmPython/gdcm.i | 14 +++++++------- src/gdcmFile.cxx | 8 ++++---- src/gdcmFile.h | 6 +++--- src/gdcmOrientation.cxx | 10 +++++----- src/gdcmOrientation.h | 6 +++--- src/gdcmSerieHelper.cxx | 28 ++++++++++++++-------------- 8 files changed, 47 insertions(+), 41 deletions(-) diff --git a/Example/PrintFile.cxx b/Example/PrintFile.cxx index 77a4920f..8e42f004 100644 --- a/Example/PrintFile.cxx +++ b/Example/PrintFile.cxx @@ -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 diff --git a/Testing/TestFileAccessors.cxx b/Testing/TestFileAccessors.cxx index c48a69cf..6e321a25 100644 --- a/Testing/TestFileAccessors.cxx +++ b/Testing/TestFileAccessors.cxx @@ -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 ) { diff --git a/gdcmPython/gdcm.i b/gdcmPython/gdcm.i index a1d6ea19..26ec3cc1 100644 --- a/gdcmPython/gdcm.i +++ b/gdcmPython/gdcm.i @@ -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; //////////////////////////////////////////////// diff --git a/src/gdcmFile.cxx b/src/gdcmFile.cxx index 2c692895..5eeaab46 100644 --- a/src/gdcmFile.cxx +++ b/src/gdcmFile.cxx @@ -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.; diff --git a/src/gdcmFile.h b/src/gdcmFile.h index 84dca965..af09e797 100644 --- a/src/gdcmFile.h +++ b/src/gdcmFile.h @@ -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(); diff --git a/src/gdcmOrientation.cxx b/src/gdcmOrientation.cxx index 47fed192..7e54d554 100644 --- a/src/gdcmOrientation.cxx +++ b/src/gdcmOrientation.cxx @@ -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; diff --git a/src/gdcmOrientation.h b/src/gdcmOrientation.h index e1522fd3..8e1c6d19 100644 --- a/src/gdcmOrientation.h +++ b/src/gdcmOrientation.h @@ -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 //----------------------------------------------------------------------------- diff --git a/src/gdcmSerieHelper.cxx b/src/gdcmSerieHelper.cxx index 5adbd99b..72fc5f62 100644 --- a/src/gdcmSerieHelper.cxx +++ b/src/gdcmSerieHelper.cxx @@ -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 distmultimap; + std::multimap 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(dist, *it)); + distmultimap.insert(std::pair(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(dist, *it)); + distmultimap.insert(std::pair(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::iterator it2 = distmultimap.begin(); + for (std::multimap::iterator it2 = distmultimap.begin(); it2 != distmultimap.end(); ++it2) { @@ -661,7 +661,7 @@ bool SerieHelper::ImagePositionPatientOrdering( FileList *fileList ) if (DirectOrder) { - for (std::multimap::iterator it3 = distmultimap.begin(); + for (std::multimap::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::const_iterator it4; + std::multimap::const_iterator it4; it4 = distmultimap.end(); do { -- 2.45.1