~ Installation ~ Data ~ Examples ~ References ~ License ~
This repository implements a simple 3D viewer using the PyVista library.
The viewer works together with CoDA, a browser-based visual exploration and analytics tool.

Clone this repository, so that you also obtain the example data.
git clone https://github.com/zibamira/CTcoral_CoDA_PyVista
Create a virtual environment and install all dependencies.
cd CTCoral_CoDA_PyVista python3 -m virtualenv venv source ./venv/bin/activate pip3 install .
If you want to use CoDA, then you must install it as well.
python3 -m pip install https://github.com/zibamira/CTcoral_CoDA
This 3D viewer only shows three different visualisation:
- an isosurface rendering of a CT scan,
- a segmentation of the scan, given as a label field,
- and a spatial graph, with exactly one vertex for each label and edges representing some kind of connectivity between the respective labels.
CoDA was originally developped for the analysis of cold-water corals. In this use case, the label field is the calice (or corallite) segmentation and the spatial graph represents the mother-daughter relationships within a specimen.
To keep things simple, the data is placed in a single folder, together with a meta.yml configuration file.
Check out the data/A2W example folder.
- CT Image
The 3D volume CT image is provded as a numpy .npy file. Themeta.ymlfile contains the actual filename of the volume image, the spatial dimensions, specified by the origin and physical size parameters, and the isovalue used for the isosurface rendering.ct: filename: "ct.npy" isovalue: 100.0 origin: [-36.1212, -56.4792, -1121.4] physical size: [89.856, 82.836, 117.3]
- Label Image
The label image contains the segmentation of the CT image that should be visualized as a label field. Similar to CT image, themeta.ymlcontains the actual filename of the label image, and the spatial dimensions.labels: filename: "calices.npy" origin: [-36.1212, -56.4792, -1121.4] physical size: [89.856, 82.836, 117.3]
- Graph
The attributes of the spatial graph is specified by two .csv spreadsheets, one for the vertices and one for the edges.
The vertex spreadsheet must contain a column for each spatial coordinate of the vertex, that is, one colum for the x-coordinate, one for the y-coordinate and one for the z-coordinate. Also, it must contain a column with the corresponding label value in the label image.
The edge spreadsheets must contain one column specifying the row id of the source (start) vertex source id in the vertex spreadsheet, and one column specifying the row id of the target (end) vertex target id in the vertex spreadsheets.graph: vertices: filename: "graph_vertices.csv" columns: x: "X Coord" y: "Y Coord" z: "Z Coord" label: "label" edges: filename: "graph_edges.csv" columns: source id: "Node ID #1" target id: "Node ID #2"
This repository comes with the segmentation of A2W cold-water coral specimen. Please check the Pangea page for information about the fair use of this dataset and cite the accompanying publication when you use it.
Launch the 3D viewer first.
python3 -m coda_pyvista data/A2W/meta.yml
Launch CoDA, if you have installed it, afterwards.
python3 -m coda --start-browser amira
You can then explore the specimen as shown in the video. Here, the CoDA-PyVista viewer is opened on the left side and CoDA is running in the browser on the right side.
- The CoDA preprint.
https://doi.org/10.48550/arXiv.2406.18236 - The CoDA repository.
https://github.com/zibamira/CTcoral_CoDA - The A2W dataset, published on Panges.
https://doi.pangaea.de/10.1594/PANGAEA.969578
https://doi.pangaea.de/10.1594/PANGAEA.969464
This project is released under the MIT License.