fw4spl
SliceIndexPositionEditor.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 "uiImageQt/config.hpp"
10 
11 #include <fwDataTools/helper/MedicalImageAdaptor.hpp>
12 
13 #include <fwGui/editor/IEditor.hpp>
14 
15 #include <fwGuiQt/SliceSelector.hpp>
16 
17 #include <fwTools/Failed.hpp>
18 
19 namespace uiImageQt
20 {
21 
43 class UIIMAGEQT_CLASS_API SliceIndexPositionEditor : public ::fwGui::editor::IEditor,
45 {
46 
47 public:
48 
50 
52  UIIMAGEQT_API SliceIndexPositionEditor() noexcept;
53 
55  UIIMAGEQT_API virtual ~SliceIndexPositionEditor() noexcept;
56 
66  UIIMAGEQT_API virtual KeyConnectionsType getObjSrvConnections() const override;
67 
68 protected:
69 
71  using ::fwDataTools::helper::MedicalImageAdaptor::Orientation;
72 
76  virtual void starting() override;
77 
81  virtual void stopping() override;
82 
84  virtual void updating() override;
85 
87  virtual void swapping() override;
88 
100  virtual void configuring() override;
101 
111  UIIMAGEQT_API virtual KeyConnectionsMap getAutoConnections() const override;
112 
114  UIIMAGEQT_API virtual void info( std::ostream& _sstream ) override;
115 
117  UIIMAGEQT_API void updateSliceIndexFromImg();
118 
120  UIIMAGEQT_API void updateSliceTypeFromImg(Orientation type );
121 
123  UIIMAGEQT_API void sliceIndexNotification(unsigned int index);
124 
126  UIIMAGEQT_API void sliceTypeNotification( int type );
127 
128 private:
129 
134  void updateSliceIndex(int axial, int frontal, int sagittal);
136 
138  void updateSliceType(int from, int to);
139 
141  void updateBuffer();
146  static const std::string* SLICE_INDEX_FIELDID[ 3 ];
148 
149  ::fwGuiQt::SliceSelector* m_sliceSelectorPanel;
150 
151 };
152 
153 } // uiImageQt
This class is a helper to define the connections of a service and its data.
Definition: IService.hpp:454
Defines the service interface managing the editor service for object.
Definition: IEditor.hpp:25
The namespace fwDataTools contains classes which provide helpers to manipulate fwData::Object. *.
STL namespace.
The namespace fwGuiQt contains classes which provide the implementation of the Gui using Qt library...
Definition: WindowLevel.hpp:32
The namespace uiImageQt contains several editors on image written with Qt. This namespace is included...
Definition: ImageInfo.hpp:23
::fwCom::helper::SigSlotConnection::KeyConnectionsType KeyConnectionsType
Returns proposals to connect service slots to associated object signals, this method is used for obj/...
Definition: IService.hpp:449
#define fwCoreServiceClassDefinitionsMacro(_classinfo_)
Generate common code for services classes.
SliceIndexPositionEditor service allows to change the slice index of an image.