vtkProbeFilter can't probe a vtkImageDataset with more than 2^31 cells
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
I was trying to probe a vtkImageDataset (1400x1400x2000 px) with a vtkStructuredGrid but discovered that I couldn't probe the lower half of my image, it just returned zeros.
My VTK is built with 64 bit IDs. Eventually, I tracked the problem down to vtkStructuredGrid.h:
static vtkIdType GetLinearIndex( const int i, const int j, const int k, const int N1, const int N2 ) { return( (k*N2+j)*N1+i ); }
So the problem is the arithmetic is being done with 32 bit ints even though the return type is 64 bit. A simple fix is:
static vtkIdType GetLinearIndex( const vtkIdType i, const vtkIdType j, const vtkIdType k, const vtkIdType N1, const vtkIdType N2 ) { return( (k*N2+j)*N1+i ); }