fw4spl
io/fwDicomIOFilter/include/fwDicomIOFilter/IFilter.hpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2017.
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 #ifndef __FWDICOMIOFILTER_IFILTER_HPP__
8 #define __FWDICOMIOFILTER_IFILTER_HPP__
9 
10 #include "fwDicomIOFilter/config.hpp"
11 #include "fwDicomIOFilter/exceptions/FilterFailure.hpp"
12 #include "fwDicomIOFilter/factory/new.hpp"
13 #include "fwDicomIOFilter/registry/detail.hpp"
14 
15 #include <fwLog/Logger.hpp>
16 
17 #include <fwMedData/DicomSeries.hpp>
18 
19 #include <fwTools/Object.hpp>
20 
21 namespace fwDicomIOFilter
22 {
23 
27 class FWDICOMIOFILTER_CLASS_API IFilter : public ::fwTools::Object
28 {
29 public:
30 
31  typedef ::fwDicomIOFilter::factory::Key Key;
32 
39  template <typename T>
40  class Registrar
41  {
42  public:
43  Registrar()
44  {
45  ::fwDicomIOFilter::registry::get()->addFactory(T::classname(), &::fwDicomIOFilter::factory::New<T>);
46  }
47  };
48 
50 
51  typedef std::vector< ::fwMedData::DicomSeries::sptr > DicomSeriesContainerType;
52 
56  typedef enum
57  {
58  MODIFIER = 0,
59  SORTER = 1,
60  SPLITTER = 2,
61  COMPOSITE = 3,
62  CUSTOM = 4,
63  } FilterType;
64 
66  FWDICOMIOFILTER_API virtual ~IFilter();
67 
72  FWDICOMIOFILTER_API virtual DicomSeriesContainerType apply(
73  const ::fwMedData::DicomSeries::sptr& series, const ::fwLog::Logger::sptr& logger) const = 0;
74 
76  FWDICOMIOFILTER_API virtual std::string getName() const = 0;
77 
79  FWDICOMIOFILTER_API virtual std::string getDescription() const = 0;
80 
82  FWDICOMIOFILTER_API virtual FilterType getFilterType() const = 0;
83 
85  FWDICOMIOFILTER_API virtual bool isConfigurationRequired() const;
86 
88  FWDICOMIOFILTER_API virtual bool isConfigurableWithGUI() const;
89 
91  FWDICOMIOFILTER_API virtual void configureWithGUI();
92 
93 protected:
94 
96  FWDICOMIOFILTER_API IFilter();
97 
98 };
99 
100 } // namespace fwDicomIOFilter
101 
102 #endif /* __FWDICOMIOFILTER_IFILTER_HPP__ */
#define fwCoreNonInstanciableClassDefinitionsMacro(_classinfo_)
Generate common code for Non Instanciable classes (Interfaces, Abstract classes, ...)
Define Base class for FW4SPL objects and services.
Class used to register a class factory in factory registry. This class defines also the object factor...
fwDicomIOFilter contains filters used to pre-process images before reading.
Key class used to restrict access to Filter construction. See http://www.drdobbs.com/184402053.