13#ifndef ML_DICOM_TREE_ACCESS_H
14#define ML_DICOM_TREE_ACCESS_H
31 const std::string& tagName);
47#define ML_DICOM_TREE_IMAGE_PROPERTY_EXTENSION_CLASS_NAME \
48 ml::DicomTreeImagePropertyExtension::getClassTypeId()->getName()
53#define ML_GET_DICOM_TREE_CONST(constTreePtr, medicalImageProperties) \
54 const RuntimeType* runtimeType = DicomTreeImagePropertyExtension::getClassTypeId(); \
55 const ImagePropertyExtensionContainer& propContainer = medicalImageProperties->getConstImagePropertyContainer(); \
56 const DicomTreeImagePropertyExtension* propExtension = static_cast<const DicomTreeImagePropertyExtension*>( \
57 propContainer.getFirstEntryOfType(runtimeType)); \
58 constTreePtr = getDicomTreeFromImagePropertyExtension(propExtension);
64#define ML_GET_DICOM_TREE_FROM_FIELD_CONST(constTreePtr, mlField) { \
66 const ml::ImagePropertyExtension* extension = NULL; \
68 MLErrorCode errorCode = MLImageGetFirstImagePropertyExtensionByType(mlField, \
69 ML_DICOM_TREE_IMAGE_PROPERTY_EXTENSION_CLASS_NAME, \
70 reinterpret_cast<void**>( \
71 const_cast<ml::ImagePropertyExtension**>(&extension))); \
73 std::cerr << "Failed to get dicom image property extension (" \
74 << MLGetErrorCodeDescription(errorCode) << ")" << std::endl; \
75 } else if(extension != NULL) { \
76 constTreePtr = ml::getDicomTreeFromImagePropertyExtension(extension); \
85#define ML_GET_DICOM_TAG_BY_NAME_CONST(constTagPtr, constTreePtr, name) \
88 constTagPtr = treePtr->getTag(tagName); \
89 } catch (DCMTree::Exception&) { } \
90 } else if (constTagPtr) { \
91 constTagPtr = DCMTree::Const_TagPtr(); \
#define MLDICOM_TREE_IMAGE_PROPERTY_EXTENSION_EXPORT
Global and OS specific declarations for the MLDicomTreeImagePropertyExtension project.
Base class from which one can derive own image properties.
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
boost::shared_ptr< const Tag > Const_TagPtr
boost::shared_ptr< const Tree > Const_TreePtr
MLDICOM_TREE_IMAGE_PROPERTY_EXTENSION_EXPORT bool MLIsATString(const std::string &supposedATString)
Checks if the given string is a well-formed AT string.
MLDICOM_TREE_IMAGE_PROPERTY_EXTENSION_EXPORT bool getTagIdByATString(const std::string &atString, DCMTree::TagId &tagId)
Gets the tag id for (group,element) string (AT format).
MLDICOM_TREE_IMAGE_PROPERTY_EXTENSION_EXPORT DCMTree::Const_TagPtr getDicomTagByName(const ImagePropertyExtension *imagePropertyExtensionPtr, const std::string &tagName)
Returns the tag with the given name from the property extension. If it is not found,...
MLDICOM_TREE_IMAGE_PROPERTY_EXTENSION_EXPORT DCMTree::Const_TreePtr getDicomTreeFromImagePropertyExtension(const ImagePropertyExtension *dicomTreeImagePropertyExtensionPtr)
Casts the ImagePropertyExtension pointer into a DicomTreeImagePropertyExtension pointer and returns t...