Sessions#

A session saves what the viewer shows, so it can be opened again later: the files loaded, each item’s options, and the views (the crosshair, the zoom and pan of each view, the 3D camera, the main volume, the selection, the enlarged view, RAS or LAS, and the overlay and crosshair switches). The Settings panel’s settings are not part of it.

  • File > Save Session… (Ctrl+S) writes a session file, name.lar.json. Items added from Python without a file cannot be saved; a message names them.

  • File > Open Session… (Ctrl+Shift+O) replaces what is shown with the session. The files are read in the background, with the progress bar and Cancel, and the options and views are restored once all are read.

The session stores each file’s full path and its path from the session file’s folder, and tries the second first: keep the session file in the project folder, and the folder can be moved or copied to another computer. A file that is missing or cannot be read is reported, and the rest of the session still opens.

From the command line, lar bv --session name.lar.json opens a session; files given with -v, -t and the other options are added to it. From Python:

viewer.save_session("project/view.lar.json")
report = viewer.load_session("project/view.lar.json")
print(report.problems)