IPython console

_images/ipython.png

A fully functional IPython console (Jupyter 5.4.0) is available in the “IPython” tab of the central area (see IPython documentation).

Command line on the left (1). Right-click displays a popup menu:

  • Cut, cut selected text.

  • Copy, copy selected text to the system clipboard.

  • Paste, paste clipboard text to the console.

  • Select all, select all of the console text.

  • Save as HTML/XML, save the console display to HTML/XML file.

  • Print, open a print dialog to print the console display.

Right-click a chart image displays another popup menu:

  • Copy Image, copy the chart image to the system clipboard.

  • Save Image As, save the chart image in png bitmap format.

another Modules/Types/Functions imported into the environment are displayed in the list box at top-right (2). A tooltip pops when mouse cursor remains in front of a box element. It displays its docstring.

Variables are displayed in the list box at bottom-right (3). A tooltip pops when mouse cursor remains in front of a variable. It displays its value converted to string.

  • Double-click on a SisypheVolume, sitkImage (see SimpleITK Image class), ANTsImage (see ANTs Image class), vtkImageData (see VTK Image class) or ndarray variable (see Numpy ndarray class) opens it in the thumbnail bar.

  • Right-click on 1D/2D ndarray, 2D sitkImage, or Pillow Image displays a popup menu that allows you to select various Matplotlib charts to draw at the current console prompt. A dialog box opens to select the display settings for each chart. Matplotlib Figure and Axes variables of the current chart are created under the names ‘fig’ and ‘ax’.

The available charts are listed below:

  • Line plot, 1D ndarray or 2D (one line plot for each row vector)

  • Bar plot, 1D ndarray or 2D (one bar plot for each row vector)

  • Stairs plot, 1D ndarray or 2D (one stair plot for each row vector)

  • Box-and-Whisker plot, 1D ndarray or 2D (one Box-and-Whisker plot for each row vector)

  • Violin plot, 1D ndarray or 2D (one violin plot for each row vector)

  • Histogram plot, 1D ndarray or 2D (one histogram for each row vector)

  • Scatter plot, 2D ndarray with 2 rows (1 row vector for x, 1 row vector for y) or 2 columns (1 column vector for x, 1 column vector for y)

  • Matrix plot, 2D ndarray

  • Image plot, 2D ndarray, SimpleITK Image or Pillow Image variable

Five buttons (4):

  • Import, import of most-used modules (PySisyphe core modules, ANTs, Matplotlib, NiBabel, Nilearn, Numpy, Pandas, Pillow, PyDicom, Scikit-image, SciPy, SimpleITK)

  • Clear, clear console.

  • Restart, restart console.

  • Save HTML/XML, save the console display to HTML/XML file.

Same functions (1, 2, 3 and 4) are accessible via the menu bar (Views -> IPython)..