Browse 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 13 years ago
parent
commit
db6837978e
1 changed files with 1 additions and 1 deletions
  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())