VTK  9.3.1
vtkImageMask.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
21 #ifndef vtkImageMask_h
22 #define vtkImageMask_h
23 
24 #include "vtkImagingCoreModule.h" // For export macro
26 
27 VTK_ABI_NAMESPACE_BEGIN
28 class VTKIMAGINGCORE_EXPORT vtkImageMask : public vtkThreadedImageAlgorithm
29 {
30 public:
31  static vtkImageMask* New();
33  void PrintSelf(ostream& os, vtkIndent indent) override;
34 
38  void SetMaskedOutputValue(int num, double* v);
39  void SetMaskedOutputValue(double v) { this->SetMaskedOutputValue(1, &v); }
40  void SetMaskedOutputValue(double v1, double v2)
41  {
42  double v[2];
43  v[0] = v1;
44  v[1] = v2;
45  this->SetMaskedOutputValue(2, v);
46  }
47  void SetMaskedOutputValue(double v1, double v2, double v3)
48  {
49  double v[3];
50  v[0] = v1;
51  v[1] = v2;
52  v[2] = v3;
53  this->SetMaskedOutputValue(3, v);
54  }
55  double* GetMaskedOutputValue() { return this->MaskedOutputValue; }
56  int GetMaskedOutputValueLength() { return this->MaskedOutputValueLength; }
57 
59 
65  vtkSetClampMacro(MaskAlpha, double, 0.0, 1.0);
66  vtkGetMacro(MaskAlpha, double);
68 
72  void SetImageInputData(vtkImageData* in);
73 
77  void SetMaskInputData(vtkImageData* in);
78 
80 
86  vtkSetMacro(NotMask, vtkTypeBool);
87  vtkGetMacro(NotMask, vtkTypeBool);
88  vtkBooleanMacro(NotMask, vtkTypeBool);
90 
94  virtual void SetInput1Data(vtkDataObject* in) { this->SetInputData(0, in); }
95  virtual void SetInput2Data(vtkDataObject* in) { this->SetInputData(1, in); }
96 
97 protected:
98  vtkImageMask();
99  ~vtkImageMask() override;
100 
104  double MaskAlpha;
105 
107 
108  void ThreadedRequestData(vtkInformation* request, vtkInformationVector** inputVector,
109  vtkInformationVector* outputVector, vtkImageData*** inData, vtkImageData** outData,
110  int outExt[6], int threadId) override;
111 
112 private:
113  vtkImageMask(const vtkImageMask&) = delete;
114  void operator=(const vtkImageMask&) = delete;
115 };
116 
117 VTK_ABI_NAMESPACE_END
118 #endif
double * GetMaskedOutputValue()
Definition: vtkImageMask.h:55
void SetMaskedOutputValue(double v1, double v2, double v3)
Definition: vtkImageMask.h:47
Store vtkAlgorithm input/output information.
double * MaskedOutputValue
Definition: vtkImageMask.h:101
double MaskAlpha
Definition: vtkImageMask.h:104
void SetMaskedOutputValue(double v1, double v2)
Definition: vtkImageMask.h:40
virtual void SetInput1Data(vtkDataObject *in)
Set the two inputs to this filter.
Definition: vtkImageMask.h:94
void SetInputData(vtkDataObject *)
Assign a data object as input.
Combines a mask and an image.
Definition: vtkImageMask.h:28
int MaskedOutputValueLength
Definition: vtkImageMask.h:102
int GetMaskedOutputValueLength()
Definition: vtkImageMask.h:56
int vtkTypeBool
Definition: vtkABI.h:64
Generic filter that has one input.
void SetMaskedOutputValue(double v)
Definition: vtkImageMask.h:39
a simple class to control print indentation
Definition: vtkIndent.h:28
topologically and geometrically regular array of data
Definition: vtkImageData.h:42
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:103
virtual void SetInput2Data(vtkDataObject *in)
Definition: vtkImageMask.h:95
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:54