CannyEdgeDetection.h 2.45 KB
Newer Older
1
2
3
4
/*****************************************************************************
 * $CAMITK_LICENCE_BEGIN$
 *
 * CamiTK - Computer Assisted Medical Intervention ToolKit
saubatn's avatar
saubatn committed
5
 * (c) 2001-2016 Univ. Grenoble Alpes, CNRS, TIMC-IMAG UMR 5525 (GMCAO) 
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
 *
 * Visit http://camitk.imag.fr for more information
 *
 * This file is part of CamiTK.
 *
 * CamiTK is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License version 3
 * only, as published by the Free Software Foundation.
 *
 * CamiTK is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License version 3 for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * version 3 along with CamiTK.  If not, see <http://www.gnu.org/licenses/>.
 *
 * $CAMITK_LICENCE_END$
 ****************************************************************************/
25
26
27
28
29
30
#ifndef CANYEDGEDETECTION_H
#define CANYEDGEDETECTION_H

#include <QObject>
#include <Action.h>
#include <ImageComponent.h>
31
#include <ActionWidget.h>
32

saubatn's avatar
saubatn committed
33
34
#include "ITKFilterAPI.h"

35
/**
36
 *
37
 * @ingroup group_cepimaging_actions_itkfilters
38
 *
39
40
 * @brief
 * Perform a Canny edge detection on the @ref camitk::ImageComponent "ImageComponent"
41
 *
42
 **/
saubatn's avatar
saubatn committed
43
class ITKFILTER_API CannyEdgeDetection : public camitk::Action {
44
    Q_OBJECT
45

promayon's avatar
promayon committed
46
47
public:
    /// Default Constructor
48
    CannyEdgeDetection(camitk::ActionExtension *);
49
50
51
52

    /// Default Destructor
    virtual ~CannyEdgeDetection();

53
public slots:
54
    /** this method is automatically called when the action is triggered.
55
      * Use getTargets() QList to get the list of component to use.
promayon's avatar
promayon committed
56
      * \note getTargets() is automatically filtered so that it only contains compatible components,
57
58
      * i.e., instances of ImageComponent (or a subclass).
      */
59
    virtual ApplyStatus apply();
60

promayon's avatar
promayon committed
61
private:
62
    /// helper method to simplify the target component processing
promayon's avatar
promayon committed
63
    virtual void process(camitk::ImageComponent *);
64

promayon's avatar
promayon committed
65
66
private:
    vtkSmartPointer<vtkImageData> implementProcess(vtkSmartPointer<vtkImageData> img);
67

promayon's avatar
promayon committed
68
69
    template <class InputPixelType, class OutputPixelType, const int dim>
    vtkSmartPointer<vtkImageData> itkProcess(vtkSmartPointer<vtkImageData> img);
70
71
72


protected:
promayon's avatar
promayon committed
73
74
75
    bool keepOrgVoxelType;
    double variance;
    double upperThreshold;
76
77
    double lowerThreshold;

promayon's avatar
promayon committed
78
};
79
#endif // CANYEDGEDETECTION_H