-
Notifications
You must be signed in to change notification settings - Fork 2
/
vtkImageTraversal.h
51 lines (38 loc) · 930 Bytes
/
vtkImageTraversal.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
// .NAME vtkImageTraversal
// .SECTION Description
// In VTK images (0,0) is the top left corner
#ifndef __vtkImageTraversal_h
#define __vtkImageTraversal_h
class vtkImageData;
class vtkImageTraversal
{
public:
vtkImageTraversal()
{
this->CurrentPixel[0] = 0;
this->CurrentPixel[1] = 0;
}
void SetImage(vtkImageData* image){this->Image = image;}
bool IsValidPixel(int i, int j);
bool IsValidPixel(int pixel[2]);
void Reset()
{
this->CurrentPixel[0] = 0;
this->CurrentPixel[1] = 0;
}
bool HasNextPixel();
void NextPixel();
bool HasLeftNeighbor();
bool HasRightNeighbor();
bool HasTopNeighbor();
bool HasBottomNeighbor();
unsigned char GetLeftNeighbor();
unsigned char GetRightNeighbor();
unsigned char GetTopNeighbor();
unsigned char GetBottomNeighbor();
unsigned char GetPixel();
private:
int CurrentPixel[2];
vtkImageData* Image;
};
#endif