X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmSerieHeader.cxx;h=3349af5882b6840d76ee2e4bdea726267a56dfda;hb=e6ff7dc295436e9463650ea13ab965ce35ae126c;hp=64fffb411915cf5e8629d08751ff71e5783187a1;hpb=ad24565658c6ecaee9d09473ec60280c912815e9;p=gdcm.git diff --git a/src/gdcmSerieHeader.cxx b/src/gdcmSerieHeader.cxx index 64fffb41..3349af58 100644 --- a/src/gdcmSerieHeader.cxx +++ b/src/gdcmSerieHeader.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmSerieHeader.cxx,v $ Language: C++ - Date: $Date: 2005/01/14 21:34:53 $ - Version: $Revision: 1.8 $ + Date: $Date: 2005/01/18 11:56:52 $ + Version: $Revision: 1.11 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -97,9 +97,10 @@ void SerieHeader::AddFileName(std::string const &filename) void SerieHeader::SetDirectory(std::string const &dir) { CurrentSerieUID = ""; //Reset previous Serie Instance UID - DirList filenames_list(dir); //OS specific + DirList dirList(dir); //OS specific - for( DirList::const_iterator it = filenames_list.begin(); + DirListType filenames_list = dirList.GetFilenames(); + for( DirListType::const_iterator it = filenames_list.begin(); it != filenames_list.end(); ++it) { AddFileName( *it ); @@ -134,7 +135,6 @@ void SerieHeader::OrderGdcmFileList() //----------------------------------------------------------------------------- // Private /** - * \ingroup Header * \brief sorts the images, according to their Patient Position * We may order, considering : * -# Image Number @@ -236,8 +236,15 @@ bool SerieHeader::ImagePositionPatientOrdering() //2*n sort algo !! //Assumption: all files are present (no one missing) pos = (int)( fabs( (distlist[n]-min)/step) + .5 ); - - CoherentGdcmFileVector[pos] = *it2; + + // a Dicom 'Serie' may contain scout views + // and images may have differents directions + // -> More than one may have the same 'pos' + // Sorting has then NO meaning ! + if (CoherentGdcmFileVector[pos]==NULL) + CoherentGdcmFileVector[pos] = *it2; + else + return false; } CoherentGdcmFileList.clear(); //this doesn't delete list's element, node only @@ -256,7 +263,6 @@ bool SerieHeader::ImagePositionPatientOrdering() } /** - * \ingroup Header * \brief sorts the images, according to their Image Number * @return false only if the header is bugged ! */ @@ -319,7 +325,6 @@ bool SerieHeader::ImageNumberOrdering() /** - * \ingroup Header * \brief sorts the images, according to their File Name * @return false only if the header is bugged ! */