VTK  9.3.0
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
30 #ifndef vtkImageMask_h
31 #define vtkImageMask_h
32 
33 #include "vtkImagingCoreModule.h" // For export macro
35 
36 VTK_ABI_NAMESPACE_BEGIN
37 class VTKIMAGINGCORE_EXPORT vtkImageMask : public vtkThreadedImageAlgorithm
38 {
39 public:
40  static vtkImageMask* New();
42  void PrintSelf(ostream& os, vtkIndent indent) override;
43 
47  void SetMaskedOutputValue(int num, double* v);
48  void SetMaskedOutputValue(double v) { this->SetMaskedOutputValue(1, &v); }
49  void SetMaskedOutputValue(double v1, double v2)
50  {
51  double v[2];
52  v[0] = v1;
53  v[1] = v2;
54  this->SetMaskedOutputValue(2, v);
55  }
56  void SetMaskedOutputValue(double v1, double v2, double v3)
57  {
58  double v[3];
59  v[0] = v1;
60  v[1] = v2;
61  v[2] = v3;
62  this->SetMaskedOutputValue(3, v);
63  }
64  double* GetMaskedOutputValue() { return this->MaskedOutputValue; }
65  int GetMaskedOutputValueLength() { return this->MaskedOutputValueLength; }
66 
68 
74  vtkSetClampMacro(MaskAlpha, double, 0.0, 1.0);
75  vtkGetMacro(MaskAlpha, double);
77 
82 
87 
89 
95  vtkSetMacro(NotMask, vtkTypeBool);
96  vtkGetMacro(NotMask, vtkTypeBool);
97  vtkBooleanMacro(NotMask, vtkTypeBool);
99 
103  virtual void SetInput1Data(vtkDataObject* in) { this->SetInputData(0, in); }
104  virtual void SetInput2Data(vtkDataObject* in) { this->SetInputData(1, in); }
105 
106 protected:
108  ~vtkImageMask() override;
109 
113  double MaskAlpha;
114 
116 
118  vtkInformationVector* outputVector, vtkImageData*** inData, vtkImageData** outData,
119  int outExt[6], int threadId) override;
120 
121 private:
122  vtkImageMask(const vtkImageMask&) = delete;
123  void operator=(const vtkImageMask&) = delete;
124 };
125 
126 VTK_ABI_NAMESPACE_END
127 #endif
general representation of visualization data
Definition: vtkDataObject.h:64
void SetInputData(vtkDataObject *)
Assign a data object as input.
topologically and geometrically regular array of data
Definition: vtkImageData.h:52
Combines a mask and an image.
Definition: vtkImageMask.h:38
int MaskedOutputValueLength
Definition: vtkImageMask.h:111
double MaskAlpha
Definition: vtkImageMask.h:113
~vtkImageMask() override
vtkTypeBool NotMask
Definition: vtkImageMask.h:112
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int GetMaskedOutputValueLength()
Definition: vtkImageMask.h:65
static vtkImageMask * New()
double * GetMaskedOutputValue()
Definition: vtkImageMask.h:64
void SetImageInputData(vtkImageData *in)
Set the input to be masked.
double * MaskedOutputValue
Definition: vtkImageMask.h:110
void SetMaskInputData(vtkImageData *in)
Set the mask to be used.
virtual void SetInput2Data(vtkDataObject *in)
Definition: vtkImageMask.h:104
virtual void SetInput1Data(vtkDataObject *in)
Set the two inputs to this filter.
Definition: vtkImageMask.h:103
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Subclasses can reimplement this method to collect information from their inputs and set information f...
void SetMaskedOutputValue(double v1, double v2)
Definition: vtkImageMask.h:49
void SetMaskedOutputValue(double v1, double v2, double v3)
Definition: vtkImageMask.h:56
void SetMaskedOutputValue(int num, double *v)
SetGet the value of the output pixel replaced by mask.
void ThreadedRequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector, vtkImageData ***inData, vtkImageData **outData, int outExt[6], int threadId) override
If the subclass does not define an Execute method, then the task will be broken up,...
void SetMaskedOutputValue(double v)
Definition: vtkImageMask.h:48
a simple class to control print indentation
Definition: vtkIndent.h:38
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Generic filter that has one input.
int vtkTypeBool
Definition: vtkABI.h:64