From 49c9d3ad794dad22de84d9e1fed12fde556f7fbf Mon Sep 17 00:00:00 2001 From: jpr Date: Wed, 18 Jan 2006 10:17:40 +0000 Subject: [PATCH] (try to) solve the trouble with leading / in filenames --- src/gdcmDicomDir.cxx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/gdcmDicomDir.cxx b/src/gdcmDicomDir.cxx index e1654bcd..f52529f5 100644 --- a/src/gdcmDicomDir.cxx +++ b/src/gdcmDicomDir.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDicomDir.cxx,v $ Language: C++ - Date: $Date: 2005/12/23 10:25:23 $ - Version: $Revision: 1.183 $ + Date: $Date: 2006/01/18 10:17:40 $ + Version: $Revision: 1.184 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -588,7 +588,7 @@ void DicomDir::CreateDicomDir() // A decent DICOMDIR has much more images than series, // more series than studies, and so on. - // This is the right order to preform the tests + // This is the right order to perform the tests if ( v == "IMAGE " ) { @@ -942,8 +942,11 @@ void DicomDir::SetElement(std::string const &path, DicomDirType type, else { // avoid the first '/' in File name ! - //val = &(header->GetFileName().c_str()[path.length()]); - val = &(header->GetFileName().c_str()[path.length()+1]); + if ( header->GetFileName().c_str()[path.length()] + == GDCM_FILESEPARATOR ) + val = &(header->GetFileName().c_str()[path.length()+1]); + else + val = &(header->GetFileName().c_str()[path.length()]); } break; -- 2.48.1