Skip to content
Snippets Groups Projects

Simple 3d slicer

1 file
+ 1
3
Compare changes
  • Side-by-side
  • Inline
+ 1
3
@@ -13,7 +13,6 @@ import math
import qim3d.io
import os
def grid_overview(
data, num_images=7, cmap_im="gray", cmap_segm="viridis", alpha=0.5, show=False
):
@@ -393,7 +392,7 @@ def slicer(
img_height: int = 3,
img_width: int = 3,
show_position: bool = False,
interpolation: Optional[str] = None,
interpolation: Optional[str] = None
) -> widgets.interactive:
"""Interactive widget for visualizing slices of a 3D volume.
@@ -418,7 +417,6 @@ def slicer(
# Create the interactive widget
def _slicer(position):
fig = slices(vol, axis=axis, cmap=cmap, img_height=img_height, img_width=img_width, show_position=show_position, interpolation=interpolation, position=position, n_slices=1, show=True)
#fig.get_axes()[0].axvline(position, 0, vol.shape[axis], color='r', linestyle='--', linewidth=1)
return fig
position_slider = widgets.IntSlider(value=vol.shape[axis]//2, min=0, max=vol.shape[axis]-1, description='Slice', continuous_update=True)
slicer_obj = widgets.interactive(_slicer, position=position_slider)
Loading