Computer Assited Medical Intervention Tool Kit  version 3.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
MorphologicalOperators.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * $CAMITK_LICENCE_BEGIN$
3  *
4  * CamiTK - Computer Assisted Medical Intervention ToolKit
5  * (c) 2001-2014 UJF-Grenoble 1, CNRS, TIMC-IMAG UMR 5525 (GMCAO)
6  *
7  * Visit http://camitk.imag.fr for more information
8  *
9  * This file is part of CamiTK.
10  *
11  * CamiTK is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * CamiTK is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU Lesser General Public License version 3 for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public License
21  * version 3 along with CamiTK. If not, see <http://www.gnu.org/licenses/>.
22  *
23  * $CAMITK_LICENCE_END$
24  ****************************************************************************/
25 #ifndef MORPHOLOGICALOPERATORS_H
26 #define MORPHOLOGICALOPERATORS_H
27 
28 #include <QObject>
29 #include <Action.h>
30 #include <ImageComponent.h>
31 #include <ActionWidget.h>
32 
33 #include <itkImage.h>
34 
44  Q_OBJECT
45 
47  Q_ENUMS( MorphoType )
48  Q_ENUMS( MorphoOperation )
49 
52 
53 
54 public:
57 
60 
63 
64  // Setters and Getters for parameters
67 
70 
72  virtual ~MorphologicalOperators();
73 
74 public slots:
80  virtual ApplyStatus apply();
81 
82 
83 private:
85  virtual void process(camitk::ImageComponent *);
86 
87 private:
88  vtkSmartPointer<vtkImageData> implementProcess(vtkSmartPointer<vtkImageData> img);
89 
90  template <class InputPixelType, class OutputPixelType, const int dim>
91  vtkSmartPointer<vtkImageData> itkProcess(vtkSmartPointer<vtkImageData> img);
92 
93  template <class InputPixelType, class OutputPixelType, const int dim>
94  vtkSmartPointer<vtkImageData> binaryErosionFilter(vtkSmartPointer<vtkImageData> img);
95  template <class InputPixelType, class OutputPixelType, const int dim>
96  vtkSmartPointer<vtkImageData> binaryDilationFilter(vtkSmartPointer<vtkImageData> img);
97  template <class InputPixelType, class OutputPixelType, const int dim>
98  vtkSmartPointer<vtkImageData> binaryOpeningFilter(vtkSmartPointer<vtkImageData> img);
99  template <class InputPixelType, class OutputPixelType, const int dim>
100  vtkSmartPointer<vtkImageData> binaryClosureFilter(vtkSmartPointer<vtkImageData> img);
101 
102  template <class InputPixelType, class OutputPixelType, const int dim>
103  vtkSmartPointer<vtkImageData> greyLevelErosionFilter(vtkSmartPointer<vtkImageData> img);
104  template <class InputPixelType, class OutputPixelType, const int dim>
105  vtkSmartPointer<vtkImageData> greyLevelDilationFilter(vtkSmartPointer<vtkImageData> img);
106  template <class InputPixelType, class OutputPixelType, const int dim>
107  vtkSmartPointer<vtkImageData> greyLevelOpeningFilter(vtkSmartPointer<vtkImageData> img);
108  template <class InputPixelType, class OutputPixelType, const int dim>
109  vtkSmartPointer<vtkImageData> greyLevelClosureFilter(vtkSmartPointer<vtkImageData> img);
110 
111 
112 
113 protected:
118 
119  QString suffix;
120 
121 };
122 #endif // MORPHOLOGICALOPERATORS_H
vtkSmartPointer< vtkImageData > itkProcess(vtkSmartPointer< vtkImageData > img)
Definition: MorphologicalOperators.h:56
MorphoType typeOfOperation
Enumerations.
Definition: MorphologicalOperators.h:50
MorphoType getTypeOfOperation() const
vtkSmartPointer< vtkImageData > greyLevelOpeningFilter(vtkSmartPointer< vtkImageData > img)
MorphoOperation operation
Definition: MorphologicalOperators.h:51
Action class is an abstract class that enables you to build a action (generally on a component)...
Definition: Action.h:184
void setTypeOfOperation(const MorphoType typeOfOperation)
vtkSmartPointer< vtkImageData > greyLevelErosionFilter(vtkSmartPointer< vtkImageData > img)
virtual ApplyStatus apply()
this method is automatically called when the action is triggered.
int structuringElementSize
Definition: MorphologicalOperators.h:117
vtkSmartPointer< vtkImageData > binaryOpeningFilter(vtkSmartPointer< vtkImageData > img)
void setOperation(const MorphoOperation operation)
vtkSmartPointer< vtkImageData > implementProcess(vtkSmartPointer< vtkImageData > img)
MorphoOperation getOperation() const
This class describes what is a generic Action extension.
Definition: ActionExtension.h:61
Definition: MorphologicalOperators.h:59
virtual ~MorphologicalOperators()
Default Destructor.
Definition: ImageComponent.h:69
ApplyStatus
describes what happened during the application of an algorithm (i.e. results of the apply method) ...
Definition: Action.h:196
QString suffix
Definition: MorphologicalOperators.h:119
Perform some morphological operators such as opening, closing ...
Definition: MorphologicalOperators.h:43
Definition: MorphologicalOperators.h:59
MorphologicalOperators(camitk::ActionExtension *)
Default Constructor.
virtual void process(camitk::ImageComponent *)
helper method to simplify the target component processing
MorphoOperation
Define the possible morphological operations.
Definition: MorphologicalOperators.h:59
vtkSmartPointer< vtkImageData > binaryDilationFilter(vtkSmartPointer< vtkImageData > img)
vtkSmartPointer< vtkImageData > greyLevelClosureFilter(vtkSmartPointer< vtkImageData > img)
vtkSmartPointer< vtkImageData > binaryErosionFilter(vtkSmartPointer< vtkImageData > img)
Definition: MorphologicalOperators.h:59
vtkSmartPointer< vtkImageData > greyLevelDilationFilter(vtkSmartPointer< vtkImageData > img)
Definition: MorphologicalOperators.h:56
MorphoType
Define the possible types of morphological operatiosn.
Definition: MorphologicalOperators.h:56
vtkSmartPointer< vtkImageData > binaryClosureFilter(vtkSmartPointer< vtkImageData > img)
Definition: MorphologicalOperators.h:59