Parcourir la source

Avoid getting incorrect header values

Clear the map so old header values won't still be around
when loading new files that don't have the value defined
Steve Pieper il y a 13 ans
Parent
commit
db6837978e
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      Libs/DICOM/Core/ctkDICOMDatabase.cpp

+ 1 - 1
Libs/DICOM/Core/ctkDICOMDatabase.cpp

@@ -388,7 +388,6 @@ void ctkDICOMDatabase::loadInstanceHeader (QString sopInstanceUID)
   query.prepare ( "SELECT Filename FROM Images WHERE SOPInstanceUID=?");
   query.bindValue ( 0, sopInstanceUID );
   query.exec();
-  d->LoadedHeader.clear();
   if (query.next())
     {
     QString fileName = query.value(0).toString();
@@ -401,6 +400,7 @@ void ctkDICOMDatabase::loadInstanceHeader (QString sopInstanceUID)
 void ctkDICOMDatabase::loadFileHeader (QString fileName)
 {
   Q_D(ctkDICOMDatabase);
+  d->LoadedHeader.clear();
   DcmFileFormat fileFormat;
   OFCondition status = fileFormat.loadFile(fileName.toLatin1().data());
   if (status.good())