Incorrect volume rendering bounds - first and last slice

I created a repo with python implementation here. I’m seeing similar behavior.

I took the example from here and adapted it.

It is using vtkFixedPointVolumeRayCastMapper for the volume mapper. Is there any other type of volume mappers available in vtk python? and what does slicer use?

I wanted to create a google colab, but vtk is not rendering there for some reason (probably rendering)