Mercurial > hg > orthanc-python
comparison Resources/Orthanc/Sdk-1.10.0/orthanc/OrthancCPlugin.h @ 176:18f5d8909dd8
patching the Orthanc SDK
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 27 Jun 2024 18:15:46 +0200 |
parents | 8335b42be9fc |
children | 240fac923e8d |
comparison
equal
deleted
inserted
replaced
171:c8de83fe7faa | 176:18f5d8909dd8 |
---|---|
835 * tags are formatted using Data URI scheme. | 835 * tags are formatted using Data URI scheme. |
836 * @ingroup Toolbox | 836 * @ingroup Toolbox |
837 **/ | 837 **/ |
838 typedef enum | 838 typedef enum |
839 { | 839 { |
840 OrthancPluginDicomToJsonFlags_None = 0, | 840 OrthancPluginDicomToJsonFlags_None = 0, /*!< Default formatting */ |
841 OrthancPluginDicomToJsonFlags_IncludeBinary = (1 << 0), /*!< Include the binary tags */ | 841 OrthancPluginDicomToJsonFlags_IncludeBinary = (1 << 0), /*!< Include the binary tags */ |
842 OrthancPluginDicomToJsonFlags_IncludePrivateTags = (1 << 1), /*!< Include the private tags */ | 842 OrthancPluginDicomToJsonFlags_IncludePrivateTags = (1 << 1), /*!< Include the private tags */ |
843 OrthancPluginDicomToJsonFlags_IncludeUnknownTags = (1 << 2), /*!< Include the tags unknown by the dictionary */ | 843 OrthancPluginDicomToJsonFlags_IncludeUnknownTags = (1 << 2), /*!< Include the tags unknown by the dictionary */ |
844 OrthancPluginDicomToJsonFlags_IncludePixelData = (1 << 3), /*!< Include the pixel data */ | 844 OrthancPluginDicomToJsonFlags_IncludePixelData = (1 << 3), /*!< Include the pixel data */ |
845 OrthancPluginDicomToJsonFlags_ConvertBinaryToAscii = (1 << 4), /*!< Output binary tags as-is, dropping non-ASCII */ | 845 OrthancPluginDicomToJsonFlags_ConvertBinaryToAscii = (1 << 4), /*!< Output binary tags as-is, dropping non-ASCII */ |
856 * @ingroup Toolbox | 856 * @ingroup Toolbox |
857 * @see OrthancPluginCreateDicom() | 857 * @see OrthancPluginCreateDicom() |
858 **/ | 858 **/ |
859 typedef enum | 859 typedef enum |
860 { | 860 { |
861 OrthancPluginCreateDicomFlags_None = 0, | 861 OrthancPluginCreateDicomFlags_None = 0, /*!< Default mode */ |
862 OrthancPluginCreateDicomFlags_DecodeDataUriScheme = (1 << 0), /*!< Decode fields encoded using data URI scheme */ | 862 OrthancPluginCreateDicomFlags_DecodeDataUriScheme = (1 << 0), /*!< Decode fields encoded using data URI scheme */ |
863 OrthancPluginCreateDicomFlags_GenerateIdentifiers = (1 << 1), /*!< Automatically generate DICOM identifiers */ | 863 OrthancPluginCreateDicomFlags_GenerateIdentifiers = (1 << 1), /*!< Automatically generate DICOM identifiers */ |
864 | 864 |
865 _OrthancPluginCreateDicomFlags_INTERNAL = 0x7fffffff | 865 _OrthancPluginCreateDicomFlags_INTERNAL = 0x7fffffff |
866 } OrthancPluginCreateDicomFlags; | 866 } OrthancPluginCreateDicomFlags; |
973 * storage commitment. | 973 * storage commitment. |
974 * http://dicom.nema.org/medical/dicom/2019e/output/chtml/part03/sect_C.14.html#sect_C.14.1.1 | 974 * http://dicom.nema.org/medical/dicom/2019e/output/chtml/part03/sect_C.14.html#sect_C.14.1.1 |
975 **/ | 975 **/ |
976 typedef enum | 976 typedef enum |
977 { | 977 { |
978 /** | |
979 * Success: The DICOM instance is properly stored in the SCP | |
980 **/ | |
978 OrthancPluginStorageCommitmentFailureReason_Success = 0, | 981 OrthancPluginStorageCommitmentFailureReason_Success = 0, |
979 /*!< Success: The DICOM instance is properly stored in the SCP */ | 982 |
980 | 983 /** |
984 * 0110H: A general failure in processing the operation was encountered | |
985 **/ | |
981 OrthancPluginStorageCommitmentFailureReason_ProcessingFailure = 1, | 986 OrthancPluginStorageCommitmentFailureReason_ProcessingFailure = 1, |
982 /*!< 0110H: A general failure in processing the operation was encountered */ | 987 |
983 | 988 /** |
989 * 0112H: One or more of the elements in the Referenced SOP | |
990 * Instance Sequence was not available | |
991 **/ | |
984 OrthancPluginStorageCommitmentFailureReason_NoSuchObjectInstance = 2, | 992 OrthancPluginStorageCommitmentFailureReason_NoSuchObjectInstance = 2, |
985 /*!< 0112H: One or more of the elements in the Referenced SOP | 993 |
986 Instance Sequence was not available */ | 994 /** |
987 | 995 * 0213H: The SCP does not currently have enough resources to |
996 * store the requested SOP Instance(s) | |
997 **/ | |
988 OrthancPluginStorageCommitmentFailureReason_ResourceLimitation = 3, | 998 OrthancPluginStorageCommitmentFailureReason_ResourceLimitation = 3, |
989 /*!< 0213H: The SCP does not currently have enough resources to | 999 |
990 store the requested SOP Instance(s) */ | 1000 /** |
991 | 1001 * 0122H: Storage Commitment has been requested for a SOP Instance |
1002 * with a SOP Class that is not supported by the SCP | |
1003 **/ | |
992 OrthancPluginStorageCommitmentFailureReason_ReferencedSOPClassNotSupported = 4, | 1004 OrthancPluginStorageCommitmentFailureReason_ReferencedSOPClassNotSupported = 4, |
993 /*!< 0122H: Storage Commitment has been requested for a SOP | 1005 |
994 Instance with a SOP Class that is not supported by the SCP */ | 1006 /** |
995 | 1007 * 0119H: The SOP Class of an element in the Referenced SOP |
1008 * Instance Sequence did not correspond to the SOP class | |
1009 * registered for this SOP Instance at the SCP | |
1010 **/ | |
996 OrthancPluginStorageCommitmentFailureReason_ClassInstanceConflict = 5, | 1011 OrthancPluginStorageCommitmentFailureReason_ClassInstanceConflict = 5, |
997 /*!< 0119H: The SOP Class of an element in the Referenced SOP | 1012 |
998 Instance Sequence did not correspond to the SOP class registered | 1013 /** |
999 for this SOP Instance at the SCP */ | 1014 * 0131H: The Transaction UID of the Storage Commitment Request is |
1000 | 1015 * already in use |
1016 **/ | |
1001 OrthancPluginStorageCommitmentFailureReason_DuplicateTransactionUID = 6 | 1017 OrthancPluginStorageCommitmentFailureReason_DuplicateTransactionUID = 6 |
1002 /*!< 0131H: The Transaction UID of the Storage Commitment Request | |
1003 is already in use */ | |
1004 } OrthancPluginStorageCommitmentFailureReason; | 1018 } OrthancPluginStorageCommitmentFailureReason; |
1005 | 1019 |
1006 | 1020 |
1007 /** | 1021 /** |
1008 * The action to be taken after ReceivedInstanceCallback is triggered | 1022 * The action to be taken after ReceivedInstanceCallback is triggered |
1827 * @return 1 if and only if the versions are compatible. If the | 1841 * @return 1 if and only if the versions are compatible. If the |
1828 * result is 0, the initialization of the plugin should fail. | 1842 * result is 0, the initialization of the plugin should fail. |
1829 * @see OrthancPluginCheckVersion | 1843 * @see OrthancPluginCheckVersion |
1830 * @ingroup Callbacks | 1844 * @ingroup Callbacks |
1831 **/ | 1845 **/ |
1832 ORTHANC_PLUGIN_INLINE int OrthancPluginCheckVersionAdvanced( | 1846 ORTHANC_PLUGIN_INLINE int32_t OrthancPluginCheckVersionAdvanced( |
1833 OrthancPluginContext* context, | 1847 OrthancPluginContext* context, |
1834 int expectedMajor, | 1848 int32_t expectedMajor, |
1835 int expectedMinor, | 1849 int32_t expectedMinor, |
1836 int expectedRevision) | 1850 int32_t expectedRevision) |
1837 { | 1851 { |
1838 int major, minor, revision; | 1852 int32_t major, minor, revision; |
1839 | 1853 |
1840 if (sizeof(int32_t) != sizeof(OrthancPluginErrorCode) || | 1854 if (sizeof(int) != sizeof(int32_t) || /* Ensure binary compatibility with Orthanc SDK <= 1.12.1 */ |
1855 sizeof(int32_t) != sizeof(OrthancPluginErrorCode) || | |
1841 sizeof(int32_t) != sizeof(OrthancPluginHttpMethod) || | 1856 sizeof(int32_t) != sizeof(OrthancPluginHttpMethod) || |
1842 sizeof(int32_t) != sizeof(_OrthancPluginService) || | 1857 sizeof(int32_t) != sizeof(_OrthancPluginService) || |
1843 sizeof(int32_t) != sizeof(_OrthancPluginProperty) || | 1858 sizeof(int32_t) != sizeof(_OrthancPluginProperty) || |
1844 sizeof(int32_t) != sizeof(OrthancPluginPixelFormat) || | 1859 sizeof(int32_t) != sizeof(OrthancPluginPixelFormat) || |
1845 sizeof(int32_t) != sizeof(OrthancPluginContentType) || | 1860 sizeof(int32_t) != sizeof(OrthancPluginContentType) || |
1933 * @return 1 if and only if the versions are compatible. If the | 1948 * @return 1 if and only if the versions are compatible. If the |
1934 * result is 0, the initialization of the plugin should fail. | 1949 * result is 0, the initialization of the plugin should fail. |
1935 * @see OrthancPluginCheckVersionAdvanced | 1950 * @see OrthancPluginCheckVersionAdvanced |
1936 * @ingroup Callbacks | 1951 * @ingroup Callbacks |
1937 **/ | 1952 **/ |
1938 ORTHANC_PLUGIN_INLINE int OrthancPluginCheckVersion( | 1953 ORTHANC_PLUGIN_INLINE int32_t OrthancPluginCheckVersion( |
1939 OrthancPluginContext* context) | 1954 OrthancPluginContext* context) |
1940 { | 1955 { |
1941 return OrthancPluginCheckVersionAdvanced( | 1956 return OrthancPluginCheckVersionAdvanced( |
1942 context, | 1957 context, |
1943 ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER, | 1958 ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER, |
3075 * @param instance The instance of interest. | 3090 * @param instance The instance of interest. |
3076 * @param metadata The metadata of interest. | 3091 * @param metadata The metadata of interest. |
3077 * @return 1 if the metadata is present, 0 if it is absent, -1 in case of error. | 3092 * @return 1 if the metadata is present, 0 if it is absent, -1 in case of error. |
3078 * @ingroup DicomInstance | 3093 * @ingroup DicomInstance |
3079 **/ | 3094 **/ |
3080 ORTHANC_PLUGIN_INLINE int OrthancPluginHasInstanceMetadata( | 3095 ORTHANC_PLUGIN_INLINE int32_t OrthancPluginHasInstanceMetadata( |
3081 OrthancPluginContext* context, | 3096 OrthancPluginContext* context, |
3082 const OrthancPluginDicomInstance* instance, | 3097 const OrthancPluginDicomInstance* instance, |
3083 const char* metadata) | 3098 const char* metadata) |
3084 { | 3099 { |
3085 int64_t result; | 3100 int64_t result; |
3854 **/ | 3869 **/ |
3855 ORTHANC_PLUGIN_INLINE void OrthancPluginSendHttpStatus( | 3870 ORTHANC_PLUGIN_INLINE void OrthancPluginSendHttpStatus( |
3856 OrthancPluginContext* context, | 3871 OrthancPluginContext* context, |
3857 OrthancPluginRestOutput* output, | 3872 OrthancPluginRestOutput* output, |
3858 uint16_t status, | 3873 uint16_t status, |
3859 const char* body, | 3874 const void* body, |
3860 uint32_t bodySize) | 3875 uint32_t bodySize) |
3861 { | 3876 { |
3862 _OrthancPluginSendHttpStatus params; | 3877 _OrthancPluginSendHttpStatus params; |
3863 params.output = output; | 3878 params.output = output; |
3864 params.status = status; | 3879 params.status = status; |
3865 params.body = body; | 3880 params.body = reinterpret_cast<const char*>(body); |
3866 params.bodySize = bodySize; | 3881 params.bodySize = bodySize; |
3867 context->InvokeService(context, _OrthancPluginService_SendHttpStatus, ¶ms); | 3882 context->InvokeService(context, _OrthancPluginService_SendHttpStatus, ¶ms); |
3868 } | 3883 } |
3869 | 3884 |
3870 | 3885 |
6758 | 6773 |
6759 typedef struct | 6774 typedef struct |
6760 { | 6775 { |
6761 char** resultId; | 6776 char** resultId; |
6762 OrthancPluginJob *job; | 6777 OrthancPluginJob *job; |
6763 int priority; | 6778 int32_t priority; |
6764 } _OrthancPluginSubmitJob; | 6779 } _OrthancPluginSubmitJob; |
6765 | 6780 |
6766 /** | 6781 /** |
6767 * @brief Submit a new job to the jobs engine of Orthanc. | 6782 * @brief Submit a new job to the jobs engine of Orthanc. |
6768 * | 6783 * |
6777 * @ingroup Toolbox | 6792 * @ingroup Toolbox |
6778 **/ | 6793 **/ |
6779 ORTHANC_PLUGIN_INLINE char *OrthancPluginSubmitJob( | 6794 ORTHANC_PLUGIN_INLINE char *OrthancPluginSubmitJob( |
6780 OrthancPluginContext *context, | 6795 OrthancPluginContext *context, |
6781 OrthancPluginJob *job, | 6796 OrthancPluginJob *job, |
6782 int priority) | 6797 int32_t priority) |
6783 { | 6798 { |
6784 char* resultId = NULL; | 6799 char* resultId = NULL; |
6785 | 6800 |
6786 _OrthancPluginSubmitJob params; | 6801 _OrthancPluginSubmitJob params; |
6787 memset(¶ms, 0, sizeof(params)); | 6802 memset(¶ms, 0, sizeof(params)); |