소스 검색

Enable tag caching in the fileElement and instanceElement calls

Previously cache was being used if available, but was not
being auto-populated.
Steve Pieper 12 년 전
부모
커밋
10f62c2103
1개의 변경된 파일5개의 추가작업 그리고 2개의 파일을 삭제
  1. 5 2
      Libs/DICOM/Core/ctkDICOMDatabase.cpp

+ 5 - 2
Libs/DICOM/Core/ctkDICOMDatabase.cpp

@@ -522,7 +522,8 @@ QString ctkDICOMDatabase::instanceValue(const QString sopInstanceUID, const unsi
   QString filePath = this->fileForInstance(sopInstanceUID);
   if (filePath != "" )
     {
-    return( this->fileValue(filePath, group, element) );
+    value = this->fileValue(filePath, group, element);
+    return( value );
     }
   else
     {
@@ -574,7 +575,9 @@ QString ctkDICOMDatabase::fileValue(const QString fileName, const unsigned short
 
   DcmTagKey tagKey(group, element);
 
-  return( dataset.GetAllElementValuesAsString(tagKey) );
+  value = dataset.GetAllElementValuesAsString(tagKey);
+  this->cacheTag(sopInstanceUID, tag, value);
+  return( value );
 }
 
 //------------------------------------------------------------------------------