annotate Plugins/Samples/Basic/Plugin.c @ 910:28a52982196e plugins

refactoring
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 20 Jun 2014 13:38:19 +0200
parents 2732b5f57d9c
children dcb2469f00f4
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
886
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Orthanc - A Lightweight, RESTful DICOM Store
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege,
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 * Belgium
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5 *
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 * Permission is hereby granted, free of charge, to any person
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 * obtaining a copy of this software and associated documentation
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 * files (the "Software"), to deal in the Software without
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 * restriction, including without limitation the rights to use, copy,
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 * modify, merge, publish, distribute, sublicense, and/or sell copies
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 * of the Software, and to permit persons to whom the Software is
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 * furnished to do so, subject to the following conditions:
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 *
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * The above copyright notice and this permission notice shall be
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 * included in all copies or substantial portions of the Software.
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 *
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 * SOFTWARE.
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25 **/
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27
896
c4053ac5db04 better plugni api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 894
diff changeset
28 #include <OrthancCPlugin.h>
886
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 #include <string.h>
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 #include <stdio.h>
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32
898
7000fc86fe62 improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 897
diff changeset
33 static OrthancPluginContext* context = NULL;
886
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35
901
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
36 ORTHANC_PLUGINS_API int32_t Callback1(OrthancPluginRestOutput* output,
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
37 const char* url,
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
38 const OrthancPluginHttpRequest* request)
894
690aeb4cb899 REST callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 888
diff changeset
39 {
690aeb4cb899 REST callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 888
diff changeset
40 char buffer[1024];
897
bafc9d592632 REST callbacks are working
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 896
diff changeset
41 uint32_t i;
bafc9d592632 REST callbacks are working
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 896
diff changeset
42
899
bb0a51561016 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 898
diff changeset
43 sprintf(buffer, "Callback on URL [%s] with body [%s]", url, request->body);
898
7000fc86fe62 improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 897
diff changeset
44 OrthancPluginLogInfo(context, buffer);
897
bafc9d592632 REST callbacks are working
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 896
diff changeset
45
899
bb0a51561016 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 898
diff changeset
46 OrthancPluginAnswerBuffer(context, output, buffer, strlen(buffer), "text/plain");
897
bafc9d592632 REST callbacks are working
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 896
diff changeset
47
899
bb0a51561016 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 898
diff changeset
48 for (i = 0; i < request->getCount; i++)
897
bafc9d592632 REST callbacks are working
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 896
diff changeset
49 {
899
bb0a51561016 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 898
diff changeset
50 sprintf(buffer, " [%s] = [%s]", request->getKeys[i], request->getValues[i]);
898
7000fc86fe62 improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 897
diff changeset
51 OrthancPluginLogInfo(context, buffer);
897
bafc9d592632 REST callbacks are working
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 896
diff changeset
52 }
bafc9d592632 REST callbacks are working
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 896
diff changeset
53
904
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 903
diff changeset
54 printf("** %d\n", request->groupsCount);
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 903
diff changeset
55 for (i = 0; i < request->groupsCount; i++)
901
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
56 {
904
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 903
diff changeset
57 printf("** [%s]\n", request->groups[i]);
901
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
58 }
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
59
894
690aeb4cb899 REST callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 888
diff changeset
60 return 1;
690aeb4cb899 REST callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 888
diff changeset
61 }
690aeb4cb899 REST callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 888
diff changeset
62
690aeb4cb899 REST callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 888
diff changeset
63
901
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
64 ORTHANC_PLUGINS_API int32_t Callback2(OrthancPluginRestOutput* output,
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
65 const char* url,
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
66 const OrthancPluginHttpRequest* request)
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
67 {
904
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 903
diff changeset
68 /* Answer with a sample 16bpp image. */
901
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
69
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
70 uint16_t buffer[256 * 256];
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
71 uint32_t x, y, value;
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
72
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
73 value = 0;
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
74 for (y = 0; y < 256; y++)
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
75 {
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
76 for (x = 0; x < 256; x++, value++)
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
77 {
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
78 buffer[value] = value;
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
79 }
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
80 }
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
81
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
82 OrthancPluginCompressAndAnswerPngImage(context, output, OrthancPluginPixelFormat_Grayscale16,
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
83 256, 256, sizeof(uint16_t) * 256, buffer);
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
84 return 0;
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
85 }
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
86
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
87
904
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 903
diff changeset
88 ORTHANC_PLUGINS_API int32_t Callback3(OrthancPluginRestOutput* output,
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 903
diff changeset
89 const char* url,
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 903
diff changeset
90 const OrthancPluginHttpRequest* request)
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 903
diff changeset
91 {
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 903
diff changeset
92 OrthancPluginMemoryBuffer dicom;
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 903
diff changeset
93 if (!OrthancPluginGetDicomForInstance(context, &dicom, request->groups[0]))
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 903
diff changeset
94 {
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 903
diff changeset
95 /* No error, forward the DICOM file */
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 903
diff changeset
96 OrthancPluginAnswerBuffer(context, output, dicom.data, dicom.size, "application/dicom");
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 903
diff changeset
97
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 903
diff changeset
98 /* Free memory */
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 903
diff changeset
99 OrthancPluginFreeMemoryBuffer(context, &dicom);
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 903
diff changeset
100 }
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 903
diff changeset
101
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 903
diff changeset
102 return 0;
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 903
diff changeset
103 }
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 903
diff changeset
104
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 903
diff changeset
105
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 903
diff changeset
106 ORTHANC_PLUGINS_API int32_t Callback4(OrthancPluginRestOutput* output,
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 903
diff changeset
107 const char* url,
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 903
diff changeset
108 const OrthancPluginHttpRequest* request)
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 903
diff changeset
109 {
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 903
diff changeset
110 /* Answer with a sample 8bpp image. */
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 903
diff changeset
111
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 903
diff changeset
112 uint8_t buffer[256 * 256];
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 903
diff changeset
113 uint32_t x, y, value;
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 903
diff changeset
114
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 903
diff changeset
115 value = 0;
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 903
diff changeset
116 for (y = 0; y < 256; y++)
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 903
diff changeset
117 {
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 903
diff changeset
118 for (x = 0; x < 256; x++, value++)
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 903
diff changeset
119 {
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 903
diff changeset
120 buffer[value] = x;
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 903
diff changeset
121 }
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 903
diff changeset
122 }
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 903
diff changeset
123
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 903
diff changeset
124 OrthancPluginCompressAndAnswerPngImage(context, output, OrthancPluginPixelFormat_Grayscale8,
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 903
diff changeset
125 256, 256, 256, buffer);
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 903
diff changeset
126 return 0;
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 903
diff changeset
127 }
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 903
diff changeset
128
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 903
diff changeset
129
898
7000fc86fe62 improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 897
diff changeset
130 ORTHANC_PLUGINS_API int32_t OrthancPluginInitialize(OrthancPluginContext* c)
886
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
131 {
894
690aeb4cb899 REST callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 888
diff changeset
132 char info[1024];
690aeb4cb899 REST callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 888
diff changeset
133
886
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
134 context = c;
903
06b9a30f1e6d fix path
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 902
diff changeset
135 OrthancPluginLogWarning(context, "Sample plugin is initializing");
886
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
136
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
137 sprintf(info, "The version of Orthanc is '%s'", context->orthancVersion);
898
7000fc86fe62 improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 897
diff changeset
138 OrthancPluginLogInfo(context, info);
886
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
139
901
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
140 OrthancPluginRegisterRestCallback(context, "/(plu.*)/hello", Callback1);
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
141 OrthancPluginRegisterRestCallback(context, "/plu.*/image", Callback2);
904
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 903
diff changeset
142 OrthancPluginRegisterRestCallback(context, "/plugin/instances/([^/]+)/info", Callback3);
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 903
diff changeset
143
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 903
diff changeset
144 OrthancPluginRegisterRestCallback(context, "/instances/([^/]+)/preview", Callback4);
886
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
145
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
146 return 0;
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
147 }
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
148
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
149
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
150 ORTHANC_PLUGINS_API void OrthancPluginFinalize()
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
151 {
903
06b9a30f1e6d fix path
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 902
diff changeset
152 OrthancPluginLogWarning(context, "Sample plugin is finalizing");
886
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
153 }
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
154
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
155
888
d44b845c1c89 recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 886
diff changeset
156 ORTHANC_PLUGINS_API const char* OrthancPluginGetName()
d44b845c1c89 recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 886
diff changeset
157 {
d44b845c1c89 recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 886
diff changeset
158 return "sample";
d44b845c1c89 recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 886
diff changeset
159 }
d44b845c1c89 recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 886
diff changeset
160
d44b845c1c89 recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 886
diff changeset
161
d44b845c1c89 recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 886
diff changeset
162 ORTHANC_PLUGINS_API const char* OrthancPluginGetVersion()
d44b845c1c89 recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 886
diff changeset
163 {
d44b845c1c89 recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 886
diff changeset
164 return "1.0";
d44b845c1c89 recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 886
diff changeset
165 }
d44b845c1c89 recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 886
diff changeset
166