Controlling z plane of image shown in napari viewer

Hi!
I’m hoping to find the napari viewer method that lets me set (and ideally also get) which z-plane of a 3d image stack is currently visible in the viewer. Can anyone point me to this?

I tried viewer.layers[‘myimage’].set_view_slice, but was not clear how this should be called since it doesn’t appear to take an argument.

Thanks!
-nate

Yeah that one isn’t obvious enough (we’ll be working on dims and slicing soon). I think you’re looking for viewer.dims.set_point,

https://napari.org/docs/api/napari.components.html#napari.components.dims.Dims.set_point

and retrieve the current index for all dimensions with viewer.dims.point

1 Like

perfect, thanks Talley!