We are trying to update our VTK version used in MOOSE from 9.2.6 to 9.3.0. (We are often limited in our version choices by interactions of conda feedstocks involving mpi, clang, etc.). That attempted update is occurring at Add OpenMPI variants to MOOSE development packages, add Python 3.11 support by milljm · Pull Request #26848 · idaholab/moose · GitHub. However, we are running into test regressions for our image sampling capabilities. Unfortunately, the developer who wrote this class which wraps VTK is no longer with us. From our wrapper header these are some of the VTK data structures involved
/// List of file names to extract data
vtkSmartPointer<vtkStringArray> _files;
/// Complete image data
vtkImageData * _data;
/// VTK-6 seems to work better in terms of "algorithm outputs" rather than vtkImageData pointers...
vtkAlgorithmOutput * _algorithm;
/// Complete image data
vtkSmartPointer<vtkImageReader2> _image;
/// Pointer to thresholding filter
vtkSmartPointer<vtkImageThreshold> _image_threshold;
/// Pointer to the shift and scaling filter
vtkSmartPointer<vtkImageShiftScale> _shift_scale_filter;
/// Pointer to the magnitude filter
vtkSmartPointer<vtkImageMagnitude> _magnitude_filter;
Have there been any notable changes to the behavior of these classes between 9.2.6 and 9.3.0? Any suggestions how we should proceed?
For the devoted reader, the MOOSE image sampler header and implementation are here and here respectively.
The first screenshot is the old result from our image sampler. The second screenshot is the new result. So it seems like the results are qualitatively the same but the minimum value is 0 for the former but 5.7e4 for the latter. The maximum is the same for both. Below I’ve attached the original image we’re sampling.
The MOOSE regression test is a bit convoluted. It reads in the image using the class I linked to in the original post, stores it in a variable (u), and then writes to exodus. So yes I’ve opened the exodus file in paraview, which shows that the lower bound for the variable u (populated by the vtk image sampler) is different, 0 vs. 5.7e4
Using ‘float’ for the sum of squares here is a little bit lossy, whereas ‘double’ has enough bits to do the math exactly for 16-bit input. However, the difference is tiny, after the square root the difference is on the order of 0.001. In the final interpolated image you should only see a very small number of pixels change by either +1 or -1, never more than that.