VTK  9.0.1
vtkImageSlab.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkImageSlab.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 =========================================================================*/
28 #ifndef vtkImageSlab_h
29 #define vtkImageSlab_h
30 
31 #include "vtkImagingGeneralModule.h" // For export macro
33 
34 class VTKIMAGINGGENERAL_EXPORT vtkImageSlab : public vtkThreadedImageAlgorithm
35 {
36 public:
37  static vtkImageSlab* New();
39  void PrintSelf(ostream& os, vtkIndent indent) override;
40 
42 
46  vtkSetClampMacro(Orientation, int, 0, 2);
47  void SetOrientationToX() { this->SetOrientation(0); }
48  void SetOrientationToY() { this->SetOrientation(1); }
49  void SetOrientationToZ() { this->SetOrientation(2); }
50  vtkGetMacro(Orientation, int);
52 
54 
58  vtkSetVector2Macro(SliceRange, int);
59  vtkGetVector2Macro(SliceRange, int);
61 
63 
67  vtkSetClampMacro(Operation, int, VTK_IMAGE_SLAB_MIN, VTK_IMAGE_SLAB_SUM);
68  void SetOperationToMin() { this->SetOperation(VTK_IMAGE_SLAB_MIN); }
69  void SetOperationToMax() { this->SetOperation(VTK_IMAGE_SLAB_MAX); }
70  void SetOperationToMean() { this->SetOperation(VTK_IMAGE_SLAB_MEAN); }
71  void SetOperationToSum() { this->SetOperation(VTK_IMAGE_SLAB_SUM); }
72  vtkGetMacro(Operation, int);
73  const char* GetOperationAsString();
75 
77 
83  vtkSetMacro(TrapezoidIntegration, vtkTypeBool);
84  vtkBooleanMacro(TrapezoidIntegration, vtkTypeBool);
85  vtkGetMacro(TrapezoidIntegration, vtkTypeBool);
87 
89 
96  vtkSetMacro(MultiSliceOutput, vtkTypeBool);
97  vtkBooleanMacro(MultiSliceOutput, vtkTypeBool);
98  vtkGetMacro(MultiSliceOutput, vtkTypeBool);
100 
102 
108  void SetOutputScalarTypeToFloat() { this->SetOutputScalarType(VTK_FLOAT); }
109  void SetOutputScalarTypeToDouble() { this->SetOutputScalarType(VTK_DOUBLE); }
110  void SetOutputScalarTypeToInputScalarType() { this->SetOutputScalarType(0); }
111  vtkGetMacro(OutputScalarType, int);
113 
114 protected:
115  vtkImageSlab();
116  ~vtkImageSlab() override;
117 
120  void ThreadedRequestData(vtkInformation* request, vtkInformationVector** inputVector,
121  vtkInformationVector* outputVector, vtkImageData*** inData, vtkImageData** outData, int ext[6],
122  int id) override;
123 
124  vtkSetMacro(OutputScalarType, int);
125 
126  int Operation;
128  int SliceRange[2];
132 
133 private:
134  vtkImageSlab(const vtkImageSlab&) = delete;
135  void operator=(const vtkImageSlab&) = delete;
136 };
137 
138 #endif
void SetOperationToMin()
Set the operation to use when combining slices.
Definition: vtkImageSlab.h:68
#define VTK_IMAGE_SLAB_MAX
void SetOperationToMean()
Set the operation to use when combining slices.
Definition: vtkImageSlab.h:70
#define VTK_IMAGE_SLAB_MIN
Store vtkAlgorithm input/output information.
void SetOperationToMax()
Set the operation to use when combining slices.
Definition: vtkImageSlab.h:69
void SetOrientationToZ()
Set the slice direction: zero for x, 1 for y, 2 for z.
Definition: vtkImageSlab.h:49
#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:48
void SetOperationToSum()
Set the operation to use when combining slices.
Definition: vtkImageSlab.h:71
vtkTypeBool TrapezoidIntegration
Definition: vtkImageSlab.h:131
void SetOrientationToX()
Set the slice direction: zero for x, 1 for y, 2 for z.
Definition: vtkImageSlab.h:47
void SetOutputScalarTypeToFloat()
Set the output scalar type to float or double, to avoid potential overflow when doing a summation ope...
Definition: vtkImageSlab.h:108
vtkTypeBool MultiSliceOutput
Definition: vtkImageSlab.h:130
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:69
#define VTK_DOUBLE
Definition: vtkType.h:53
Generic filter that has one input.
combine image slices to form a slab image
Definition: vtkImageSlab.h:34
#define VTK_FLOAT
Definition: vtkType.h:52
void SetOutputScalarTypeToDouble()
Set the output scalar type to float or double, to avoid potential overflow when doing a summation ope...
Definition: vtkImageSlab.h:109
a simple class to control print indentation
Definition: vtkIndent.h:33
topologically and geometrically regular array of data
Definition: vtkImageData.h:41
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:110
Store zero or more vtkInformation instances.
int OutputScalarType
Definition: vtkImageSlab.h:129
static vtkAlgorithm * New()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.