Tutorial 0: Hello Imaris! Showing a max projection in jupyter

This is a quick test to show the connection between Imaris, XTIPython.py and jupyter-notebook

NOTE: For this tutorial, please load the wmi19h-2-5.ims demo dataset

Step 1, launch the jupyter server from Imaris

Launch the Jupyter-notebook extension from Imaris

... then work in your web browser localhost:8888 (or whichever port is indicated in the command window).

Step 2, load the XTIPython extension

This will make BridgeLib and vImaris available to jupyter. This step is always required to interact with Imaris data.


In [1]:
%reload_ext XTIPython

Step 3, get channel data from Imaris, display their max projection


In [2]:
#This is to use matplotlib inside jupyter-notebook:
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np

#This gets the Green / Red data from Imaris:
Green = BridgeLib.GetDataVolume(vDataSet,0,0) #Channel 0, timepoint 0
Red = BridgeLib.GetDataVolume(vDataSet,1,0) #Channel 1, timepoint 0
print "Green shape:",Green.shape,"min-max:",np.min(Green),np.max(Green),"type:",Green.dtype
print "Red shape:",Red.shape,"min-max:",np.min(Red),np.max(Red),"type:",Red.dtype

#This computes the max projection:
GreenMax = np.max(Green,axis=0); RedMax = np.max(Red,axis=0);

#This displays the Green and Red projections side by side:
fig, axs = plt.subplots(1,2, figsize=(10,20))
axs[0].set_title("Green"); axs[1].set_title("Red"); 
im1 = axs[0].imshow(GreenMax,cmap="gray"); im2 = axs[1].imshow(RedMax,cmap="gray")


Green shape: (55L, 430L, 346L) min-max: 0 255 type: uint8
Red shape: (55L, 430L, 346L) min-max: 0 215 type: uint8