From 70a062c32888b0676b89ce03915262ab0648e919 Mon Sep 17 00:00:00 2001 From: jpr Date: Tue, 18 Jan 2005 11:56:52 +0000 Subject: [PATCH] In SerieHeader::ImagePositionPatientOrdering() // 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 ! Thx to Eduardo Davila for reporting bug. --- src/gdcmSerieHeader.cxx | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/gdcmSerieHeader.cxx b/src/gdcmSerieHeader.cxx index 05f2ecef..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/18 08:01:42 $ - Version: $Revision: 1.10 $ + 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 @@ -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 -- 2.45.1