-
Notifications
You must be signed in to change notification settings - Fork 6
/
SmallHoleFiller.h
47 lines (32 loc) · 1.08 KB
/
SmallHoleFiller.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
#ifndef SmallHoleFiller_H
#define SmallHoleFiller_H
template<typename TImage>
class SmallHoleFiller
{
public:
// Constructor
SmallHoleFiller();
// Inputs
void SetImage(typename TImage::Pointer image);
void SetHolePixel(typename TImage::PixelType pixel);
// Outputs
typename TImage::Pointer GetOutput();
// This is the main loop. It simply calls Iterate() until complete.
void Fill();
// This is the core functionality.
void Iterate();
// This function returns true if any of the Output pixels match the HolePixel. This indicates there is more work to be done.
bool HasEmptyPixels();
private:
// The input image.
typename TImage::Pointer Image;
// The intermediate and eventually output image.
typename TImage::Pointer Output;
// The value of a pixel to be considered a hole (to be filled).
typename TImage::PixelType HolePixel;
};
// This function copies the data from 'input' to 'output'
template<typename TImage>
void DeepCopy(typename TImage::Pointer input, typename TImage::Pointer output);
#include "SmallHoleFiller.hxx"
#endif