Medical Imaging Interaction Toolkit  2024.06.99-60d9b802
Medical Imaging Interaction Toolkit
mitk::CustomTagParser Class Reference

#include <mitkCustomTagParser.h>

Collaboration diagram for mitk::CustomTagParser:

Public Member Functions

 CustomTagParser (std::string relevantFile)
 the constructor expects a path to one of the files to be loaded or the directory of the dicom files More...
 
mitk::PropertyList::Pointer ParseDicomProperty (mitk::TemporoSpatialStringProperty *dicomProperty)
 parse the provided dicom property and return a property list based on the closest revision parameter mapping More...
 
mitk::PropertyList::Pointer ParseDicomPropertyString (std::string dicomPropertyString)
 parse the provided string and return a property list based on the closest revision parameter mapping More...
 
void SetParseStrategy (std::string parseStrategy)
 
void SetRevisionMappingStrategy (std::string revisionMappingStrategy)
 

Static Public Member Functions

static std::string ReadListFromFile (const std::string &filePath)
 
static std::string ExtractRevision (std::string sequenceFileName)
 

Static Public Attributes

static const std::string m_RevisionPropertyName
 name of the property for the data acquisition revision More...
 
static const std::string m_JSONRevisionPropertyName
 name of the property for the json parameter mapping revision More...
 
static const std::string m_CESTPropertyPrefix
 prefix for all CEST related property names More...
 

Protected Member Functions

std::string GetRevisionAppropriateJSONString (std::string revisionString)
 
void GetClosestLowerRevision (std::string revisionString)
 
std::string GetClosestLowerRevision (std::string revisionString, std::vector< int > availableRevisionsVector)
 
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. More...
 
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. More...
 
std::vector< int > GetExternalRevisions ()
 returns a vector revision numbers of all REVISIONNUMBER.json found beside the MitkCEST library More...
 
std::vector< int > GetInternalRevisions ()
 returns a vector revision numbers of all REVISIONNUMBER.json provided as resources during the compile More...
 
std::string GetExternalJSONDirectory ()
 returns the path where external jsons are expected to be located More...
 

Protected Attributes

std::string m_ClosestInternalRevision
 the closest lower revision provided as resource, empty if none found More...
 
std::string m_ClosestExternalRevision
 the closest lower revision provided as a json beside the library, empty if none found More...
 
std::string m_DicomDataPath
 path to the dicom data More...
 
std::string m_ParseStrategy
 Should the kind of data be automatically determined or should it be parsed as a specific one. More...
 
std::string m_RevisionMappingStrategy
 How to handle parameter mapping based on absent revision jsons. More...
 

Static Protected Attributes

static const std::string m_RevisionIndependentMapping
 revision independent mapping to inject into the revision dependent json string More...
 
static const std::string m_DefaultJsonString
 default revision dependent json string if none is found More...
 

Detailed Description

The custom tag parser can be used to parse the custom dicom tag of the siemens private tag (0x0029, 0x1020) to extract relevant CEST data.

An initial parsing determines whether the provided string belongs to CEST data at all. To make the check and extract the revision number the following rules are applied:

  1. Sequence name (tSequenceFileName) must either
    1. start with the substring "CEST" (case insensitiv), or
    2. contain the substring "_CEST" (case insensitiv).
  2. Sequence name (tSequenceFileName) must contain the substring "_Rev" (case insensitiv).
  3. All numbers after "_Rev" represent the revision number; until either
    1. the next _, or
    2. end of sequence name.

Which custom parameters to save and to which property name can be controlled by a json file. This file can be either provided as a resource for the MitkCEST module during compilation or placed next to the MitkCEST library in your binary folder.

The expected format for the file "REVISIONNUMBER.json":
{
"REVISIONNUMBER" : "revision_json",
"sWiPMemBlock.alFree[1]" : "AdvancedMode",
"sWiPMemBlock.alFree[2]" : "RetreatMode"
}

where :

  • REVISIONNUMBER is the revision number of this json parameter mapping (files with non digit characters in their name will be ignored)
  • sWiPMemBlock.alFree[1] is the name of one parameter in the private dicom tag
  • AdvancedMode is the name of the property the content of sWiPMemBlock.alFree[1] should be saved to
Note
It is assumed that the entire content of tag (0x0029, 0x1020) is provided and that it es hex encoded (12\23\04...).

If the sampling type is list it will try to access LIST.txt at the location provided in the constructor to read the offsets.

Definition at line 70 of file mitkCustomTagParser.h.

Constructor & Destructor Documentation

◆ CustomTagParser()

mitk::CustomTagParser::CustomTagParser ( std::string  relevantFile)

the constructor expects a path to one of the files to be loaded or the directory of the dicom files

Member Function Documentation

◆ ExtractRevision()

static std::string mitk::CustomTagParser::ExtractRevision ( std::string  sequenceFileName)
static

