Slicer  4.11
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
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 
34 class vtkPoints;
35 
36 class VTK_SLICER_BASE_LOGIC_EXPORT vtkImageFillROI : public vtkImageAlgorithm
37 {
38 public:
39  static vtkImageFillROI *New();
40  vtkTypeMacro(vtkImageFillROI,vtkImageAlgorithm);
41  void PrintSelf(ostream& os, vtkIndent indent) override;
42 
43  vtkSetMacro(Value, double);
44  vtkGetMacro(Value, double);
45 
46  void SetShapeToPolygon() {this->Shape = SHAPE_POLYGON;};
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:
57  return "Polygon";
58  case SHAPE_LINES:
59  return "Lines";
60  case SHAPE_POINTS:
61  return "Points";
62  default:
63  return "None";
64  }
65  }
66 
67  void SetShapeString(const char *str) {
68  if (strcmp(str,"Polygon") == 0)
69  this->SetShapeToPolygon();
70  else if (strcmp(str,"Lines") == 0)
71  this->SetShapeToLines();
72  else
73  this->SetShapeToPoints();
74  }
75 
76  vtkSetMacro(Radius, int);
77  vtkGetMacro(Radius, int);
78 
79  virtual void SetPoints(vtkPoints*);
80  vtkGetObjectMacro(Points, vtkPoints);
81 
82 protected:
84  ~vtkImageFillROI() override;
85 
86  vtkPoints *Points;
87  double Value;
88  int Radius;
89  int Shape;
90 
93  int RequestData(vtkInformation* request,
94  vtkInformationVector** inputVectors,
95  vtkInformationVector* outputVector) override;
96 
97 private:
98  vtkImageFillROI(const vtkImageFillROI&) = delete;
99  void operator=(const vtkImageFillROI&) = delete;
100 };
101 
102 #endif
void SetShapeString(const char *str)
#define SHAPE_POINTS
const char * GetShapeString()
void SetShape(int s)
vtkPoints * Points
void SetShapeToPolygon()
#define SHAPE_POLYGON
#define SHAPE_LINES