VTK: Imaging/Core/vtkImageBSplineCoefficients.h Source File

| VTK 9.3.1

vtkImageBSplineCoefficients.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
39 #ifndef vtkImageBSplineCoefficients_h
40 #define vtkImageBSplineCoefficients_h
41
42 #include "vtkImageBSplineInterpolator.h" // for constants
43 #include "vtkImagingCoreModule.h" // For export macro
44 #include "vtkThreadedImageAlgorithm.h"
45
46 VTK_ABI_NAMESPACE_BEGIN
47 class VTKIMAGINGCORE_EXPORT vtkImageBSplineCoefficients : public vtkThreadedImageAlgorithm
48 {
49 public:
50 static vtkImageBSplineCoefficients* New();
51 vtkTypeMacro(vtkImageBSplineCoefficients, vtkThreadedImageAlgorithm);
52
53 void PrintSelf(ostream& os, vtkIndent indent) override;
54
56
60 vtkSetClampMacro(SplineDegree, int, 0, VTK_IMAGE_BSPLINE_DEGREE_MAX);
61 vtkGetMacro(SplineDegree, int);
63
65
74 vtkSetClampMacro(BorderMode, vtkImageBorderMode, VTK_IMAGE_BORDER_CLAMP, VTK_IMAGE_BORDER_MIRROR);
75 void SetBorderModeToClamp() { this->SetBorderMode(VTK_IMAGE_BORDER_CLAMP); }
76 void SetBorderModeToRepeat() { this->SetBorderMode(VTK_IMAGE_BORDER_REPEAT); }
77 void SetBorderModeToMirror() { this->SetBorderMode(VTK_IMAGE_BORDER_MIRROR); }
78 vtkGetMacro(BorderMode, vtkImageBorderMode);
79 const char* GetBorderModeAsString();
81
83
88 vtkSetClampMacro(OutputScalarType, int, VTK_FLOAT, VTK_DOUBLE);
89 vtkGetMacro(OutputScalarType, int);
90 void SetOutputScalarTypeToFloat() { this->SetOutputScalarType(VTK_FLOAT); }
91 void SetOutputScalarTypeToDouble() { this->SetOutputScalarType(VTK_DOUBLE); }
92 const char* GetOutputScalarTypeAsString();
94
96
103 vtkSetMacro(Bypass, vtkTypeBool);
104 vtkBooleanMacro(Bypass, vtkTypeBool);
105 vtkGetMacro(Bypass, vtkTypeBool);
107
114 int CheckBounds(const double point[3]);
115
117
123 void Evaluate(const double point[3], double* value);
124 double Evaluate(double x, double y, double z);
125 double Evaluate(const double point[3]) { return this->Evaluate(point[0], point[1], point[2]); }
127
128 protected:
129 vtkImageBSplineCoefficients();
130 ~vtkImageBSplineCoefficients() override;
131
132 void AllocateOutputData(vtkImageData* out, vtkInformation* outInfo, int* uExtent) override;
133 vtkImageData* AllocateOutputData(vtkDataObject* out, vtkInformation* outInfo) override;
134
135 int RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override;
136 int RequestInformation(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override;
137 int RequestUpdateExtent(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override;
138
139 void ThreadedExecute(
140 vtkImageData* inData, vtkImageData* outData, int outExt[6], int threadId) override;
141
142 int SplineDegree;
143 vtkImageBorderMode BorderMode;
144 int OutputScalarType;
145 vtkTypeBool Bypass;
146 int DataWasPassed;
147 int Iteration;
148
149 private:
150 vtkImageBSplineCoefficients(const vtkImageBSplineCoefficients&) = delete;
151 void operator=(const vtkImageBSplineCoefficients&) = delete;
152 };
153
154 VTK_ABI_NAMESPACE_END
155 #endif
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:64
vtkImageBSplineCoefficients
convert image to b-spline knots
Definition: vtkImageBSplineCoefficients.h:48
vtkImageBSplineCoefficients::BorderMode
vtkImageBorderMode BorderMode
Definition: vtkImageBSplineCoefficients.h:143
vtkImageBSplineCoefficients::Evaluate
void Evaluate(const double point[3], double *value)
Interpolate a value from the image.
vtkImageBSplineCoefficients::GetBorderModeAsString
const char * GetBorderModeAsString()
Set the border mode.
vtkImageBSplineCoefficients::GetOutputScalarTypeAsString
const char * GetOutputScalarTypeAsString()
Set the scalar type of the output.
vtkImageBSplineCoefficients::vtkImageBSplineCoefficients
vtkImageBSplineCoefficients()
vtkImageBSplineCoefficients::SetOutputScalarTypeToFloat
void SetOutputScalarTypeToFloat()
Set the scalar type of the output.
Definition: vtkImageBSplineCoefficients.h:90
vtkImageBSplineCoefficients::AllocateOutputData
vtkImageData * AllocateOutputData(vtkDataObject *out, vtkInformation *outInfo) override
Allocate the output data.
vtkImageBSplineCoefficients::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkImageBSplineCoefficients::SetOutputScalarTypeToDouble
void SetOutputScalarTypeToDouble()
Set the scalar type of the output.
Definition: vtkImageBSplineCoefficients.h:91
vtkImageBSplineCoefficients::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
vtkImageBSplineCoefficients::Bypass
vtkTypeBool Bypass
Definition: vtkImageBSplineCoefficients.h:145
vtkImageBSplineCoefficients::Evaluate
double Evaluate(const double point[3])
Interpolate a value from the image.
Definition: vtkImageBSplineCoefficients.h:125
vtkImageBSplineCoefficients::CheckBounds
int CheckBounds(const double point[3])
Check a point against the image bounds.
vtkImageBSplineCoefficients::DataWasPassed
int DataWasPassed
Definition: vtkImageBSplineCoefficients.h:146
vtkImageBSplineCoefficients::OutputScalarType
int OutputScalarType
Definition: vtkImageBSplineCoefficients.h:144
vtkImageBSplineCoefficients::New
static vtkImageBSplineCoefficients * New()
vtkImageBSplineCoefficients::SetBorderModeToMirror
void SetBorderModeToMirror()
Set the border mode.
Definition: vtkImageBSplineCoefficients.h:77
vtkImageBSplineCoefficients::Iteration
int Iteration
Definition: vtkImageBSplineCoefficients.h:147
vtkImageBSplineCoefficients::AllocateOutputData
void AllocateOutputData(vtkImageData *out, vtkInformation *outInfo, int *uExtent) override
Allocate the output data.
vtkImageBSplineCoefficients::SetBorderModeToRepeat
void SetBorderModeToRepeat()
Set the border mode.
Definition: vtkImageBSplineCoefficients.h:76
vtkImageBSplineCoefficients::SplineDegree
int SplineDegree
Definition: vtkImageBSplineCoefficients.h:142
vtkImageBSplineCoefficients::SetBorderModeToClamp
void SetBorderModeToClamp()
Set the border mode.
Definition: vtkImageBSplineCoefficients.h:75
vtkImageBSplineCoefficients::Evaluate
double Evaluate(double x, double y, double z)
Interpolate a value from the image.
vtkImageBSplineCoefficients::ThreadedExecute
void ThreadedExecute(vtkImageData *inData, vtkImageData *outData, int outExt[6], int threadId) override
vtkImageBSplineCoefficients::RequestInformation
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Subclasses can reimplement this method to collect information from their inputs and set information f...
vtkImageBSplineCoefficients::~vtkImageBSplineCoefficients
~vtkImageBSplineCoefficients() override
vtkImageBSplineCoefficients::RequestUpdateExtent
int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Subclasses can reimplement this method to translate the update extent requests from each output port ...
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:52
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:40
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:72
vtkThreadedImageAlgorithm
Generic filter that has one input.
Definition: vtkThreadedImageAlgorithm.h:34
vtkX3D::point
@ point
Definition: vtkX3D.h:236
vtkX3D::value
@ value
Definition: vtkX3D.h:220
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:64
vtkImageBorderMode
vtkImageBorderMode
Definition: vtkAbstractImageInterpolator.h:28
VTK_IMAGE_BORDER_REPEAT
@ VTK_IMAGE_BORDER_REPEAT
Definition: vtkAbstractImageInterpolator.h:30
VTK_IMAGE_BORDER_CLAMP
@ VTK_IMAGE_BORDER_CLAMP
Definition: vtkAbstractImageInterpolator.h:29
VTK_IMAGE_BORDER_MIRROR
@ VTK_IMAGE_BORDER_MIRROR
Definition: vtkAbstractImageInterpolator.h:31
vtkImageBSplineInterpolator.h
VTK_IMAGE_BSPLINE_DEGREE_MAX
#define VTK_IMAGE_BSPLINE_DEGREE_MAX
Definition: vtkImageBSplineInterpolator.h:37
vtkThreadedImageAlgorithm.h
VTK_DOUBLE
#define VTK_DOUBLE
Definition: vtkType.h:43
VTK_FLOAT
#define VTK_FLOAT
Definition: vtkType.h:42