The extent of vtkResliceCursorRepresentation output.

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;
    }
  }
  ...
}

Some GPUs and platforms only supports power of 2 images, I guess this was the reason but I am not sure this is still true on modern GPUs.

However I don’t understand why you report that it will be slower depending on the center position, the position of the center should not have influence on the size of the plane, but I might be missing something

Thanks for the reply, you’ve made me realize that maybe our design doesn’t make sense and I need to recheck it.