MeVisLabToolboxReference
MeVis/Foundation/Sources/MLDicomTreeImagePropertyExtension/mlDicomTreeAccess.h File Reference

Grants access to the DCMTree inside the MLDicomImagePropertyExtension. More...

Go to the source code of this file.

Namespaces

namespace  ml
 

Define the namespace name like in the ML. Default is ml.


Defines

#define ML_DICOM_TREE_IMAGE_PROPERTY_EXTENSION_CLASS_NAME   ml::DicomTreeImagePropertyExtension::getClassTypeId()->getName()
 Macro which resolves the class name of DicomTreeImagePropertyExtension.
#define ML_GET_DICOM_TREE_CONST(constTreePtr, medicalImageProperties)
 Macro which assigns the dicom tree contained in medicalImageProperties (or PagedImg) to constTreePtr.
#define ML_GET_DICOM_TREE_FROM_FIELD_CONST(constTreePtr, mlField)
 Macro which assigns the dicom tree contained in the image of the mlfield to constTreePtr.
#define ML_GET_DICOM_TAG_BY_NAME_CONST(constTagPtr, constTreePtr, name)
 Macro which tries to assign the dicom tag with the given name in constTreePtr to constTagPtr.

Functions

MLDICOM_TREE_IMAGE_PROPERTY_EXTENSION_EXPORT
DCMTree::Const_TreePtr 
ml::getDicomTreeFromImagePropertyExtension (const ImagePropertyExtension *dicomTreeImagePropertyExtensionPtr)
 Casts the ImagePropertyExtension pointer into a DicomTreeImagePropertyExtension pointer and returns the contained dicom tree pointer.
MLDICOM_TREE_IMAGE_PROPERTY_EXTENSION_EXPORT
DCMTree::Const_TagPtr 
ml::getDicomTagByName (const ImagePropertyExtension *imagePropertyExtensionPtr, const std::string &tagName)
 Returns the tag with the given name from the property extension. If it is not found, the pointer will be NULL.
MLDICOM_TREE_IMAGE_PROPERTY_EXTENSION_EXPORT
bool 
ml::getTagIdByATString (const std::string &atString, DCMTree::TagId &tagId)
 Gets the tag id for (group,element) string (AT format).
MLDICOM_TREE_IMAGE_PROPERTY_EXTENSION_EXPORT
bool 
ml::MLIsATString (const std::string &supposedATString)
 Checks if the given string is a well-formed AT string.

Detailed Description

Grants access to the DCMTree inside the MLDicomImagePropertyExtension.

Author:
Marcus Barann
Date:
11/2006

Definition in file mlDicomTreeAccess.h.


Define Documentation

#define ML_DICOM_TREE_IMAGE_PROPERTY_EXTENSION_CLASS_NAME   ml::DicomTreeImagePropertyExtension::getClassTypeId()->getName()

Macro which resolves the class name of DicomTreeImagePropertyExtension.

Definition at line 44 of file mlDicomTreeAccess.h.

#define ML_GET_DICOM_TAG_BY_NAME_CONST (   constTagPtr,
  constTreePtr,
  name 
)
Value:
if (constTreePtr) {                                                   \
    try {                                                               \
      constTagPtr = treePtr->getTag(tagName);                           \
    } catch (DCMTree::Exception&) { }                                   \
  } else if (constTagPtr) {                                             \
    constTagPtr = DCMTree::Const_TagPtr();                              \
  }

Macro which tries to assign the dicom tag with the given name in constTreePtr to constTagPtr.

If constTreePtr is NULL or the tag could not be found then constTagPtr is set to NULL.

Definition at line 82 of file mlDicomTreeAccess.h.

#define ML_GET_DICOM_TREE_CONST (   constTreePtr,
  medicalImageProperties 
)
Value:
const RuntimeType*                     runtimeType   = DicomTreeImagePropertyExtension::getClassTypeId();   \
  const ImagePropertyExtensionContainer& propContainer = medicalImageProperties->getConstImagePropertyContainer(); \
  const DicomTreeImagePropertyExtension* propExtension = static_cast<const DicomTreeImagePropertyExtension*>(  \
                                                             propContainer.getFirstEntryOfType(runtimeType)); \
  constTreePtr = getDicomTreeFromImagePropertyExtension(propExtension);

Macro which assigns the dicom tree contained in medicalImageProperties (or PagedImg) to constTreePtr.

Definition at line 50 of file mlDicomTreeAccess.h.

#define ML_GET_DICOM_TREE_FROM_FIELD_CONST (   constTreePtr,
  mlField 
)
Value:
{                                             \
                                                                                                                \
  const ml::ImagePropertyExtension* extension = NULL;                                                           \
                                                                                                                \
  MLErrorCode errorCode = MLImageGetFirstImagePropertyExtensionByType(mlField,                                  \
                                                   ML_DICOM_TREE_IMAGE_PROPERTY_EXTENSION_CLASS_NAME,           \
                                                   reinterpret_cast<void**>(                                    \
                                                       const_cast<ml::ImagePropertyExtension**>(&extension)));  \
  if (errorCode){                                                                                               \
    std::cerr << "Failed to get dicom image property extension ("                                               \
              << MLGetErrorCodeDescription(errorCode) << ")" << std::endl;                                      \
  } else if(extension != NULL) {                                                                                \
    constTreePtr = ml::getDicomTreeFromImagePropertyExtension(extension);                                       \
  }                                                                                                             \
}

Macro which assigns the dicom tree contained in the image of the mlfield to constTreePtr.

Access to mlAPI.h is necessary for this macro to work!

Definition at line 61 of file mlDicomTreeAccess.h.