How to Visualize ToothFairy

Explore the CBCT scans and their inferior alveolar canal annotations in your browser, in Napari, or straight from Python.

1

In your browser

No installation: rotate a sample volume and its canal annotation right on this page.

2

In Napari

Open any scan with its annotations in a fast, interactive desktop viewer for Python users.

3

From Python

The volumes are plain NumPy arrays: load them with a single line of code.

In your browser

The viewer below shows a sample ToothFairy volume with its dense annotation of the inferior alveolar canal. Drag to rotate and scroll to zoom.

Labels

Napari

When dealing with 3D medical volumes you need a tool that lets you explore them interactively. Among the many available, we recommend Napari: it is open source, integrates seamlessly with Python, ships with many helpful features out of the box, and can be extended with plugins.

Each patient folder (e.g. Dataset/P1/) contains the scan data.npy, the sparse annotation gt_sparse.npy and, for densely annotated patients, the dense annotation gt_alpha.npy.

The Napari interface

Open a volume in four steps

  1. Install Napari:
    pip install "napari[all]"
  2. Launch it by typing napari in a terminal.
  3. Choose File > Open File(s)... and select the .npy files you want to open, e.g. data.npy and gt_alpha.npy.
  4. Napari opens .npy files as images. Right-click the gt_alpha.npy or gt_sparse.npy layer and choose Convert to Labels to display it as an annotation.
Converting a layer to labels in Napari

From Python

The volumes are stored as NumPy arrays, so you can load them directly and hand them to Napari:

import napari
import numpy as np

patient = "ToothFairy_Dataset/Dataset/P1"

scan = np.load(f"{patient}/data.npy")
sparse = np.load(f"{patient}/gt_sparse.npy")
dense = np.load(f"{patient}/gt_alpha.npy")  # only for densely annotated patients

viewer = napari.Viewer()
viewer.add_image(scan, name="CBCT", colormap="gray")
viewer.add_labels(sparse.astype(np.uint8), name="Sparse annotation")
viewer.add_labels(dense.astype(np.uint8), name="Dense annotation")
napari.run()

ToothFairy annotator plugin

The ToothFairy annotator plugin in Napari

We are actively developing a Napari plugin to visualize and annotate 3D CBCT volumes in the most comprehensive and user-friendly way possible. It is freely available to the medical and research community:

pip install napari-toothfairy-annotator

Source code, issues and updates are on the GitHub repository.