Medical Imaging Interaction Toolkit
2018.4.99-389bf124
Medical Imaging Interaction Toolkit
|
#include <mitkCustomTagParser.h>
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 | ExtractRevision (std::string sequenceFileName) |
Static Public Attributes | |
static const std::string | m_OffsetsPropertyName |
name of the property for the offsets, including normalization offsets More... | |
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 formated 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... | |
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 aplied:
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 :
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.
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
Definition at line 118 of file mitkCustomTagParser.cpp.
References m_DicomDataPath, m_ParseStrategy, and m_RevisionMappingStrategy.
|
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.
Definition at line 128 of file mitkCustomTagParser.cpp.
References mitkThrow.
Referenced by ParseDicomPropertyString().
|
protected |
Definition at line 575 of file mitkCustomTagParser.cpp.
References GetExternalJSONDirectory(), GetExternalRevisions(), GetInternalRevisions(), m_ClosestExternalRevision, m_ClosestInternalRevision, m_RevisionMappingStrategy, and mitkThrow.
Referenced by GetRevisionAppropriateJSONString().
|
protected |
Definition at line 540 of file mitkCustomTagParser.cpp.
|
protected |
returns the path where external jsons are expected to be located
Definition at line 831 of file mitkCustomTagParser.cpp.
References ModuleContext::GetModule(), and us::GetModuleContext().
Referenced by GetClosestLowerRevision(), GetExternalRevisions(), and GetRevisionAppropriateJSONString().
|
protected |
returns a vector revision numbers of all REVISIONNUMBER.json found beside the MitkCEST library
Definition at line 510 of file mitkCustomTagParser.cpp.
References GetExternalJSONDirectory().
Referenced by GetClosestLowerRevision().
|
protected |
returns a vector revision numbers of all REVISIONNUMBER.json provided as resources during the compile
Definition at line 495 of file mitkCustomTagParser.cpp.
References ModuleContext::GetModule(), and us::GetModuleContext().
Referenced by GetClosestLowerRevision().
|
protected |
Get a string filled with the properly formated offsets based on the sampling type and offset.
Definition at line 693 of file mitkCustomTagParser.cpp.
References m_DicomDataPath, MITK_ERROR, and MITK_WARN.
Referenced by ParseDicomPropertyString().
|
protected |
Definition at line 608 of file mitkCustomTagParser.cpp.
References GetClosestLowerRevision(), GetExternalJSONDirectory(), ModuleContext::GetModule(), us::GetModuleContext(), us::ModuleResource::IsFile(), us::ModuleResource::IsValid(), m_ClosestExternalRevision, m_ClosestInternalRevision, m_DefaultJsonString, m_RevisionIndependentMapping, MITK_INFO, and MITK_WARN.
Referenced by ParseDicomPropertyString().
|
protected |
Decides whether or not the image is likely to be a T1Map, if not it is assumed to be a CEST sequence.
Definition at line 175 of file mitkCustomTagParser.cpp.
References m_ParseStrategy.
Referenced by ParseDicomPropertyString().
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
Definition at line 478 of file mitkCustomTagParser.cpp.
References mitk::TemporoSpatialStringProperty::GetValue(), MITK_ERROR, mitk::PropertyList::New(), and 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
Definition at line 246 of file mitkCustomTagParser.cpp.
References mitk::IPropertyPersistence::AddInfo(), mitk::CEST_PROPERTY_NAME_PREPERATIONTYPE(), mitk::CEST_PROPERTY_NAME_RECOVERYMODE(), mitk::CEST_PROPERTY_NAME_SPOILINGTYPE(), mitk::CEST_PROPERTY_NAME_TREC(), ExtractRevision(), GetOffsetString(), GetPersistenceService(), GetRevisionAppropriateJSONString(), info(), IsT1Sequence(), m_CESTPropertyPrefix, m_DicomDataPath, m_JSONRevisionPropertyName, m_OffsetsPropertyName, m_RevisionPropertyName, MITK_ERROR, MITK_INFO, MITK_WARN, mitkThrow, mitk::PropertyPersistenceInfo::New(), mitk::StringProperty::New(), mitk::PropertyList::New(), offset, and mbilog::replace.
Referenced by mitk::MitkCESTIOMimeTypes::MitkCESTDicomMimeType::AppliesTo(), ParseDicomProperty(), and mitk::CESTDICOMReaderService::Read().
void mitk::CustomTagParser::SetParseStrategy | ( | std::string | parseStrategy | ) |
Definition at line 821 of file mitkCustomTagParser.cpp.
References m_ParseStrategy.
Referenced by mitk::CESTDICOMReaderService::Read().
void mitk::CustomTagParser::SetRevisionMappingStrategy | ( | std::string | revisionMappingStrategy | ) |
Definition at line 826 of file mitkCustomTagParser.cpp.
References m_RevisionMappingStrategy.
Referenced by mitk::CESTDICOMReaderService::Read().
|
static |
prefix for all CEST related property names
Definition at line 100 of file mitkCustomTagParser.h.
Referenced by ParseDicomPropertyString().
|
protected |
the closest lower revision provided as a json beside the library, empty if none found
Definition at line 124 of file mitkCustomTagParser.h.
Referenced by GetClosestLowerRevision(), and GetRevisionAppropriateJSONString().
|
protected |
the closest lower revision provided as resource, empty if none found
Definition at line 122 of file mitkCustomTagParser.h.
Referenced by GetClosestLowerRevision(), and GetRevisionAppropriateJSONString().
|
staticprotected |
default revision dependent json string if none is found
Definition at line 129 of file mitkCustomTagParser.h.
Referenced by GetRevisionAppropriateJSONString().
|
protected |
path to the dicom data
Definition at line 131 of file mitkCustomTagParser.h.
Referenced by CustomTagParser(), GetOffsetString(), and ParseDicomPropertyString().
|
static |
name of the property for the json parameter mapping revision
Definition at line 97 of file mitkCustomTagParser.h.
Referenced by ParseDicomPropertyString().
|
static |
name of the property for the offsets, including normalization offsets
Definition at line 91 of file mitkCustomTagParser.h.
Referenced by ExtractOffsets(), mitk::CESTImageNormalizationFilter::GenerateData(), and ParseDicomPropertyString().
|
protected |
Should the kind of data be automatically determined or should it be parsed as a specific one.
Definition at line 133 of file mitkCustomTagParser.h.
Referenced by CustomTagParser(), IsT1Sequence(), and SetParseStrategy().
|
staticprotected |
revision independent mapping to inject into the revision dependent json string
Definition at line 127 of file mitkCustomTagParser.h.
Referenced by GetRevisionAppropriateJSONString().
|
protected |
How to handle parameter mapping based on absent revision jsons.
Definition at line 135 of file mitkCustomTagParser.h.
Referenced by CustomTagParser(), GetClosestLowerRevision(), and SetRevisionMappingStrategy().
|
static |
name of the property for the data acquisition revision
Definition at line 94 of file mitkCustomTagParser.h.
Referenced by ParseDicomPropertyString().