Mercurial > hg > orthanc
diff Plugins/Include/orthanc/OrthancCPlugin.h @ 1861:a7bea843a7bc
"OrthancPluginLookupDictionary()" to get information about some DICOM tag
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 02 Dec 2015 13:00:18 +0100 |
parents | c7d70f659190 |
children | 5cf2bd0abfa2 |
line wrap: on
line diff
--- a/Plugins/Include/orthanc/OrthancCPlugin.h Wed Dec 02 11:26:52 2015 +0100 +++ b/Plugins/Include/orthanc/OrthancCPlugin.h Wed Dec 02 13:00:18 2015 +0100 @@ -400,6 +400,7 @@ _OrthancPluginService_CreateDicom = 23, _OrthancPluginService_ComputeMd5 = 24, _OrthancPluginService_ComputeSha1 = 25, + _OrthancPluginService_LookupDictionary = 26, /* Registration of callbacks */ _OrthancPluginService_RegisterRestCallback = 1000, @@ -962,6 +963,20 @@ } OrthancPluginContext; + + /** + * @brief An entry in the dictionary of DICOM tags. + **/ + typedef struct + { + uint16_t group; /*!< The group of the tag */ + uint16_t element; /*!< The element of the tag */ + OrthancPluginValueRepresentation vr; /*!< The value representation of the tag */ + uint32_t minMultiplicity; /*!< The minimum multiplicity of the tag */ + uint32_t maxMultiplicity; /*!< The maximum multiplicity of the tag (0 means arbitrary) */ + } OrthancPluginDictionaryEntry; + + /** * @brief Free a string. @@ -4627,6 +4642,41 @@ } } + + + typedef struct + { + OrthancPluginDictionaryEntry* target; + const char* name; + } _OrthancPluginLookupDictionary; + + /** + * @brief Get information about the given DICOM tag. + * + * This functions makes a lookup in the dictionary of DICOM tags + * that are known to Orthanc, and returns information about this + * tag. The tag can be specified using its human-readable name + * (e.g. "PatientName") or a set of two hexadecimal numbers + * (e.g. "0010-0020"). + * + * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). + * @param target Where to store the information about the tag. + * @param name The name of the DICOM tag. + * @return 0 if success, other value if error. + * @ingroup Toolbox + **/ + ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginLookupDictionary( + OrthancPluginContext* context, + OrthancPluginDictionaryEntry* target, + const char* name) + { + _OrthancPluginLookupDictionary params; + params.target = target; + params.name = name; + return context->InvokeService(context, _OrthancPluginService_LookupDictionary, ¶ms); + } + + #ifdef __cplusplus } #endif