VTK  9.3.1
vtkImageSlab.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
19 #ifndef vtkImageSlab_h
20 #define vtkImageSlab_h
21 
22 #include "vtkImagingGeneralModule.h" // For export macro
24 
25 VTK_ABI_NAMESPACE_BEGIN
26 class VTKIMAGINGGENERAL_EXPORT vtkImageSlab : public vtkThreadedImageAlgorithm
27 {
28 public:
29  static vtkImageSlab* New();
31  void PrintSelf(ostream& os, vtkIndent indent) override;
32 
34 
38  vtkSetClampMacro(Orientation, int, 0, 2);
39  void SetOrientationToX() { this->SetOrientation(0); }
40  void SetOrientationToY() { this->SetOrientation(1); }
41  void SetOrientationToZ() { this->SetOrientation(2); }
42  vtkGetMacro(Orientation, int);
44 
46 
50  vtkSetVector2Macro(SliceRange, int);
51  vtkGetVector2Macro(SliceRange, int);
53 
55 
59  vtkSetClampMacro(Operation, int, VTK_IMAGE_SLAB_MIN, VTK_IMAGE_SLAB_SUM);
60  void SetOperationToMin() { this->SetOperation(VTK_IMAGE_SLAB_MIN); }
61  void SetOperationToMax() { this->SetOperation(VTK_IMAGE_SLAB_MAX); }
62  void SetOperationToMean() { this->SetOperation(VTK_IMAGE_SLAB_MEAN); }
63  void SetOperationToSum() { this->SetOperation(VTK_IMAGE_SLAB_SUM); }
64  vtkGetMacro(Operation, int);
65  const char* GetOperationAsString();
67 
69 
75  vtkSetMacro(TrapezoidIntegration, vtkTypeBool);
76  vtkBooleanMacro(TrapezoidIntegration, vtkTypeBool);
77  vtkGetMacro(TrapezoidIntegration, vtkTypeBool);
79 
81 
88  vtkSetMacro(MultiSliceOutput, vtkTypeBool);
89  vtkBooleanMacro(MultiSliceOutput, vtkTypeBool);
90  vtkGetMacro(MultiSliceOutput, vtkTypeBool);
92 
94 
100  void SetOutputScalarTypeToFloat() { this->SetOutputScalarType(VTK_FLOAT); }
101  void SetOutputScalarTypeToDouble() { this->SetOutputScalarType(VTK_DOUBLE); }
102  void SetOutputScalarTypeToInputScalarType() { this->SetOutputScalarType(0); }
103  vtkGetMacro(OutputScalarType, int);
105 
106 protected:
107  vtkImageSlab();
108  ~vtkImageSlab() override;
109 
112  void ThreadedRequestData(vtkInformation* request, vtkInformationVector** inputVector,
113  vtkInformationVector* outputVector, vtkImageData*** inData, vtkImageData** outData, int ext[6],
114  int id) override;
115 
116  vtkSetMacro(OutputScalarType, int);
117 
118  int Operation;
120  int SliceRange[2];
124 
125 private:
126  vtkImageSlab(const vtkImageSlab&) = delete;
127  void operator=(const vtkImageSlab&) = delete;
128 };
129 
130 VTK_ABI_NAMESPACE_END
131 #endif
void SetOperationToMin()
Set the operation to use when combining slices.
Definition: vtkImageSlab.h:60
#define VTK_IMAGE_SLAB_MAX
void SetOperationToMean()
Set the operation to use when combining slices.
Definition: vtkImageSlab.h:62
#define VTK_IMAGE_SLAB_MIN
Store vtkAlgorithm input/output information.
void SetOperationToMax()
Set the operation to use when combining slices.
Definition: vtkImageSlab.h:61
void SetOrientationToZ()
Set the slice direction: zero for x, 1 for y, 2 for z.
Definition: vtkImageSlab.h:41
#define VTK_IMAGE_SLAB_SUM
#define VTK_IMAGE_SLAB_MEAN
void SetOrientationToY()
Set the slice direction: zero for x, 1 for y, 2 for z.
Definition: vtkImageSlab.h:40
void SetOperationToSum()
Set the operation to use when combining slices.
Definition: vtkImageSlab.h:63
vtkTypeBool TrapezoidIntegration
Definition: vtkImageSlab.h:123
void SetOrientationToX()
Set the slice direction: zero for x, 1 for y, 2 for z.
Definition: vtkImageSlab.h:39
void SetOutputScalarTypeToFloat()
Set the output scalar type to float or double, to avoid potential overflow when doing a summation ope...
Definition: vtkImageSlab.h:100
vtkTypeBool MultiSliceOutput
Definition: vtkImageSlab.h:122
virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
Subclasses can reimplement this method to translate the update extent requests from each output port ...
int vtkTypeBool
Definition: vtkABI.h:64
#define VTK_DOUBLE
Definition: vtkType.h:43
Generic filter that has one input.
combine image slices to form a slab image
Definition: vtkImageSlab.h:26
#define VTK_FLOAT
Definition: vtkType.h:42
void SetOutputScalarTypeToDouble()
Set the output scalar type to float or double, to avoid potential overflow when doing a summation ope...
Definition: vtkImageSlab.h:101
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...
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.
void SetOutputScalarTypeToInputScalarType()
Set the output scalar type to float or double, to avoid potential overflow when doing a summation ope...
Definition: vtkImageSlab.h:102
Store zero or more vtkInformation instances.
int OutputScalarType
Definition: vtkImageSlab.h:121
static vtkAlgorithm * New()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.