Extract the revision out of the passed sequenceFileName. If the file name is not a valid CEST file name (see rules in the class documentation) exceptions will be thrown. If the file name is valid but contains no revision number an empty string will be returned.

◆ GetClosestLowerRevision() [1/2]

void mitk::CustomTagParser::GetClosestLowerRevision ( std::string  revisionString)
protected

◆ GetClosestLowerRevision() [2/2]

std::string mitk::CustomTagParser::GetClosestLowerRevision ( std::string  revisionString,
std::vector< int >  availableRevisionsVector 
)
protected

◆ GetExternalJSONDirectory()

std::string mitk::CustomTagParser::GetExternalJSONDirectory ( )
protected

returns the path where external jsons are expected to be located

◆ GetExternalRevisions()

std::vector<int> mitk::CustomTagParser::GetExternalRevisions ( )
protected

returns a vector revision numbers of all REVISIONNUMBER.json found beside the MitkCEST library

◆ GetInternalRevisions()

std::vector<int> mitk::CustomTagParser::GetInternalRevisions ( )
protected

returns a vector revision numbers of all REVISIONNUMBER.json provided as resources during the compile

◆ GetOffsetString()

std::string mitk::CustomTagParser::GetOffsetString ( std::string  samplingType,
std::string  offset,
std::string  measurements 
)
protected

Get a string filled with the properly formatted offsets based on the sampling type and offset.

◆ GetRevisionAppropriateJSONString()

std::string mitk::CustomTagParser::GetRevisionAppropriateJSONString ( std::string  revisionString)
protected

◆ IsT1Sequence()

bool mitk::CustomTagParser::IsT1Sequence ( std::string  preparationType,
std::string  recoveryMode,
std::string  spoilingType,
std::string  revisionString 
)
protected

Decides whether or not the image is likely to be a T1Map, if not it is assumed to be a CEST sequence.

◆ ParseDicomProperty()

mitk::PropertyList::Pointer mitk::CustomTagParser::ParseDicomProperty ( mitk::TemporoSpatialStringProperty dicomProperty)

parse the provided dicom property and return a property list based on the closest revision parameter mapping

◆ ParseDicomPropertyString()

mitk::PropertyList::Pointer mitk::CustomTagParser::ParseDicomPropertyString ( std::string  dicomPropertyString)

parse the provided string and return a property list based on the closest revision parameter mapping

◆ ReadListFromFile()

static std::string mitk::CustomTagParser::ReadListFromFile ( const std::string &  filePath)
static

◆ SetParseStrategy()

void mitk::CustomTagParser::SetParseStrategy ( std::string  parseStrategy)

◆ SetRevisionMappingStrategy()

void mitk::CustomTagParser::SetRevisionMappingStrategy ( std::string  revisionMappingStrategy)

Member Data Documentation

◆ m_CESTPropertyPrefix

const std::string mitk::CustomTagParser::m_CESTPropertyPrefix
static

prefix for all CEST related property names

Definition at line 99 of file mitkCustomTagParser.h.

◆ m_ClosestExternalRevision

std::string mitk::CustomTagParser::m_ClosestExternalRevision
protected

the closest lower revision provided as a json beside the library, empty if none found

Definition at line 123 of file mitkCustomTagParser.h.

◆ m_ClosestInternalRevision

std::string mitk::CustomTagParser::m_ClosestInternalRevision
protected

the closest lower revision provided as resource, empty if none found

Definition at line 121 of file mitkCustomTagParser.h.

◆ m_DefaultJsonString

const std::string mitk::CustomTagParser::m_DefaultJsonString
staticprotected

default revision dependent json string if none is found

Definition at line 128 of file mitkCustomTagParser.h.

◆ m_DicomDataPath

std::string mitk::CustomTagParser::m_DicomDataPath
protected

path to the dicom data

Definition at line 130 of file mitkCustomTagParser.h.

◆ m_JSONRevisionPropertyName

const std::string mitk::CustomTagParser::m_JSONRevisionPropertyName
static

name of the property for the json parameter mapping revision

Definition at line 96 of file mitkCustomTagParser.h.

◆ m_ParseStrategy

std::string mitk::CustomTagParser::m_ParseStrategy
protected

Should the kind of data be automatically determined or should it be parsed as a specific one.

Definition at line 132 of file mitkCustomTagParser.h.

◆ m_RevisionIndependentMapping

const std::string mitk::CustomTagParser::m_RevisionIndependentMapping
staticprotected

revision independent mapping to inject into the revision dependent json string

Definition at line 126 of file mitkCustomTagParser.h.

◆ m_RevisionMappingStrategy

std::string mitk::CustomTagParser::m_RevisionMappingStrategy
protected

How to handle parameter mapping based on absent revision jsons.

Definition at line 134 of file mitkCustomTagParser.h.

◆ m_RevisionPropertyName

const std::string mitk::CustomTagParser::m_RevisionPropertyName
static

name of the property for the data acquisition revision

Definition at line 93 of file mitkCustomTagParser.h.


The documentation for this class was generated from the following file: