Use case: you just registered two 3D NIfTI-formatted volumes (e.g. 3D-T1w-MRI to/from CT) and want to check their alignment.
To do this, you normally pull data locally and use a standard viewer (fsleyes, MRICron, ITKSnap, ...) or get a registration summary.
Here an intermediate approach is used: a self-contained Papaya viewer object is generated to allow registration checks with a lightweight file from standard browsers (tested - safari).
The html/js files generated by Papaya, contain full description of the images represented based on a viewer preset (defined via html template for simplicity, can be better scripted) that is easily inspected locally or within a remote X-11 session.
The template html defined is a simple overlay with a quick toggle button that alters overlay transparency. This can (should?) be extended for more modularity and integration within existing pipelines.
If you don't want / can't pull all the images to local (or no suitable viewer available), this script acts as single liner Papaya wrapper to generate a self-contained and lightweight registration qc object. Similar approaches work with an animation, here Papaya is used for its complete viewer capabilities in lightweight package.
bg = background nii (base 3D-T1w-MRI) fg = foreground nii (overlay CT) out = output folder (absolute path to)
Offline generate papaya object:
python3 gen_view.py --bg ${dataset}/T1.nii.gz --fg ${dataset}/CT.nii.gz --out ${dataset}/build_out/
Build papaya local object and open right away in browser:
python3 gen_view.py --bg ${dataset}/T1.nii.gz --fg ${dataset}/CT.nii.gz --out ${dataset}/build_out/ --browser open
On a fresh python3 virtual environment install papaya_wrap
via
git clone https://github.com/apalombit/papaya_wrap.git
Dependencies (from Papaya) include JVM etc... (see Papaya page: https://github.com/rii-mango/Papaya)