-
Notifications
You must be signed in to change notification settings - Fork 2
/
cthresholdobject.h
84 lines (65 loc) · 1.82 KB
/
cthresholdobject.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#pragma once
#include "dataobjects.h"
/** Qt Includes **/
#include <QString>
/** ITK Includes **/
#include <itkLabelToRGBImageFilter.h>
#include <itkCastImageFilter.h>
/** Global Initialization **/
enum class Algorithms
{
Otsu = 0,
Triangle = 1
};
/** typedefs **/
using ThresholdPixelType = unsigned char;
using ThresholdImageType = itk::Image<ThresholdPixelType, InputDimension>;
/** CThresholdObject: An abstract class for threshold objects **/
class CThresholdObject
{
/** Constructers and Desctructors **/
protected:
CThresholdObject();
CThresholdObject(const CThresholdObject& rhs);
CThresholdObject& operator =(const CThresholdObject& rhs);
public:
virtual ~CThresholdObject();
/** Data Members **/
private:
InputImageType::Pointer m_InputImage;
OutputImageType::Pointer m_OutputImage;
RGBImageType::Pointer m_RGBOutputImage;
int nLevels;
/** Function Members (Public) **/
public:
void SetInput(const InputImageType::Pointer& cImage)
{
m_InputImage = cImage;
}
const InputImageType::Pointer& GetInput() const noexcept
{
return m_InputImage;
}
void SetThresholdLevels(int levels) noexcept
{
nLevels = levels;
}
virtual int Process() = 0;
virtual const QString& GetDescription() = 0;
const OutputImageType::Pointer& GetOutput() const noexcept
{
return m_OutputImage;
}
const RGBImageType::Pointer& GetRGBOutput() const noexcept
{
return m_RGBOutputImage;
}
int GetLevels() const noexcept
{
return nLevels;
}
/** Function Members (Protected) **/
protected:
void SetOutput(ThresholdImageType::Pointer cImage);
void SetRGBOutput(ThresholdImageType::Pointer cImage);
};