Skip to content

Calculate vertex-wise smoothness error of a .obj surface mesh

License

Notifications You must be signed in to change notification settings

FNNDSC/pl-smoothness-error

Repository files navigation

Surface Smoothness Error

Version MIT License ci

Uncolored sphere surface Colored sphere surface

Abstract

pl-smoothness-error is a ChRIS ds plugin which calculates the mean difference in mean curvature about every vertex with its neighbors of a .obj surface mesh. It is for assessing the quality of surfaces.

Data Visualization

.obj surface files and .txt vertex-wise text data can be visualized using:

Hot-spots of large smoothness error can be used to detect errors on surfaces.

Error highlighted on surface Highlighted error and slice view side-by-side

Installation

pl-smoothness-error is a ChRIS plugin, meaning it can run from either within ChRIS or the command-line.

Get it from chrisstore.co

Local Usage

To get started with local command-line usage, use Apptainer (a.k.a. Singularity) to run pl-smoothness-error as a container:

apptainer exec docker://fnndsc/pl-smoothness-error smtherr [--args values...] input/ output/

To print its available options, run:

apptainer exec docker://fnndsc/pl-smoothness-error smtherr --help

Examples

smtherr requires two positional arguments: a directory containing input data, and a directory where to create output data. First, create the input directory and move input data into it.

mkdir incoming/ outgoing/
mv white_matter_81920.obj incoming/
apptainer exec docker://fnndsc/pl-smoothness-error:latest smtherr [--args] incoming/ outgoing/

Development

Instructions for developers.

Building

Build a local container image:

docker build -t localhost/fnndsc/pl-smoothness-error .

Get JSON Representation

Run chris_plugin_info to produce a JSON description of this plugin, which can be uploaded to a ChRIS Store.

docker run --rm localhost/fnndsc/pl-smoothness-error chris_plugin_info > chris_plugin_info.json

Local Test Run

Mount the source code smtherr.py into a container to test changes without rebuild.

docker run --rm -it --userns=host -u $(id -u):$(id -g) \
    -v $PWD/smtherr.py:/usr/local/lib/python3.11/site-packages/smtherr.py:ro \
    -v $PWD/in:/incoming:ro -v $PWD/out:/outgoing:rw -w /outgoing \
    localhost/fnndsc/pl-smoothness-error smtherr /incoming /outgoing