annotate Resources/Samples/OrthancClient/Vtk/main.cpp @ 1378:5dabfaf6034b

forgotten file
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 29 May 2015 11:57:53 +0200
parents 3d76e26b3865
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
531
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Orthanc - A Lightweight, RESTful DICOM Store
1288
6e7e5ed91c2d upgrade to year 2015
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
3 * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics
6e7e5ed91c2d upgrade to year 2015
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
4 * Department, University Hospital of Liege, Belgium
531
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5 *
1375
3d76e26b3865 fix licensing terms of samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1288
diff changeset
6 * This program is free software: you can redistribute it and/or
3d76e26b3865 fix licensing terms of samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1288
diff changeset
7 * modify it under the terms of the GNU General Public License as
3d76e26b3865 fix licensing terms of samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1288
diff changeset
8 * published by the Free Software Foundation, either version 3 of the
3d76e26b3865 fix licensing terms of samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1288
diff changeset
9 * License, or (at your option) any later version.
3d76e26b3865 fix licensing terms of samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1288
diff changeset
10 *
3d76e26b3865 fix licensing terms of samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1288
diff changeset
11 * This program is distributed in the hope that it will be useful, but
3d76e26b3865 fix licensing terms of samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1288
diff changeset
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
3d76e26b3865 fix licensing terms of samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1288
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
3d76e26b3865 fix licensing terms of samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1288
diff changeset
14 * General Public License for more details.
531
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 *
1375
3d76e26b3865 fix licensing terms of samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1288
diff changeset
16 * You should have received a copy of the GNU General Public License
3d76e26b3865 fix licensing terms of samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1288
diff changeset
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
531
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 **/
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21 #include <iostream>
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23 #include <vtkRenderWindow.h>
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 #include <vtkImageData.h>
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25 #include <vtkPiecewiseFunction.h>
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26 #include <vtkFixedPointVolumeRayCastMapper.h>
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 #include <vtkColorTransferFunction.h>
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 #include <vtkVolumeProperty.h>
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 #include <vtkRenderWindowInteractor.h>
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 #include <vtkRenderer.h>
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 #include <vtkSmartPointer.h>
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 #include <vtkOpenGLRenderer.h>
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 #include <vtkInteractorStyleTrackballCamera.h>
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34
588
a0001c222b32 refactoring of samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 531
diff changeset
35 #include <orthanc/OrthancCppClient.h>
531
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 void Display(OrthancClient::Series& series)
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 {
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40 /**
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 * Load the 3D image from Orthanc into VTK.
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42 **/
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 vtkSmartPointer<vtkImageData> image = vtkSmartPointer<vtkImageData>::New();
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 image->SetDimensions(series.GetWidth(), series.GetHeight(), series.GetInstanceCount());
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 image->SetScalarType(VTK_SHORT);
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 image->AllocateScalars();
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49 if (series.GetWidth() != 0 &&
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50 series.GetHeight() != 0 &&
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51 series.GetInstanceCount() != 0)
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52 {
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53 series.Load3DImage(image->GetScalarPointer(0, 0, 0), Orthanc::PixelFormat_SignedGrayscale16,
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54 2 * series.GetWidth(), 2 * series.GetHeight() * series.GetWidth());
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55 }
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57 image->SetSpacing(series.GetVoxelSizeX(),
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58 series.GetVoxelSizeY(),
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59 series.GetVoxelSizeZ());
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
62 /**
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
63 * The following code is based on the VTK sample for MIP
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
64 * http://www.vtk.org/Wiki/VTK/Examples/Cxx/VolumeRendering/MinIntensityRendering
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
65 **/
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
66
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
67 // Create a transfer function mapping scalar value to opacity
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
68 double range[2];
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
69 image->GetScalarRange(range);
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
70
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
71 vtkSmartPointer<vtkPiecewiseFunction> opacityTransfer =
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
72 vtkSmartPointer<vtkPiecewiseFunction>::New();
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
73 opacityTransfer->AddSegment(range[0], 0.0, range[1], 1.0);
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
75 vtkSmartPointer<vtkColorTransferFunction> colorTransfer =
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
76 vtkSmartPointer<vtkColorTransferFunction>::New();
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
77 colorTransfer->AddRGBPoint(0, 1.0, 1.0, 1.0);
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
78 colorTransfer->AddRGBPoint(range[1], 1.0, 1.0, 1.0);
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
79
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
80 vtkSmartPointer<vtkVolumeProperty> property =
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
81 vtkSmartPointer<vtkVolumeProperty>::New();
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
82 property->SetScalarOpacity(opacityTransfer);
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
83 property->SetColor(colorTransfer);
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
84 property->SetInterpolationTypeToLinear();
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
85
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
86 // Create a Maximum Intensity Projection rendering
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
87 vtkSmartPointer<vtkFixedPointVolumeRayCastMapper> mapper =
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
88 vtkSmartPointer<vtkFixedPointVolumeRayCastMapper>::New();
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
89 mapper->SetBlendModeToMaximumIntensity();
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
90 mapper->SetInput(image);
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
91
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
92 vtkSmartPointer<vtkVolume> volume = vtkSmartPointer<vtkVolume>::New();
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
93 volume->SetMapper(mapper);
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
94 volume->SetProperty(property);
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
95
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
96 vtkSmartPointer<vtkRenderer> renderer = vtkSmartPointer<vtkOpenGLRenderer>::New();
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
97 renderer->AddViewProp(volume);
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
98 renderer->SetBackground(0.1, 0.2, 0.3); // Background color dark blue
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
99
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
100 vtkSmartPointer<vtkInteractorStyleTrackballCamera> style =
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
101 vtkSmartPointer<vtkInteractorStyleTrackballCamera>::New();
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
102
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
103 vtkSmartPointer<vtkRenderWindow> window = vtkSmartPointer<vtkRenderWindow>::New();
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
104 window->AddRenderer(renderer);
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
105
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
106 vtkSmartPointer<vtkRenderWindowInteractor> interactor = vtkSmartPointer<vtkRenderWindowInteractor>::New();
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
107 interactor->SetRenderWindow(window);
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
108 interactor->SetInteractorStyle(style);
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
109 interactor->Start();
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
110 }
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
111
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
112
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
113 int main()
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
114 {
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
115 try
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
116 {
588
a0001c222b32 refactoring of samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 531
diff changeset
117 // The following explicit initialization is not required, except
a0001c222b32 refactoring of samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 531
diff changeset
118 // if you wish to specify the full path to the shared library
a0001c222b32 refactoring of samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 531
diff changeset
119 OrthancClient::Initialize();
531
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
120
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
121 // Use the commented code below if you know the identifier of a
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
122 // series that corresponds to a 3D image.
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
123
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
124 /*
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
125 {
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
126 OrthancClient::OrthancConnection orthanc("http://localhost:8042");
588
a0001c222b32 refactoring of samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 531
diff changeset
127 OrthancClient::Series series(orthanc, "dc5ec3d9-6e1a7b2c-73a829f0-64c609f6-ef976a97");
531
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
128 Display(series);
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
129 return 0;
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
130 }
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
131 */
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
132
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
133
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
134 // Try and find a 3D image inside the local store
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
135 OrthancClient::OrthancConnection orthanc("http://localhost:8042");
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
136
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
137 for (unsigned int i = 0; i < orthanc.GetPatientCount(); i++)
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
138 {
591
a00f626290db better api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 590
diff changeset
139 OrthancClient::Patient patient(orthanc.GetPatient(i));
531
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
140 std::cout << "Patient: " << patient.GetId() << std::endl;
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
141
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
142 for (unsigned int j = 0; j < patient.GetStudyCount(); j++)
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
143 {
591
a00f626290db better api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 590
diff changeset
144 OrthancClient::Study study(patient.GetStudy(j));
531
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
145 std::cout << " Study: " << study.GetId() << std::endl;
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
146
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
147 for (unsigned int k = 0; k < study.GetSeriesCount(); k++)
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
148 {
591
a00f626290db better api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 590
diff changeset
149 OrthancClient::Series series(study.GetSeries(k));
531
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
150 std::cout << " Series: " << series.GetId() << std::endl;
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
151
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
152 if (series.Is3DImage())
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
153 {
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
154 Display(series);
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
155 return 0;
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
156 }
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
157 else
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
158 {
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
159 std::cout << " => Not a 3D image..." << std::endl;
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
160 }
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
161 }
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
162 }
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
163 }
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
164
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
165 std::cout << "Unable to find a 3D image in the local Orthanc store" << std::endl;
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
166
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
167 return 0;
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
168 }
656
08eca5d86aad fixes to cppcheck
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
169 catch (OrthancClient::OrthancClientException& e)
531
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
170 {
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
171 std::cerr << "EXCEPTION: [" << e.What() << "]" << std::endl;
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
172 return -1;
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
173 }
7f9467b5f33b samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
174 }