VTK
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);
48  this->SetOrientation(0); };
50  this->SetOrientation(1); };
52  this->SetOrientation(2); };
53  vtkGetMacro(Orientation, int);
55 
57 
61  vtkSetVector2Macro(SliceRange, int);
62  vtkGetVector2Macro(SliceRange, int);
64 
66 
70  vtkSetClampMacro(Operation, int, VTK_IMAGE_SLAB_MIN, VTK_IMAGE_SLAB_SUM);
72  this->SetOperation(VTK_IMAGE_SLAB_MIN); };
74  this->SetOperation(VTK_IMAGE_SLAB_MAX); };
76  this->SetOperation(VTK_IMAGE_SLAB_MEAN); };
78  this->SetOperation(VTK_IMAGE_SLAB_SUM); };
79  vtkGetMacro(Operation, int);
80  const char *GetOperationAsString();
82 
84 
90  vtkSetMacro(TrapezoidIntegration, vtkTypeBool);
91  vtkBooleanMacro(TrapezoidIntegration, vtkTypeBool);
92  vtkGetMacro(TrapezoidIntegration, vtkTypeBool);
94 
96 
103  vtkSetMacro(MultiSliceOutput, vtkTypeBool);
104  vtkBooleanMacro(MultiSliceOutput, vtkTypeBool);
105  vtkGetMacro(MultiSliceOutput, vtkTypeBool);
107 
109 
116  this->SetOutputScalarType(VTK_FLOAT); };
118  this->SetOutputScalarType(VTK_DOUBLE); };
120  this->SetOutputScalarType(0); };
121  vtkGetMacro(OutputScalarType, int);
123 
124 protected:
125  vtkImageSlab();
126  ~vtkImageSlab() override;
127 
129  vtkInformationVector *) override;
131  vtkInformationVector *) override;
132  void ThreadedRequestData(vtkInformation *request,
133  vtkInformationVector **inputVector,
134  vtkInformationVector *outputVector,
135  vtkImageData ***inData,
136  vtkImageData **outData, int ext[6], int id) override;
137 
138  vtkSetMacro(OutputScalarType, int);
139 
140  int Operation;
142  int SliceRange[2];
146 
147 private:
148  vtkImageSlab(const vtkImageSlab&) = delete;
149  void operator=(const vtkImageSlab&) = delete;
150 };
151 
152 #endif
vtkThreadedImageAlgorithm::ThreadedRequestData
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,...
vtkImageSlab::OutputScalarType
int OutputScalarType
Definition: vtkImageSlab.h:143
VTK_IMAGE_SLAB_MAX
#define VTK_IMAGE_SLAB_MAX
Definition: vtkSystemIncludes.h:113
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:35
vtkImageSlab::SetOutputScalarTypeToInputScalarType
void SetOutputScalarTypeToInputScalarType()
Definition: vtkImageSlab.h:119
vtkImageSlab::MultiSliceOutput
vtkTypeBool MultiSliceOutput
Definition: vtkImageSlab.h:144
vtkThreadedImageAlgorithm
Generic filter that has one input.
Definition: vtkThreadedImageAlgorithm.h:37
vtkImageSlab::SetOrientationToZ
void SetOrientationToZ()
Definition: vtkImageSlab.h:51
vtkThreadedImageAlgorithm.h
VTK_IMAGE_SLAB_MEAN
#define VTK_IMAGE_SLAB_MEAN
Definition: vtkSystemIncludes.h:114
vtkImageSlab::TrapezoidIntegration
vtkTypeBool TrapezoidIntegration
Definition: vtkImageSlab.h:145
vtkImageSlab
combine image slices to form a slab image
Definition: vtkImageSlab.h:34
vtkImageAlgorithm::RequestUpdateExtent
virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
Subclasses can reimplement this method to translate the update extent requests from each output port ...
vtkImageAlgorithm::RequestInformation
virtual int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
Subclasses can reimplement this method to collect information from their inputs and set information f...
vtkImageSlab::SetOutputScalarTypeToFloat
void SetOutputScalarTypeToFloat()
Set the output scalar type to float or double, to avoid potential overflow when doing a summation ope...
Definition: vtkImageSlab.h:115
VTK_IMAGE_SLAB_MIN
#define VTK_IMAGE_SLAB_MIN
Definition: vtkSystemIncludes.h:112
vtkThreadedImageAlgorithm::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkImageSlab::SetOperationToMean
void SetOperationToMean()
Definition: vtkImageSlab.h:75
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:39
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
VTK_FLOAT
#define VTK_FLOAT
Definition: vtkType.h:58
VTK_DOUBLE
#define VTK_DOUBLE
Definition: vtkType.h:59
vtkImageSlab::SetOperationToMax
void SetOperationToMax()
Definition: vtkImageSlab.h:73
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:80
vtkImageSlab::SetOrientationToX
void SetOrientationToX()
Definition: vtkImageSlab.h:47
vtkImageSlab::SetOrientationToY
void SetOrientationToY()
Definition: vtkImageSlab.h:49
vtkAlgorithm::New
static vtkAlgorithm * New()
vtkImageSlab::Operation
int Operation
Definition: vtkImageSlab.h:138
vtkImageSlab::SetOperationToSum
void SetOperationToSum()
Definition: vtkImageSlab.h:77
VTK_IMAGE_SLAB_SUM
#define VTK_IMAGE_SLAB_SUM
Definition: vtkSystemIncludes.h:115
vtkImageSlab::SetOperationToMin
void SetOperationToMin()
Definition: vtkImageSlab.h:71
vtkImageSlab::SetOutputScalarTypeToDouble
void SetOutputScalarTypeToDouble()
Definition: vtkImageSlab.h:117
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkImageSlab::Orientation
int Orientation
Definition: vtkImageSlab.h:141