Medical Imaging Interaction Toolkit  2025.12.02
Medical Imaging Interaction Toolkit
mitkDICOMTagScanner.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef mitkDICOMTagScanner_h
14 #define mitkDICOMTagScanner_h
15 
16 #include <stack>
17 #include <mutex>
18 
19 #include "mitkDICOMEnums.h"
20 #include "mitkDICOMTagPath.h"
21 #include "mitkDICOMTagCache.h"
23 
24 namespace mitk
25 {
26 
42  class MITKDICOM_EXPORT DICOMTagScanner : public itk::Object
43  {
44  public:
46 
50  virtual void AddTag(const DICOMTag& tag) = 0;
54  virtual void AddTags(const DICOMTagList& tags) = 0;
58  virtual void AddTagPath(const DICOMTagPath& path) = 0;
62  virtual void AddTagPaths(const DICOMTagPathList& paths) = 0;
63 
69  virtual void SetInputFiles(const StringList& filenames) = 0;
70 
77  virtual void Scan() = 0;
78 
83 
87  virtual DICOMTagCache::Pointer GetScanCache() const = 0;
88 
89  protected:
90 
92  static std::string GetActiveLocale();
97  void PushLocale() const;
102  void PopLocale() const;
103 
105  ~DICOMTagScanner() override;
106 
107  private:
108 
109  static std::mutex s_LocaleMutex;
110 
111  mutable std::stack<std::string> m_ReplacedCLocales;
112  mutable std::stack<std::locale> m_ReplacedCinLocales;
113 
115  };
116 }
117 
118 #endif
#define MITKDICOM_EXPORT
Class is used to identify (nested) attributes in a DICOM dataset. In contrast to the class DICOMTag,...
Abstracts the tag scanning process for a set of DICOM files.
void PopLocale() const
Activate last remembered locale from locale stack "C" locale is required for correct parsing of numbe...
~DICOMTagScanner() override
virtual void AddTags(const DICOMTagList &tags)=0
Add a list of tags to the scanning process.
mitkClassMacroItkParent(DICOMTagScanner, itk::Object)
virtual DICOMTagCache::Pointer GetScanCache() const =0
Retrieve Pointer to the complete cache of the scan.
static std::string GetActiveLocale()
Return active C locale.
virtual void SetInputFiles(const StringList &filenames)=0
Define the list of files to scan. This does not ADD to an internal list, but it replaces the whole li...
void PushLocale() const
Remember current locale on stack, activate "C" locale. "C" locale is required for correct parsing of ...
virtual void AddTagPath(const DICOMTagPath &path)=0
Add this tag path to the scanning process.
virtual void AddTag(const DICOMTag &tag)=0
Add this tag to the scanning process.
virtual void AddTagPaths(const DICOMTagPathList &paths)=0
Add a list of tag paths to the scanning process.
virtual DICOMDatasetAccessingImageFrameList GetFrameInfoList() const =0
Retrieve a result list for file-by-file tag access.
virtual void Scan()=0
Start the scanning process. Calling Scan() will invalidate previous scans, forgetting all about files...
Representation of a DICOM tag.
Definition: mitkDICOMTag.h:33
Find image slices visible on a given plane.
std::vector< std::string > StringList
std::vector< DICOMDatasetAccessingImageFrameInfo::Pointer > DICOMDatasetAccessingImageFrameList
std::vector< DICOMTag > DICOMTagList
Definition: mitkDICOMTag.h:59
std::vector< DICOMTagPath > DICOMTagPathList