fw4spl
ioPacs/include/ioPacs/SSliceIndexDicomPullerEditor.hpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-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 "ioPacs/config.hpp"
10 
11 #include <fwCom/Slot.hpp>
12 
13 #include <fwGui/editor/IEditor.hpp>
14 
15 #include <fwIO/IReader.hpp>
16 
17 #include <fwPacsIO/data/PacsConfiguration.hpp>
18 #include <fwPacsIO/SeriesEnquirer.hpp>
19 
20 #include <fwThread/Worker.hpp>
21 
22 #include <boost/asio/deadline_timer.hpp>
23 #include <boost/asio/io_service.hpp>
24 #include <boost/filesystem/path.hpp>
25 
26 #include <QLineEdit>
27 #include <QObject>
28 #include <QPointer>
29 #include <QSlider>
30 #include <QWidget>
31 
32 namespace fwData
33 {
34 class Composite;
35 class Integer;
36 }
37 
38 namespace fwThread
39 {
40 class Timer;
41 }
42 
43 namespace fwMedData
44 {
45 class SeriesDB;
46 }
47 
48 namespace fwRuntime
49 {
50 struct ConfigurationElement;
51 }
52 
53 namespace ioPacs
54 {
55 
88 class IOPACS_CLASS_API SSliceIndexDicomPullerEditor : public QObject,
90 {
91 Q_OBJECT;
92 
93 public:
94 
96 
97  IOPACS_API static const ::fwCom::Slots::SlotKeyType s_READ_IMAGE_SLOT;
98  typedef ::fwCom::Slot<void (std::size_t)> ReadImageSlotType;
99 
100  IOPACS_API static const ::fwCom::Slots::SlotKeyType s_DISPLAY_MESSAGE_SLOT;
101  typedef ::fwCom::Slot<void (const std::string&)> DisplayMessageSlotType;
102 
106  IOPACS_API SSliceIndexDicomPullerEditor() noexcept;
107 
111  IOPACS_API virtual ~SSliceIndexDicomPullerEditor() noexcept;
112 
113 private Q_SLOTS:
118  IOPACS_API void changeSliceIndex(int value);
119 
120 protected:
121 
123  IOPACS_API virtual void configuring() override;
124 
126  IOPACS_API virtual void starting() override;
127 
129  IOPACS_API virtual void stopping() override;
130 
132  IOPACS_API void updating() override;
133 
135  IOPACS_API void info(std::ostream& _sstream ) override;
136 
138  IOPACS_API void triggerNewSlice();
139 
144  IOPACS_API void readImage(std::size_t selectedSliceIndex);
145 
147  IOPACS_API void pullInstance();
148 
152  IOPACS_API void displayErrorMessage(const std::string& message) const;
153 
160  IOPACS_API void storeInstanceCallback(
161  const std::string& seriesInstanceUID, unsigned int instanceNumber, const std::string& filePath);
162 
164  ReadImageSlotType::sptr m_slotReadImage;
165 
167  DisplayMessageSlotType::sptr m_slotDisplayMessage;
168 
170  QPointer< QSlider > m_sliceIndexSlider;
171 
173  QPointer< QLineEdit > m_sliceIndexLineEdit;
174 
176  std::size_t m_numberOfSlices;
177 
179  std::string m_pacsConfigurationUID;
180 
182  ::fwPacsIO::data::PacsConfiguration::csptr m_pacsConfiguration;
183 
185  std::string m_dicomReaderType;
186 
188  ::fwIO::IReader::wptr m_dicomReader;
189 
191  std::string m_imageKey;
192 
194  std::string m_compositeUID;
195 
197  SPTR(::fwData::Composite) m_composite;
198 
200  SPTR(::fwMedData::SeriesDB) m_tempSeriesDB;
201 
203  SPTR(fwData::Integer) m_axialIndex;
205  SPTR(::fwData::Integer) m_frontalIndex;
207  SPTR(::fwData::Integer) m_sagittalIndex;
208 
210  ::fwThread::Worker::sptr m_pullSeriesWorker;
211 
213  ::fwPacsIO::SeriesEnquirer::sptr m_seriesEnquirer;
214 
216  SPTR(::fwThread::Timer) m_delayTimer2;
217 
219  unsigned int m_delay;
220 
222  SPTR(::fwRuntime::ConfigurationElement) m_readerConfig;
223 };
224 
225 } // namespace ioPacs
#define SPTR(_cls_)
ioPacs contains services use to deal with PACS using DCMTK library.
Namespace containing medical data.
fwPacsIO contains classes used to communicate with a PACS.
Defines the service interface managing the editor service for object.
Definition: IEditor.hpp:25
STL namespace.
The namespace fwRuntime contains classes to manage bundle, configuration element, extension point in ...
This editor service is used to select a slice index and pull the image from the pacs if it is not ava...
#define fwCoreServiceClassDefinitionsMacro(_classinfo_)
Generate common code for services classes.
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...