comparison Resources/Graveyard/Hello.cpp @ 63:3252fbf149e3

test
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 25 Nov 2016 18:23:09 +0100
parents
children d529d9ce3c7e
comparison
equal deleted inserted replaced
62:f45cec2c32e2 63:3252fbf149e3
1
2 #include <stdint.h>
3 #include <boost/noncopyable.hpp>
4 #include <string>
5 #include <vector>
6 #include <json/reader.h>
7 #include <json/value.h>
8 #include <boost/thread/mutex.hpp>
9
10 #include "../../Framework/Inputs/DicomPyramid.h"
11 #include "../../Applications/ApplicationToolbox.h"
12 #include "../../Resources/Orthanc/Plugins/Samples/Common/OrthancHttpConnection.h"
13 #include "../../Resources/Orthanc/Plugins/Samples/Common/DicomDatasetReader.h"
14 #include "../../Resources/Orthanc/Plugins/Samples/Common/FullOrthancDataset.h"
15 #include "../../Resources/Orthanc/Plugins/Samples/Common/SimplifiedOrthancDataset.h"
16
17 #include <stdio.h>
18
19 namespace OrthancPlugins
20 {
21 void Run()
22 {
23 OrthancHttpConnection orthanc;
24
25 #if 0
26 //DicomDatasetReader reader(new SimplifiedOrthancDataset(orthanc, "/instances/2791b060-6ff103b3-8078bed0-5abbd75a-a5c675f7/tags?simplify"));
27 DicomDatasetReader reader(new FullOrthancDataset(orthanc, "/instances/2791b060-6ff103b3-8078bed0-5abbd75a-a5c675f7/tags"));
28
29 std::cout << reader.GetIntegerValue(DICOM_TAG_TOTAL_PIXEL_MATRIX_COLUMNS) << "x"
30 << reader.GetIntegerValue(DICOM_TAG_TOTAL_PIXEL_MATRIX_ROWS) << std::endl;
31
32 std::string s;
33 printf("%d ", reader.GetDataset().GetStringValue(s, DICOM_TAG_SOP_CLASS_UID));
34 printf("[%s]\n", s.c_str());
35
36 size_t c;
37
38 {
39 DicomPath p(DICOM_TAG_PER_FRAME_FUNCTIONAL_GROUPS_SEQUENCE);
40 printf("%d ", reader.GetDataset().GetSequenceSize(c, p));
41 printf("%d\n", c);
42 }
43
44 for (size_t i = 0; i < c; i++)
45 {
46 /*DicomPath p(DICOM_TAG_COLUMN_POSITION_IN_TOTAL_IMAGE_PIXEL_MATRIX);
47 p.AddToPrefix(DICOM_TAG_PER_FRAME_FUNCTIONAL_GROUPS_SEQUENCE, i);
48 p.AddToPrefix(DICOM_TAG_PLANE_POSITION_SLIDE_SEQUENCE, 0);
49
50 std::string x, y;
51 printf("%d %d ", i, reader.GetDataset().GetStringValue(x, p));
52 p.SetFinalTag(DICOM_TAG_ROW_POSITION_IN_TOTAL_IMAGE_PIXEL_MATRIX);
53 printf("%d ", reader.GetDataset().GetStringValue(y, p));
54 printf("[%s,%s]\n", x.c_str(), y.c_str());*/
55
56 std::cout << i << ": ["
57 << reader.GetMandatoryStringValue(
58 DicomPath(DICOM_TAG_PER_FRAME_FUNCTIONAL_GROUPS_SEQUENCE, i,
59 DICOM_TAG_PLANE_POSITION_SLIDE_SEQUENCE, 0,
60 DICOM_TAG_COLUMN_POSITION_IN_TOTAL_IMAGE_PIXEL_MATRIX)) << ","
61 << reader.GetMandatoryStringValue(
62 DicomPath(DICOM_TAG_PER_FRAME_FUNCTIONAL_GROUPS_SEQUENCE, i,
63 DICOM_TAG_PLANE_POSITION_SLIDE_SEQUENCE, 0,
64 DICOM_TAG_ROW_POSITION_IN_TOTAL_IMAGE_PIXEL_MATRIX))
65 << "]" << std::endl;
66 }
67
68 #else
69 OrthancWSI::DicomPyramid pyramid(orthanc, "68bc53a6-8bd5b470-05072b43-af144cf8-665c54fd");
70 //OrthancWSI::DicomPyramid pyramid(orthanc, "4fdff9b9-8b81bc8f-04a3f903-4d44bd57-cc3bf42c");
71 #endif
72 }
73
74 }
75
76
77
78
79 int main()
80 {
81 OrthancWSI::ApplicationToolbox::GlobalInitialize();
82 OrthancPlugins::Run();
83 OrthancWSI::ApplicationToolbox::GlobalFinalize();
84 return 0;
85 }