VTK  9.3.20240329
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
45 
46 VTK_ABI_NAMESPACE_BEGIN
47 class VTKIMAGINGCORE_EXPORT vtkImageBSplineCoefficients : public vtkThreadedImageAlgorithm
48 {
49 public:
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 
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); }
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:
131 
132  void AllocateOutputData(vtkImageData* out, vtkInformation* outInfo, int* uExtent) override;
134 
138 
140  vtkImageData* inData, vtkImageData* outData, int outExt[6], int threadId) override;
141 
148 
149 private:
151  void operator=(const vtkImageBSplineCoefficients&) = delete;
152 };
153 
154 VTK_ABI_NAMESPACE_END
155 #endif
general representation of visualization data
convert image to b-spline knots
void Evaluate(const double point[3], double *value)
Interpolate a value from the image.
const char * GetBorderModeAsString()
Set the border mode.
const char * GetOutputScalarTypeAsString()
Set the scalar type of the output.
void SetOutputScalarTypeToFloat()
Set the scalar type of the output.
vtkImageData * AllocateOutputData(vtkDataObject *out, vtkInformation *outInfo) override
Allocate the output data.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetOutputScalarTypeToDouble()
Set the scalar type of the output.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
double Evaluate(const double point[3])
Interpolate a value from the image.
int CheckBounds(const double point[3])
Check a point against the image bounds.
static vtkImageBSplineCoefficients * New()
void SetBorderModeToMirror()
Set the border mode.
void AllocateOutputData(vtkImageData *out, vtkInformation *outInfo, int *uExtent) override
Allocate the output data.
void SetBorderModeToRepeat()
Set the border mode.
void SetBorderModeToClamp()
Set the border mode.
double Evaluate(double x, double y, double z)
Interpolate a value from the image.
void ThreadedExecute(vtkImageData *inData, vtkImageData *outData, int outExt[6], int threadId) override
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Subclasses can reimplement this method to collect information from their inputs and set information f...
~vtkImageBSplineCoefficients() override
int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Subclasses can reimplement this method to translate the update extent requests from each output port ...
topologically and geometrically regular array of data
Definition: vtkImageData.h:156
a simple class to control print indentation
Definition: vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Generic filter that has one input.
@ point
Definition: vtkX3D.h:236
@ value
Definition: vtkX3D.h:220
int vtkTypeBool
Definition: vtkABI.h:64
#define VTK_IMAGE_BSPLINE_DEGREE_MAX
#define VTK_DOUBLE
Definition: vtkType.h:43
#define VTK_FLOAT
Definition: vtkType.h:42