VTK  9.2.6
vtkImageBSplineCoefficients.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkImageBSplineCoefficients.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 =========================================================================*/
51 #ifndef vtkImageBSplineCoefficients_h
52 #define vtkImageBSplineCoefficients_h
53 
54 #include "vtkImageBSplineInterpolator.h" // for constants
55 #include "vtkImagingCoreModule.h" // For export macro
57 
58 class VTKIMAGINGCORE_EXPORT vtkImageBSplineCoefficients : public vtkThreadedImageAlgorithm
59 {
60 public:
63 
64  void PrintSelf(ostream& os, vtkIndent indent) override;
65 
67 
71  vtkSetClampMacro(SplineDegree, int, 0, VTK_IMAGE_BSPLINE_DEGREE_MAX);
72  vtkGetMacro(SplineDegree, int);
74 
76 
86  void SetBorderModeToClamp() { this->SetBorderMode(VTK_IMAGE_BORDER_CLAMP); }
87  void SetBorderModeToRepeat() { this->SetBorderMode(VTK_IMAGE_BORDER_REPEAT); }
88  void SetBorderModeToMirror() { this->SetBorderMode(VTK_IMAGE_BORDER_MIRROR); }
89  vtkGetMacro(BorderMode, vtkImageBorderMode);
90  const char* GetBorderModeAsString();
92 
94 
99  vtkSetClampMacro(OutputScalarType, int, VTK_FLOAT, VTK_DOUBLE);
100  vtkGetMacro(OutputScalarType, int);
101  void SetOutputScalarTypeToFloat() { this->SetOutputScalarType(VTK_FLOAT); }
102  void SetOutputScalarTypeToDouble() { this->SetOutputScalarType(VTK_DOUBLE); }
103  const char* GetOutputScalarTypeAsString();
105 
107 
114  vtkSetMacro(Bypass, vtkTypeBool);
115  vtkBooleanMacro(Bypass, vtkTypeBool);
116  vtkGetMacro(Bypass, vtkTypeBool);
118 
125  int CheckBounds(const double point[3]);
126 
128 
134  void Evaluate(const double point[3], double* value);
135  double Evaluate(double x, double y, double z);
136  double Evaluate(const double point[3]) { return this->Evaluate(point[0], point[1], point[2]); }
138 
139 protected:
141  ~vtkImageBSplineCoefficients() override;
142 
143  void AllocateOutputData(vtkImageData* out, vtkInformation* outInfo, int* uExtent) override;
145 
149 
150  void ThreadedExecute(
151  vtkImageData* inData, vtkImageData* outData, int outExt[6], int threadId) override;
152 
159 
160 private:
162  void operator=(const vtkImageBSplineCoefficients&) = delete;
163 };
164 
165 #endif
void SetOutputScalarTypeToFloat()
Set the scalar type of the output.
void SetBorderModeToRepeat()
Set the border mode.
virtual void ThreadedExecute(vtkImageData *inData, vtkImageData *outData, int extent[6], int threadId)
double Evaluate(const double point[3])
Interpolate a value from the image.
Store vtkAlgorithm input/output information.
int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
This is called by the superclass.
convert image to b-spline knots
void SetBorderModeToClamp()
Set the border mode.
void SetOutputScalarTypeToDouble()
Set the scalar type of the output.
#define VTK_IMAGE_BSPLINE_DEGREE_MAX
virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
Subclasses can reimplement this method to translate the update extent requests from each output port ...
virtual void AllocateOutputData(vtkImageData *out, vtkInformation *outInfo, int *uExtent)
Allocate the output data.
int vtkTypeBool
Definition: vtkABI.h:69
#define VTK_DOUBLE
Definition: vtkType.h:55
Generic filter that has one input.
void SetBorderModeToMirror()
Set the border mode.
#define VTK_FLOAT
Definition: vtkType.h:54
a simple class to control print indentation
Definition: vtkIndent.h:39
topologically and geometrically regular array of data
Definition: vtkImageData.h:53
virtual int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
Subclasses can reimplement this method to collect information from their inputs and set information f...
Store zero or more vtkInformation instances.
static vtkAlgorithm * New()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
general representation of visualization data
Definition: vtkDataObject.h:65