SlideIO 2.0.0
Open-source library for reading of medical images
Loading...
Searching...
No Matches
sobelfilter.hpp
1// This file is part of slideio project.
2// It is subject to the license terms in the LICENSE file found in the top-level directory
3// of this distribution and at http://slideio.com/license.html.
4#pragma once
5#include "transformation.hpp"
6#include "slideio/base/slideio_enums.hpp"
7
8namespace slideio
9{
10
11 class SLIDEIO_TRANSFORMER_EXPORTS SobelFilter : public Transformation
12 {
13 public:
14 SobelFilter()
15 {
16 m_type = TransformationType::SobelFilter;
17 }
18
19 DataType getDepth() const
20 {
21 return m_depth;
22 }
23
24 void setDepth(const DataType& depth)
25 {
26 m_depth = depth;
27 }
28
29 int getDx() const
30 {
31 return m_dx;
32 }
33
34 void setDx(int dx)
35 {
36 m_dx = dx;
37 }
38
39 int getDy() const
40 {
41 return m_dy;
42 }
43
44 void setDy(int dy)
45 {
46 m_dy = dy;
47 }
48
49 int getKernelSize() const
50 {
51 return m_ksize;
52 }
53
54 void setKernelSize(int ksize)
55 {
56 m_ksize = ksize;
57 }
58
59 double getScale() const
60 {
61 return m_scale;
62 }
63
64 void setScale(double scale)
65 {
66 m_scale = scale;
67 }
68
69 double getDelta() const
70 {
71 return m_delta;
72 }
73
74 void setDelta(double delta)
75 {
76 m_delta = delta;
77 }
78
79 void applyTransformation(const cv::Mat& block, cv::OutputArray transformedBlock) const override;
80 int getInflationValue() const override;
81 std::vector<DataType> computeChannelDataTypes(const std::vector<DataType>& channels) const override;
82
83 private:
84 DataType m_depth = DataType::DT_Float32;
85 int m_dx = 1;
86 int m_dy = 1;
87 int m_ksize = 3;
88 double m_scale = 1.;
89 double m_delta = 0.;
90 };
91
92}
Definition: exceptions.hpp:12