VTK  9.3.20240418
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
40 #ifndef vtkImageMask_h
41 #define vtkImageMask_h
42 
43 #include "vtkImagingCoreModule.h" // For export macro
45 
46 VTK_ABI_NAMESPACE_BEGIN
47 class VTKIMAGINGCORE_EXPORT vtkImageMask : public vtkThreadedImageAlgorithm
48 {
49 public:
50  static vtkImageMask* New();
52  void PrintSelf(ostream& os, vtkIndent indent) override;
53 
57  void SetMaskedOutputValue(int num, double* v);
58  void SetMaskedOutputValue(double v) { this->SetMaskedOutputValue(1, &v); }
59  void SetMaskedOutputValue(double v1, double v2)
60  {
61  double v[2];
62  v[0] = v1;
63  v[1] = v2;
64  this->SetMaskedOutputValue(2, v);
65  }
66  void SetMaskedOutputValue(double v1, double v2, double v3)
67  {
68  double v[3];
69  v[0] = v1;
70  v[1] = v2;
71  v[2] = v3;
72  this->SetMaskedOutputValue(3, v);
73  }
74  double* GetMaskedOutputValue() { return this->MaskedOutputValue; }
75  int GetMaskedOutputValueLength() { return this->MaskedOutputValueLength; }
76 
78 
84  vtkSetClampMacro(MaskAlpha, double, 0.0, 1.0);
85  vtkGetMacro(MaskAlpha, double);
87 
92 
97 
99 
105  vtkSetMacro(NotMask, vtkTypeBool);
106  vtkGetMacro(NotMask, vtkTypeBool);
107  vtkBooleanMacro(NotMask, vtkTypeBool);
109 
113  virtual void SetInput1Data(vtkDataObject* in) { this->SetInputData(0, in); }
114  virtual void SetInput2Data(vtkDataObject* in) { this->SetInputData(1, in); }
115 
116 protected:
118  ~vtkImageMask() override;
119 
123  double MaskAlpha;
124 
126 
128  vtkInformationVector* outputVector, vtkImageData*** inData, vtkImageData** outData,
129  int outExt[6], int threadId) override;
130 
131 private:
132  vtkImageMask(const vtkImageMask&) = delete;
133  void operator=(const vtkImageMask&) = delete;
134 };
135 
136 VTK_ABI_NAMESPACE_END
137 #endif
general representation of visualization data
void SetInputData(vtkDataObject *)
Assign a data object as input.
topologically and geometrically regular array of data
Definition: vtkImageData.h:156
Combines a mask and an image.
Definition: vtkImageMask.h:48
int MaskedOutputValueLength
Definition: vtkImageMask.h:121
double MaskAlpha
Definition: vtkImageMask.h:123
~vtkImageMask() override
vtkTypeBool NotMask
Definition: vtkImageMask.h:122
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int GetMaskedOutputValueLength()
Definition: vtkImageMask.h:75
static vtkImageMask * New()
double * GetMaskedOutputValue()
Definition: vtkImageMask.h:74
void SetImageInputData(vtkImageData *in)
Set the input to be masked.
double * MaskedOutputValue
Definition: vtkImageMask.h:120
void SetMaskInputData(vtkImageData *in)
Set the mask to be used.
virtual void SetInput2Data(vtkDataObject *in)
Definition: vtkImageMask.h:114
virtual void SetInput1Data(vtkDataObject *in)
Set the two inputs to this filter.
Definition: vtkImageMask.h:113
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:59
void SetMaskedOutputValue(double v1, double v2, double v3)
Definition: vtkImageMask.h:66
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:58
a simple class to control print indentation
Definition: vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Generic filter that has one input.
int vtkTypeBool
Definition: vtkABI.h:64