Commit 2ae1ddb6 authored by Matthijs's avatar Matthijs
Browse files

allow to pass a name to the window,

bugfix for RGB plots
parent 7c5f191e
......@@ -52,7 +52,7 @@ class SingleStackViewer:
class XYZStackViewer:
def __init__(self, volume, limit_sliders=(0, 0, 0), cmap: str = 'seismic', clim: tuple = (None, None),
data_transform: callable = None):
data_transform: callable = None, name: str = None):
Dynamic matplotlib plot showing slices out of a 3d dataset
......@@ -62,6 +62,7 @@ class XYZStackViewer:
:param clim: tuple with the min-max values of the colorscale
:param data_transform: simple transformation function to apply to data before plot.
defaults to abs() for complex data
:param name: Set the name of the figure to a string.
if get_backend() not in good_backends:
warn(Warning('Current matplotlib backend may not allow for optimal funcionality! Use, e.g., Qt'))
......@@ -101,8 +102,10 @@ class XYZStackViewer:
if not rgb_plot:
self.maxval = max(self.cast_fn(volume))
self.minval = min([0, min(self.cast_fn(volume))])
self.minval, self.maxval = 0, 255
self.fig, = plt.subplots(1, 3, figsize=(10, 4))
self.fig, = plt.subplots(1, 3, figsize=(10, 4), num=name)
im =[0].imshow(self.cast_fn(volume[self.indices[0], :, :]), cmap=cmap, vmin=self.minval,
im =[1].imshow(self.cast_fn(volume[:, self.indices[0], :]), cmap=cmap, vmin=self.minval,
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment