fw4spl
SSliceIndexDicomEditor.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 "ioDicom/config.hpp"
10 
11 #include <fwCom/Slot.hpp>
12 
13 #include <fwGui/editor/IEditor.hpp>
14 
15 #include <fwIO/IReader.hpp>
16 
17 #include <boost/asio/deadline_timer.hpp>
18 #include <boost/asio/io_service.hpp>
19 #include <boost/filesystem/path.hpp>
20 
21 #include <QLineEdit>
22 #include <QObject>
23 #include <QPointer>
24 #include <QSlider>
25 #include <QWidget>
26 
27 namespace fwData
28 {
29 class Composite;
30 class Integer;
31 }
32 
33 namespace fwThread
34 {
35 class Timer;
36 }
37 
38 namespace fwMedData
39 {
40 class SeriesDB;
41 }
42 
43 namespace fwRuntime
44 {
46 }
47 
48 namespace ioDicom
49 {
50 
79 class IODICOM_CLASS_API SSliceIndexDicomEditor : public QObject,
81 {
82 Q_OBJECT;
83 
84 public:
85 
87 
88  IODICOM_API static const ::fwCom::Slots::SlotKeyType s_READ_IMAGE_SLOT;
89  typedef ::fwCom::Slot<void (std::size_t)> ReadImageSlotType;
90 
91  IODICOM_API static const ::fwCom::Slots::SlotKeyType s_DISPLAY_MESSAGE_SLOT;
92  typedef ::fwCom::Slot<void (const std::string&)> DisplayMessageSlotType;
93 
97  IODICOM_API SSliceIndexDicomEditor() noexcept;
98 
102  IODICOM_API virtual ~SSliceIndexDicomEditor() noexcept;
103 
104 protected:
105 
107  IODICOM_API virtual void configuring() override;
108 
110  IODICOM_API virtual void starting() override;
111 
113  IODICOM_API virtual void stopping() override;
114 
116  IODICOM_API void updating() override;
117 
119  IODICOM_API void info(std::ostream& _sstream ) override;
120 
122  IODICOM_API void triggerNewSlice();
123 
128  IODICOM_API void readImage(std::size_t selectedSliceIndex);
129 
134  IODICOM_API void displayErrorMessage(const std::string& message) const;
135 
136 private Q_SLOTS:
141  IODICOM_API void changeSliceIndex(int value);
142 
143 private:
144 
146  ReadImageSlotType::sptr m_slotReadImage;
147 
149  QPointer< QSlider > m_sliceIndexSlider;
150 
152  QPointer< QLineEdit > m_sliceIndexLineEdit;
153 
155  std::size_t m_numberOfSlices;
156 
158  std::string m_dicomReaderType;
159 
161  ::fwIO::IReader::wptr m_dicomReader;
162 
164  SPTR(::fwMedData::SeriesDB) m_tempSeriesDB;
165 
167  SPTR(fwData::Integer) m_axialIndex;
169  SPTR(::fwData::Integer) m_frontalIndex;
171  SPTR(::fwData::Integer) m_sagittalIndex;
172 
174  SPTR(::fwThread::Timer) m_delayTimer2;
175 
177  std::size_t m_delay;
178 
180  SPTR(::fwRuntime::ConfigurationElement) m_readerConfig;
181 };
182 
183 } // namespace ioDicom
#define SPTR(_cls_)
Namespace containing medical data.
This class contains an integer value. Integer object is essentially used as a field in other objects...
Definition: Integer.hpp:24
Defines the service interface managing the editor service for object.
Definition: IEditor.hpp:25
STL namespace.
Defines the configuration element class.
The namespace fwRuntime contains classes to manage bundle, configuration element, extension point in ...
This editor service is used to select a slice index and read the corresponding image on the local com...
ioDicom contains services used to deal with the DICOM standard.
The Timer class provides single-shot or repetitive timers. A Timer triggers a function once after a d...
Definition: Timer.hpp:27
#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 class defines a composite object.
This namespace fwThread provides few tools to execute asynchronous tasks on different threads...