Skip to main content

An ITK module to compute 3D thickness

Project description

An ITK module to compute 3D thickness

Build Status PyPI Version License

Overview

This is a module for the Insight Toolkit (ITK) that provides filters that compute the skeleton and thickness transforms of a 3D image.

ITK currently comes without a hands-on solution for 3D thickness evaluation. This contribution implements several filters based on the Euclidean distance transform and binary skeleton to fill this blank.

Binary thinning

Provides a 1 pixel-thin wire skeleton using an efficient curve thinning algorithm.

The thinning algorithm used in this module comes from the Insight Journal article:

Homann H.
Implementation of a 3D thinning algorithm
The Insight Journal - 2007 July - December.
https://hdl.handle.net/1926/1292
https://insight-journal.org/browse/publication/181

Medial thickness

The idea behind the medial thickness as implemented in this module is twice the shortest distance to the outter shell along the medial axis of the object (i.e. diameter of the local maximal fitting sphere).

This definition provides an unbiased method for thickness evaluation compared to the local thickness transform since this last one will result in a higher number of points for thick parts. The skeletonization insure a minimal set of measurements to fully describe the object.

Filters

Installation

Python

Binary Python packages are available for Linux, macOS, and Windows. They can be installed with:

python -m pip install --upgrade pip
python -m pip install itk-thickness3d

C++

You need to build ITK from source to use this module.

In the newer versions of ITK, this module is available as a Remote module in the ITK source code. Build it with the CMake option: Module_Thickness3D, this can be switched on with a CMake graphical interface ccmake or directly from the command line with: -DModule_Thickness3D:BOOL=ON

For older ITK versions, add it manually as an External or Remote module to the ITK source code:

External:

cd ${itk_src}/Modules/External
git clone https://github.com/InsightSoftwareConsortium/ITKThickness3D

Remote:

Create a file in ${itk_src}/Modules/Remote called Thickness3D.remote.cmake (see this GitHub gist) with the the following contents:

itk_fetch_module(Thickness3D
  "Tools for 3D thickness measurement"
  GIT_REPOSITORY ${git_protocol}://github.com/InsightSoftwareConsortium/ITKThickness3D.git
  GIT_TAG <replace with the latest stable commit tag>
)

Usage

Python

Once ITK imported, you can use the itk.MedialThicknessImageFilter3D just as any other ITK methods:

skeleton = itk.BinaryThinningImageFilter3D.New(image)

Here is a simple python script that reads an image, applies the medial thickness filter and writes the resulting image in a file:

import itk

input_filename = sys.argv[1]
output_filename = sys.argv[2]

image = itk.imread(input_filename)
thickness_map = itk.MedialThicknessImageFilter3D.New(image)

itk.imwrite(thickness_map, output_filename)

License

This software is distributed under the Apache 2.0 license. Please see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

itk_thickness3d-6.0.0-cp311-abi3-win_amd64.whl (578.0 kB view hashes)

Uploaded CPython 3.11+ Windows x86-64

itk_thickness3d-6.0.0-cp311-abi3-manylinux_2_28_x86_64.whl (2.3 MB view hashes)

Uploaded CPython 3.11+ manylinux: glibc 2.28+ x86-64

itk_thickness3d-6.0.0-cp311-abi3-manylinux_2_28_aarch64.whl (2.1 MB view hashes)

Uploaded CPython 3.11+ manylinux: glibc 2.28+ ARM64

itk_thickness3d-6.0.0-cp311-abi3-manylinux_2_17_x86_64.whl (820.4 kB view hashes)

Uploaded CPython 3.11+ manylinux: glibc 2.17+ x86-64

itk_thickness3d-6.0.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.4 MB view hashes)

Uploaded CPython 3.11+ manylinux: glibc 2.17+ x86-64

itk_thickness3d-6.0.0-cp311-abi3-macosx_11_0_arm64.whl (550.3 kB view hashes)

Uploaded CPython 3.11+ macOS 11.0+ ARM64

itk_thickness3d-6.0.0-cp311-abi3-macosx_10_9_x86_64.whl (676.0 kB view hashes)

Uploaded CPython 3.11+ macOS 10.9+ x86-64

itk_thickness3d-6.0.0-cp310-cp310-win_amd64.whl (578.4 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

itk_thickness3d-6.0.0-cp310-cp310-manylinux_2_28_x86_64.whl (2.3 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.28+ x86-64

itk_thickness3d-6.0.0-cp310-cp310-manylinux_2_28_aarch64.whl (2.1 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.28+ ARM64

itk_thickness3d-6.0.0-cp310-cp310-manylinux_2_17_x86_64.whl (820.7 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

itk_thickness3d-6.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.4 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

itk_thickness3d-6.0.0-cp310-cp310-macosx_11_0_arm64.whl (549.8 kB view hashes)

Uploaded CPython 3.10 macOS 11.0+ ARM64

itk_thickness3d-6.0.0-cp310-cp310-macosx_10_9_x86_64.whl (675.6 kB view hashes)

Uploaded CPython 3.10 macOS 10.9+ x86-64

itk_thickness3d-6.0.0-cp39-cp39-win_amd64.whl (579.0 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

itk_thickness3d-6.0.0-cp39-cp39-manylinux_2_28_x86_64.whl (2.3 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.28+ x86-64

itk_thickness3d-6.0.0-cp39-cp39-manylinux_2_28_aarch64.whl (2.1 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.28+ ARM64

itk_thickness3d-6.0.0-cp39-cp39-manylinux_2_17_x86_64.whl (820.7 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

itk_thickness3d-6.0.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.4 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

itk_thickness3d-6.0.0-cp39-cp39-macosx_11_0_arm64.whl (549.8 kB view hashes)

Uploaded CPython 3.9 macOS 11.0+ ARM64

itk_thickness3d-6.0.0-cp39-cp39-macosx_10_9_x86_64.whl (675.6 kB view hashes)

Uploaded CPython 3.9 macOS 10.9+ x86-64

itk_thickness3d-6.0.0-cp38-cp38-win_amd64.whl (605.7 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

itk_thickness3d-6.0.0-cp38-cp38-manylinux_2_28_x86_64.whl (2.3 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.28+ x86-64

itk_thickness3d-6.0.0-cp38-cp38-manylinux_2_28_aarch64.whl (2.1 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.28+ ARM64

itk_thickness3d-6.0.0-cp38-cp38-manylinux_2_17_x86_64.whl (820.7 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

itk_thickness3d-6.0.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.4 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

itk_thickness3d-6.0.0-cp38-cp38-macosx_10_9_x86_64.whl (675.6 kB view hashes)

Uploaded CPython 3.8 macOS 10.9+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page