The vtkResliceCursorRepresentation::UpdateReslicePlane() sets extentX/extentY to a power of 2 may cause the program to slow down when the center is moved to the edge of the image, where extent may be 2048. I would like to ask if extent has to be a power of 2? What are the considerations for this?
void vtkResliceCursorRepresentation::UpdateReslicePlane()
{
...
double realExtentX = (spacingX == 0) ? VTK_INT_MAX : planeSizeX / spacingX;
// Sanity check the input data:
// * if realExtentX is too large, extentX will wrap
// * if spacingX is 0, things will blow up.
if (realExtentX > (VTK_INT_MAX >> 1))
{
vtkErrorMacro(<< "Invalid X extent: " << realExtentX);
extentX = 0;
}
else
{
extentX = 1;
while (extentX < realExtentX)
{
extentX = extentX << 1;
}
}
...
}