Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitkCustomTagParser.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 mitkCustomTagParser_h
14 #define mitkCustomTagParser_h
15 
16 #include<mitkPropertyList.h>
18 
19 #include <MitkCESTExports.h>
20 
21 namespace mitk
22 {
75  {
76  public:
84  CustomTagParser(std::string relevantFile);
85 
96  mitk::PropertyList::Pointer ParseDicomProperty(mitk::TemporoSpatialStringProperty *dicomProperty);
97 
112  mitk::PropertyList::Pointer ParseDicomPropertyString(std::string dicomPropertyString);
113 
124  static std::string ReadListFromFile(const std::string& filePath);
125 
138  static std::string ExtractRevision(std::string sequenceFileName);
139 
148  void SetParseStrategy(std::string parseStrategy);
149 
157  void SetRevisionMappingStrategy(std::string revisionMappingStrategy);
158 
160  static const std::string m_RevisionPropertyName;
161 
163  static const std::string m_JSONRevisionPropertyName;
164 
166  static const std::string m_CESTPropertyPrefix;
167 
168  protected:
169  std::string GetRevisionAppropriateJSONString(std::string revisionString);
170  void GetClosestLowerRevision(std::string revisionString);
171  std::string GetClosestLowerRevision(std::string revisionString, std::vector<int> availableRevisionsVector);
172 
174  bool IsT1Sequence(std::string preparationType, std::string recoveryMode, std::string spoilingType, std::string revisionString);
175 
177  std::string GetOffsetString(std::string samplingType, std::string offset, std::string measurements);
178 
180  std::vector<int> GetExternalRevisions();
182  std::vector<int> GetInternalRevisions();
183 
186 
191 
193  static const std::string m_RevisionIndependentMapping;
195  static const std::string m_DefaultJsonString;
197  std::string m_DicomDataPath;
199  std::string m_ParseStrategy;
202  };
203 
204 }
205 
206 #endif
#define MITKCEST_EXPORT
Parser for the Siemens private DICOM tag (0x0029, 0x1020) to extract CEST sequence parameters.
static std::string ExtractRevision(std::string sequenceFileName)
Extract the revision number from a CEST sequence file name.
static std::string ReadListFromFile(const std::string &filePath)
Read a space-separated list of values from a text file.
std::string m_ClosestInternalRevision
the closest lower revision provided as resource, empty if none found
std::string GetRevisionAppropriateJSONString(std::string revisionString)
static const std::string m_RevisionIndependentMapping
revision independent mapping to inject into the revision dependent json string
CustomTagParser(std::string relevantFile)
Construct a CustomTagParser for DICOM files at the given path.
std::string GetClosestLowerRevision(std::string revisionString, std::vector< int > availableRevisionsVector)
std::string GetExternalJSONDirectory()
returns the path where external jsons are expected to be located
std::vector< int > GetInternalRevisions()
returns a vector revision numbers of all REVISIONNUMBER.json provided as resources during the compile
static const std::string m_RevisionPropertyName
Name of the property for the data acquisition revision ("CEST.Revision").
static const std::string m_JSONRevisionPropertyName
Name of the property for the JSON parameter mapping revision ("CEST.revision_json").
static const std::string m_CESTPropertyPrefix
Prefix for all CEST-related property names ("CEST.").
mitk::PropertyList::Pointer ParseDicomPropertyString(std::string dicomPropertyString)
Parse a hex-encoded DICOM tag string and return extracted CEST parameters.
bool IsT1Sequence(std::string preparationType, std::string recoveryMode, std::string spoilingType, std::string revisionString)
Decides whether or not the image is likely to be a T1Map, if not it is assumed to be a CEST sequence.
std::string m_ParseStrategy
Should the kind of data be automatically determined or should it be parsed as a specific one.
void GetClosestLowerRevision(std::string revisionString)
static const std::string m_DefaultJsonString
default revision dependent json string if none is found
std::vector< int > GetExternalRevisions()
returns a vector revision numbers of all REVISIONNUMBER.json found beside the MitkCEST library
mitk::PropertyList::Pointer ParseDicomProperty(mitk::TemporoSpatialStringProperty *dicomProperty)
Parse a DICOM TemporoSpatialStringProperty and return extracted CEST parameters.
std::string m_ClosestExternalRevision
the closest lower revision provided as a json beside the library, empty if none found
std::string m_RevisionMappingStrategy
How to handle parameter mapping based on absent revision jsons.
void SetRevisionMappingStrategy(std::string revisionMappingStrategy)
Set the strategy for matching revision numbers to JSON parameter mappings.
void SetParseStrategy(std::string parseStrategy)
Set the strategy used to determine the type of CEST data.
std::string GetOffsetString(std::string samplingType, std::string offset, std::string measurements)
Get a string filled with the properly formatted offsets based on the sampling type and offset.
std::string m_DicomDataPath
path to the dicom data
Property for storing string values resolved by time step and slice index.
Find image slices visible on a given plane.