This is a copy/paste from vtkAbstractInterpolator::Update() with the assignment of the data array's pointer removed.
| 870 | // This is a copy/paste from vtkAbstractInterpolator::Update() with the |
| 871 | // assignment of the data array's pointer removed. |
| 872 | void vtkGenericImageInterpolator::Update() |
| 873 | { |
| 874 | vtkDataArray* scalars = this->Scalars; |
| 875 | |
| 876 | // check for scalars |
| 877 | if (!scalars) |
| 878 | { |
| 879 | this->InterpolationInfo->Pointer = nullptr; |
| 880 | this->InterpolationInfo->NumberOfComponents = 1; |
| 881 | |
| 882 | this->InterpolationInfo->Array = nullptr; |
| 883 | this->InterpolationInfo->Index = 0; |
| 884 | |
| 885 | this->InterpolationFuncDouble = &(vtkInterpolateNOP<double>::InterpolationFunc); |
| 886 | this->InterpolationFuncFloat = &(vtkInterpolateNOP<float>::InterpolationFunc); |
| 887 | this->RowInterpolationFuncDouble = &(vtkInterpolateNOP<double>::RowInterpolationFunc); |
| 888 | this->RowInterpolationFuncFloat = &(vtkInterpolateNOP<float>::RowInterpolationFunc); |
| 889 | |
| 890 | return; |
| 891 | } |
| 892 | |
| 893 | // set the InterpolationInfo object |
| 894 | vtkInterpolationInfo* info = this->InterpolationInfo; |
| 895 | vtkIdType* inc = info->Increments; |
| 896 | int* extent = info->Extent; |
| 897 | extent[0] = this->Extent[0]; |
| 898 | extent[1] = this->Extent[1]; |
| 899 | extent[2] = this->Extent[2]; |
| 900 | extent[3] = this->Extent[3]; |
| 901 | extent[4] = this->Extent[4]; |
| 902 | extent[5] = this->Extent[5]; |
| 903 | |
| 904 | // use the Extent and Tolerance to set the bounds |
| 905 | double* bounds = this->StructuredBoundsDouble; |
| 906 | float* fbounds = this->StructuredBoundsFloat; |
| 907 | double tol = this->Tolerance; |
| 908 | // always restrict the bounds to the limits of int |
| 909 | int supportSize[3]; |
| 910 | this->ComputeSupportSize(nullptr, supportSize); |
| 911 | // use the max of the three support size values |
| 912 | int kernelSize = supportSize[0]; |
| 913 | kernelSize = ((supportSize[1] < kernelSize) ? kernelSize : supportSize[1]); |
| 914 | kernelSize = ((supportSize[2] < kernelSize) ? kernelSize : supportSize[2]); |
| 915 | double minbound = VTK_INT_MIN + kernelSize / 2; |
| 916 | double maxbound = VTK_INT_MAX - kernelSize / 2; |
| 917 | |
| 918 | for (int i = 0; i < 3; i++) |
| 919 | { |
| 920 | // use min tolerance of 0.5 if just one slice thick |
| 921 | double newtol = 0.5 * (extent[2 * i] == extent[2 * i + 1]); |
| 922 | newtol = ((newtol > tol) ? newtol : tol); |
| 923 | |
| 924 | double bound = extent[2 * i] - newtol; |
| 925 | bound = ((bound > minbound) ? bound : minbound); |
| 926 | fbounds[2 * i] = bounds[2 * i] = bound; |
| 927 | bound = extent[2 * i + 1] + newtol; |
| 928 | bound = ((bound < maxbound) ? bound : maxbound); |
| 929 | fbounds[2 * i + 1] = bounds[2 * i + 1] = bound; |