fw4spl
SFilterSelectionEditor.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 <fwDicomIOFilter/IFilter.hpp>
12 
13 #include <fwGui/editor/IEditor.hpp>
14 
15 #include <fwMedData/SeriesDB.hpp>
16 
17 #include <QCheckBox>
18 #include <QComboBox>
19 #include <QListWidget>
20 #include <QObject>
21 #include <QPointer>
22 #include <QPushButton>
23 #include <QShortcut>
24 #include <QWidget>
25 
26 namespace ioDicom
27 {
28 
46 class IODICOM_CLASS_API SFilterSelectionEditor : public QObject,
48 {
49 Q_OBJECT;
50 
51 public:
52 
54 
55  typedef std::map< std::string, ::fwDicomIOFilter::IFilter::sptr > FilterMapType;
56 
60  IODICOM_API SFilterSelectionEditor() noexcept;
61 
65  IODICOM_API virtual ~SFilterSelectionEditor() noexcept;
66 
67 private Q_SLOTS:
69  IODICOM_API void addFilter(int filterTypeIndex);
70 
72  IODICOM_API void addFilterAtTheEnd();
73 
75  IODICOM_API void removeFilter();
76 
78  IODICOM_API void updateButtonStatus(int filterIndex);
79 
81  IODICOM_API void configureFilter();
82 
84  IODICOM_API void splitFilter();
85 
87  IODICOM_API void applyFilters();
88 
90  IODICOM_API void showContextMenuForSelectedFilter(const QPoint& pos);
91 
93  IODICOM_API void onForceChecked(int state);
94 protected:
95 
97  IODICOM_API virtual void configuring() override;
98 
100  IODICOM_API virtual void starting() override;
101 
103  IODICOM_API virtual void stopping() override;
104 
106  IODICOM_API void updating() override;
107 
109  IODICOM_API void info(std::ostream& _sstream ) override;
110 
112  IODICOM_API void fillAvailableFilters();
113 
119  IODICOM_API void addFilter(int filterTypeIndex, int position);
120 
126  static bool sortFilters(const ::fwDicomIOFilter::IFilter::sptr& a, const ::fwDicomIOFilter::IFilter::sptr& b);
127 
128  static QIcon getFilterIcon(::fwDicomIOFilter::IFilter::sptr filter);
129 
130  static std::string getFilterDescription(::fwDicomIOFilter::IFilter::sptr filter);
131 
133  QPointer< QComboBox > m_availableFilterListWidget;
134 
136  QPointer< QListWidget > m_selectedFilterListWidget;
137 
139  QPointer< QPushButton > m_addFilterButton;
140 
142  QPointer< QPushButton > m_removeFilterButton;
143 
145  QPointer< QPushButton > m_configureFilterButton;
146 
148  QPointer< QPushButton > m_applyFiltersButton;
149 
151  QPointer< QPushButton > m_splitFilterButton;
152 
154  QPointer< QShortcut > m_deleteShortcut;
155 
157  QPointer< QCheckBox > m_forcedApplyCheckBox;
158 
160  FilterMapType m_filtersMap;
161 
163  std::string m_destinationSeriesDBID;
164 
166  ::fwMedData::SeriesDB::sptr m_destinationSeriesDB;
167 
168 };
169 
170 } // namespace ioDicom
Namespace containing medical data.
Defines the service interface managing the editor service for object.
Definition: IEditor.hpp:25
STL namespace.
fwDicomIOFilter contains filters used to pre-process images before reading.
This editor service is used to select and apply filters to Dicom series.
ioDicom contains services used to deal with the DICOM standard.
#define fwCoreServiceClassDefinitionsMacro(_classinfo_)
Generate common code for services classes.