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