Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
vtkImageFillROI.h
Go to the documentation of this file.
1/*=auto=========================================================================
2
3 Portions (c) Copyright 2005 Brigham and Women's Hospital (BWH) All Rights Reserved.
4
5 See COPYRIGHT.txt
6 or http://www.slicer.org/copyright/copyright.txt for details.
7
8=========================================================================auto=*/
20//
21
22#ifndef __vtkImageFillROI_h
23#define __vtkImageFillROI_h
24
25#include "vtkSlicerBaseLogic.h"
26
27// VTK includes
28#include <vtkImageAlgorithm.h>
29
30#define SHAPE_POLYGON 1
31#define SHAPE_LINES 2
32#define SHAPE_POINTS 3
33
34class vtkPoints;
35
36class VTK_SLICER_BASE_LOGIC_EXPORT vtkImageFillROI : public vtkImageAlgorithm
37{
38public:
40 vtkTypeMacro(vtkImageFillROI, vtkImageAlgorithm);
41 void PrintSelf(ostream& os, vtkIndent indent) override;
42
43 vtkSetMacro(Value, double);
44 vtkGetMacro(Value, double);
45
47 void SetShapeToLines() { this->Shape = SHAPE_LINES; };
48 void SetShapeToPoints() { this->Shape = SHAPE_POINTS; };
49 void SetShape(int s) { this->Shape = s; };
50 int GetShape() { return this->Shape; };
51
52 const char* GetShapeString()
53 {
54 switch (this->Shape)
55 {
56 case SHAPE_POLYGON: return "Polygon";
57 case SHAPE_LINES: return "Lines";
58 case SHAPE_POINTS: return "Points";
59 default: return "None";
60 }
61 }
62
63 void SetShapeString(const char* str)
64 {
65 if (strcmp(str, "Polygon") == 0)
66 {
67 this->SetShapeToPolygon();
68 }
69 else if (strcmp(str, "Lines") == 0)
70 {
71 this->SetShapeToLines();
72 }
73 else
74 {
75 this->SetShapeToPoints();
76 }
77 }
78
79 vtkSetMacro(Radius, int);
80 vtkGetMacro(Radius, int);
81
82 virtual void SetPoints(vtkPoints*);
83 vtkGetObjectMacro(Points, vtkPoints);
84
85protected:
87 ~vtkImageFillROI() override;
88
89 vtkPoints* Points;
90 double Value;
91 int Radius;
92 int Shape;
93
96 int RequestData(vtkInformation* request, vtkInformationVector** inputVectors, vtkInformationVector* outputVector) override;
97
98private:
99 vtkImageFillROI(const vtkImageFillROI&) = delete;
100 void operator=(const vtkImageFillROI&) = delete;
101};
102
103#endif
virtual void SetPoints(vtkPoints *)
int RequestData(vtkInformation *request, vtkInformationVector **inputVectors, vtkInformationVector *outputVector) override
~vtkImageFillROI() override
static vtkImageFillROI * New()
vtkPoints * Points
void SetShape(int s)
const char * GetShapeString()
void PrintSelf(ostream &os, vtkIndent indent) override
void SetShapeString(const char *str)
#define SHAPE_POINTS
#define SHAPE_LINES
#define SHAPE_POLYGON