VTK  9.1.0
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 =========================================================================*/
49 #ifndef vtkImageMask_h
50 #define vtkImageMask_h
51 
52 #include "vtkImagingCoreModule.h" // For export macro
54 
55 class VTKIMAGINGCORE_EXPORT vtkImageMask : public vtkThreadedImageAlgorithm
56 {
57 public:
58  static vtkImageMask* New();
60  void PrintSelf(ostream& os, vtkIndent indent) override;
61 
65  void SetMaskedOutputValue(int num, double* v);
66  void SetMaskedOutputValue(double v) { this->SetMaskedOutputValue(1, &v); }
67  void SetMaskedOutputValue(double v1, double v2)
68  {
69  double v[2];
70  v[0] = v1;
71  v[1] = v2;
72  this->SetMaskedOutputValue(2, v);
73  }
74  void SetMaskedOutputValue(double v1, double v2, double v3)
75  {
76  double v[3];
77  v[0] = v1;
78  v[1] = v2;
79  v[2] = v3;
80  this->SetMaskedOutputValue(3, v);
81  }
82  double* GetMaskedOutputValue() { return this->MaskedOutputValue; }
83  int GetMaskedOutputValueLength() { return this->MaskedOutputValueLength; }
84 
86 
92  vtkSetClampMacro(MaskAlpha, double, 0.0, 1.0);
93  vtkGetMacro(MaskAlpha, double);
95 
100 
105 
107 
113  vtkSetMacro(NotMask, vtkTypeBool);
114  vtkGetMacro(NotMask, vtkTypeBool);
115  vtkBooleanMacro(NotMask, vtkTypeBool);
117 
121  virtual void SetInput1Data(vtkDataObject* in) { this->SetInputData(0, in); }
122  virtual void SetInput2Data(vtkDataObject* in) { this->SetInputData(1, in); }
123 
124 protected:
126  ~vtkImageMask() override;
127 
131  double MaskAlpha;
132 
134 
136  vtkInformationVector* outputVector, vtkImageData*** inData, vtkImageData** outData,
137  int outExt[6], int threadId) override;
138 
139 private:
140  vtkImageMask(const vtkImageMask&) = delete;
141  void operator=(const vtkImageMask&) = delete;
142 };
143 
144 #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:157
Combines a mask and an image.
Definition: vtkImageMask.h:56
int MaskedOutputValueLength
Definition: vtkImageMask.h:129
double MaskAlpha
Definition: vtkImageMask.h:131
~vtkImageMask() override
vtkTypeBool NotMask
Definition: vtkImageMask.h:130
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int GetMaskedOutputValueLength()
Definition: vtkImageMask.h:83
static vtkImageMask * New()
double * GetMaskedOutputValue()
Definition: vtkImageMask.h:82
void SetImageInputData(vtkImageData *in)
Set the input to be masked.
double * MaskedOutputValue
Definition: vtkImageMask.h:128
void SetMaskInputData(vtkImageData *in)
Set the mask to be used.
virtual void SetInput2Data(vtkDataObject *in)
Definition: vtkImageMask.h:122
virtual void SetInput1Data(vtkDataObject *in)
Set the two inputs to this filter.
Definition: vtkImageMask.h:121
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:67
void SetMaskedOutputValue(double v1, double v2, double v3)
Definition: vtkImageMask.h:74
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:66
a simple class to control print indentation
Definition: vtkIndent.h:113
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Generic filter that has one input.
int vtkTypeBool
Definition: vtkABI.h:69