fw4spl
ioDicomWeb/include/ioDicomWeb/SSliceIndexDicomPullerEditor.hpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2018.
3  * Distributed under the terms of the GNU Lesser General Public License (LGPL) as
4  * published by the Free Software Foundation.
5  * ****** END LICENSE BLOCK ****** */
6 
7 #pragma once
8 
9 #include "ioDicomWeb/config.hpp"
10 
11 #include <fwGui/editor/IEditor.hpp>
12 
13 #include <fwIO/IReader.hpp>
14 
15 #include <fwNetworkIO/http/ClientQt.hpp>
16 
17 #include <boost/filesystem/path.hpp>
18 
19 #include <QLineEdit>
20 #include <QSlider>
21 
22 namespace fwData
23 {
24 class Integer;
25 }
26 
27 namespace fwThread
28 {
29 class Timer;
30 }
31 
32 namespace fwMedData
33 {
34 class SeriesDB;
35 }
36 
37 namespace fwRuntime
38 {
39 struct ConfigurationElement;
40 }
41 
42 namespace ioDicomWeb
43 {
44 
82 class IODICOMWEB_CLASS_API SSliceIndexDicomPullerEditor : public QObject,
84 {
85 Q_OBJECT;
86 
87 public:
88 
90 
94  IODICOMWEB_API SSliceIndexDicomPullerEditor() noexcept;
95 
99  IODICOMWEB_API virtual ~SSliceIndexDicomPullerEditor() noexcept;
100 
101 private Q_SLOTS:
106  void changeSliceIndex(int value);
107 
108 protected:
109 
111  IODICOMWEB_API virtual void configuring() override;
112 
114  IODICOMWEB_API virtual void starting() override;
115 
117  IODICOMWEB_API virtual void stopping() override;
118 
120  IODICOMWEB_API void updating() override;
121 
122 private:
124  void triggerNewSlice();
125 
130  void readImage(size_t selectedSliceIndex);
131 
133  void pullInstance();
134 
138  void displayErrorMessage(const std::string& message) const;
139 
141  QPointer< QSlider > m_sliceIndexSlider;
142 
144  QPointer< QLineEdit > m_sliceIndexLineEdit;
145 
147  size_t m_numberOfSlices;
148 
150  std::string m_dicomReaderType;
151 
153  ::fwIO::IReader::wptr m_dicomReader;
154 
156  std::string m_imageKey;
157 
159  SPTR(::fwMedData::SeriesDB) m_tempSeriesDB;
160 
162  SPTR(fwData::Integer) m_axialIndex;
164  SPTR(::fwData::Integer) m_frontalIndex;
166  SPTR(::fwData::Integer) m_sagittalIndex;
167 
169  ::fwNetworkIO::http::ClientQt m_clientQt;
170 
172  SPTR(::fwThread::Timer) m_delayTimer;
173 
175  unsigned int m_delay;
176 
178  SPTR(::fwRuntime::ConfigurationElement) m_readerConfig;
179 
181  std::string getPreferenceKey(const std::string& key) const;
182 
184  std::string m_serverHostnameKey;
185 
187  std::string m_serverPortKey;
188 
190  std::string m_serverHostname;
191 
193  int m_serverPort;
194 
195 };
196 
197 } // namespace ioDicomWeb
#define SPTR(_cls_)
Namespace containing medical data.
Defines the service interface managing the editor service for object.
Definition: IEditor.hpp:25
This editor service is used to select a slice index and pull the image from the pacs if it is not ava...
STL namespace.
The namespace fwNetworkIO contains the primary methods to access network.
The namespace fwRuntime contains classes to manage bundle, configuration element, extension point in ...
#define fwCoreServiceClassDefinitionsMacro(_classinfo_)
Generate common code for services classes.
ioDicomWeb contains services use to deal with PACS through HTTP.
The namespace fwIO contains the base interface for reader and writer services.
Definition: ioTypes.hpp:16
Contains the representation of the data objects used in the framework.
This namespace fwThread provides few tools to execute asynchronous tasks on different threads...