VTK  9.2.6
vtkImageMask.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkImageMask.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
33 #ifndef vtkImageMask_h
34 #define vtkImageMask_h
35 
36 #include "vtkImagingCoreModule.h" // For export macro
38 
39 class VTKIMAGINGCORE_EXPORT vtkImageMask : public vtkThreadedImageAlgorithm
40 {
41 public:
42  static vtkImageMask* New();
44  void PrintSelf(ostream& os, vtkIndent indent) override;
45 
49  void SetMaskedOutputValue(int num, double* v);
50  void SetMaskedOutputValue(double v) { this->SetMaskedOutputValue(1, &v); }
51  void SetMaskedOutputValue(double v1, double v2)
52  {
53  double v[2];
54  v[0] = v1;
55  v[1] = v2;
56  this->SetMaskedOutputValue(2, v);
57  }
58  void SetMaskedOutputValue(double v1, double v2, double v3)
59  {
60  double v[3];
61  v[0] = v1;
62  v[1] = v2;
63  v[2] = v3;
64  this->SetMaskedOutputValue(3, v);
65  }
66  double* GetMaskedOutputValue() { return this->MaskedOutputValue; }
67  int GetMaskedOutputValueLength() { return this->MaskedOutputValueLength; }
68 
70 
76  vtkSetClampMacro(MaskAlpha, double, 0.0, 1.0);
77  vtkGetMacro(MaskAlpha, double);
79 
83  void SetImageInputData(vtkImageData* in);
84 
88  void SetMaskInputData(vtkImageData* in);
89 
91 
97  vtkSetMacro(NotMask, vtkTypeBool);
98  vtkGetMacro(NotMask, vtkTypeBool);
99  vtkBooleanMacro(NotMask, vtkTypeBool);
101 
105  virtual void SetInput1Data(vtkDataObject* in) { this->SetInputData(0, in); }
106  virtual void SetInput2Data(vtkDataObject* in) { this->SetInputData(1, in); }
107 
108 protected:
109  vtkImageMask();
110  ~vtkImageMask() override;
111 
115  double MaskAlpha;
116 
118 
119  void ThreadedRequestData(vtkInformation* request, vtkInformationVector** inputVector,
120  vtkInformationVector* outputVector, vtkImageData*** inData, vtkImageData** outData,
121  int outExt[6], int threadId) override;
122 
123 private:
124  vtkImageMask(const vtkImageMask&) = delete;
125  void operator=(const vtkImageMask&) = delete;
126 };
127 
128 #endif
double * GetMaskedOutputValue()
Definition: vtkImageMask.h:66
void SetMaskedOutputValue(double v1, double v2, double v3)
Definition: vtkImageMask.h:58
Store vtkAlgorithm input/output information.
double * MaskedOutputValue
Definition: vtkImageMask.h:112
double MaskAlpha
Definition: vtkImageMask.h:115
void SetMaskedOutputValue(double v1, double v2)
Definition: vtkImageMask.h:51
virtual void SetInput1Data(vtkDataObject *in)
Set the two inputs to this filter.
Definition: vtkImageMask.h:105
void SetInputData(vtkDataObject *)
Assign a data object as input.
Combines a mask and an image.
Definition: vtkImageMask.h:39
int MaskedOutputValueLength
Definition: vtkImageMask.h:113
int GetMaskedOutputValueLength()
Definition: vtkImageMask.h:67
int vtkTypeBool
Definition: vtkABI.h:69
Generic filter that has one input.
void SetMaskedOutputValue(double v)
Definition: vtkImageMask.h:50
a simple class to control print indentation
Definition: vtkIndent.h:39
topologically and geometrically regular array of data
Definition: vtkImageData.h:53
virtual int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
Subclasses can reimplement this method to collect information from their inputs and set information f...
vtkTypeBool NotMask
Definition: vtkImageMask.h:114
virtual void SetInput2Data(vtkDataObject *in)
Definition: vtkImageMask.h:106
virtual void ThreadedRequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector, vtkImageData ***inData, vtkImageData **outData, int extent[6], int threadId)
If the subclass does not define an Execute method, then the task will be broken up, multiple threads will be spawned, and each thread will call this method.
Store zero or more vtkInformation instances.
static vtkAlgorithm * New()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
general representation of visualization data
Definition: vtkDataObject.h:65