SlideIO 2.0.0
Open-source library for reading of medical images
Loading...
Searching...
No Matches
laplacianfilter.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 "slideio/transformer/transformationex.hpp"
6#include "slideio/base/slideio_enums.hpp"
7#include "slideio/transformer/transformationtype.hpp"
8
9namespace slideio
10{
11
12 class SLIDEIO_TRANSFORMER_EXPORTS LaplacianFilter : public TransformationEx
13 {
14 public:
15 LaplacianFilter(const LaplacianFilter& other)
16 : TransformationEx(other),
17 m_depth(other.m_depth),
18 m_kernelSize(other.m_kernelSize),
19 m_scale(other.m_scale),
20 m_delta(other.m_delta) {
21 }
22
23 LaplacianFilter(LaplacianFilter&& other) noexcept
24 : TransformationEx(std::move(other)),
25 m_depth(other.m_depth),
26 m_kernelSize(other.m_kernelSize),
27 m_scale(other.m_scale),
28 m_delta(other.m_delta) {
29 }
30
31 LaplacianFilter& operator=(const LaplacianFilter& other) {
32 if (this == &other)
33 return *this;
34 TransformationEx::operator =(other);
35 m_depth = other.m_depth;
36 m_kernelSize = other.m_kernelSize;
37 m_scale = other.m_scale;
38 m_delta = other.m_delta;
39 return *this;
40 }
41
42 LaplacianFilter& operator=(LaplacianFilter&& other) noexcept {
43 if (this == &other)
44 return *this;
45 TransformationEx::operator =(std::move(other));
46 m_depth = other.m_depth;
47 m_kernelSize = other.m_kernelSize;
48 m_scale = other.m_scale;
49 m_delta = other.m_delta;
50 return *this;
51 }
52
53 LaplacianFilter()
54 {
55 m_type = TransformationType::LaplacianFilter;
56 }
57
58 DataType getDepth() const
59 {
60 return m_depth;
61 }
62
63 void setDepth(const DataType& depth)
64 {
65 m_depth = depth;
66 }
67
68 int getKernelSize() const
69 {
70 return m_kernelSize;
71 }
72
73 void setKernelSize(int kernelSize)
74 {
75 m_kernelSize = kernelSize;
76 }
77
78 double getScale() const
79 {
80 return m_scale;
81 }
82
83 void setScale(double scale)
84 {
85 m_scale = scale;
86 }
87
88 double getDelta() const
89 {
90 return m_delta;
91 }
92
93 void setDelta(double delta)
94 {
95 m_delta = delta;
96 }
97
98 void applyTransformation(const cv::Mat& block, cv::OutputArray transformedBlock) const override;
99 int getInflationValue() const override;
100 std::vector<DataType> computeChannelDataTypes(const std::vector<DataType>& channels) const override;
101
102 private:
103 DataType m_depth = DataType::DT_Float32;
104 int m_kernelSize = 1;
105 double m_scale = 1.;
106 double m_delta = 0.;
107 };
108}
Definition: exceptions.hpp:15