diff --git a/Python/04_Image_Display.ipynb b/Python/04_Image_Display.ipynb index a28c2639..269e09e8 100644 --- a/Python/04_Image_Display.ipynb +++ b/Python/04_Image_Display.ipynb @@ -259,7 +259,8 @@ " \"grey colormap,\\n scaling based on volumetric min and max values\", fontsize=10\n", ")\n", "plt.imshow(npa_zslice, cmap=plt.cm.Greys_r, vmin=npa.min(), vmax=npa.max())\n", - "plt.axis(\"off\");" + "plt.axis(\"off\")\n", + "plt.show()" ] }, { @@ -321,6 +322,7 @@ "plt.figure(figsize=(10, 2))\n", "plt.imshow(sitk.GetArrayViewFromImage(sitk_isotropic_xslice), cmap=plt.cm.Greys_r)\n", "plt.axis(\"off\")\n", + "plt.show()\n", "print(f\"Image spacing: {sitk_isotropic_xslice.GetSpacing()}\")" ] }, diff --git a/Python/69_x-ray-panorama.ipynb b/Python/69_x-ray-panorama.ipynb index 83f5c34c..72454b6e 100755 --- a/Python/69_x-ray-panorama.ipynb +++ b/Python/69_x-ray-panorama.ipynb @@ -136,7 +136,8 @@ "source": [ "intensity_profile_image = knee_image\n", "fig = plt.figure()\n", - "plt.hist(sitk.GetArrayViewFromImage(intensity_profile_image).flatten(), bins=100);" + "plt.hist(sitk.GetArrayViewFromImage(intensity_profile_image).flatten(), bins=100)\n", + "plt.show()" ] }, { @@ -180,7 +181,8 @@ "axes[1].plot(intensities.mean(axis=1), range(intensities.shape[0]))\n", "axes[1].get_yaxis().set_visible(False)\n", "axes[1].tick_params(axis=\"x\", rotation=-90)\n", - "plt.box(on=None)" + "plt.box(on=None)\n", + "plt.show()" ] }, { diff --git a/Python/gui.py b/Python/gui.py index 83341761..e05212fb 100644 --- a/Python/gui.py +++ b/Python/gui.py @@ -99,6 +99,7 @@ def __init__( vmax=self.moving_max_intensity, ) self.update_display() + plt.show() def create_ui(self): # Create the active UI components. Height and width are specified in 'em' units. This is @@ -414,6 +415,7 @@ def __init__(self, image, window_level=None, figure_size=(10, 8)): vmax=self.max_intensity, ) self.update_display() + plt.show() def create_ui(self): # Create the active UI components. Height and width are specified in 'em' units. This is @@ -624,6 +626,7 @@ def multi_image_display2D( ax.set_title(title) ax.set_axis_off() fig.tight_layout() + plt.show() return (fig, axes) @@ -693,6 +696,7 @@ def __init__( ) self.update_display() plt.tight_layout() + plt.show() def create_ui(self, shared_slider, wl_range, wl_init): # Create the active UI components. Height and width are specified in 'em' units. This is @@ -877,6 +881,7 @@ def __init__(self, image, window_level=None, figure_size=(10, 8)): vmax=self.max_intensity, ) self.update_display() + plt.show() def create_ui(self): # Create the active UI components. Height and width are specified in 'em' units. This is @@ -1176,6 +1181,7 @@ def __init__( self.fig.canvas.mpl_connect("button_release_event", self.on_release) self.update_display() + plt.show() def create_ui(self): # Create the active UI components. Height and width are specified in 'em' units. This is