Skip to main content

Micro-CT Image Quality Toolbox

PyPI License: MIT Python 3.10+

MTF, NPS, NEQ, TTF and detectability index (d') for reconstructed CT volumes, following AAPM Report 233 and ISO 12233.

MTF, NPS and d' of a micro-CT phantom reconstruction

Metric Method Needs
MTF Slanted edge (ISO 12233) An edge tilted 2 to 10°
NPS Radially averaged 2D power spectra of ROIs A uniform region
NEQ MTF² / NPS Both of the above
TTF Radial edge profile of circular inserts Cylindrical inserts
d' NPW observer, disc tasks (AAPM TG-233) MTF and NPS

Volumes are (z, y, x) arrays from .npy, .npz or GE .vff files. Regions are given in millimetres, so one ROI table works at any voxel size.

Install

pip install micro_ct_image_quality_toolbox

Python 3.10+. Import name microct_iq_toolbox. Add [photutils] for exact circle/pixel overlap in the radial averages (the NumPy default agrees to <1 %).

Usage

ct-demo --out demo/                                        # synthetic phantom, full pipeline, ~10 s

ct-find-rois --template seed.json                          # edit the rough positions
ct-find-rois reference.vff --seed seed.json --out rois.json
ct-report volume.vff --rois rois.json --out results/

ct-find-rois measures the edge angle, insert centres and noise ROIs once per phantom and writes rois.json with a verification figure. ct-report runs every metric on a volume and writes the curves (.npz + .json), metrics.json and the figure above. Voxel size is read from the VFF header or a .json sidecar; use --pixel-size for a bare .npy.

Single metrics with pixel regions:

ct-mtf --input edge.npy --crop_indices 270,664,522,640 --pixel_size 0.075 --edge_angle 5.4 --output_dir r/
ct-nps --input flat.npy --roi_bounds "178,294,510,626;258,374,750,866" --pixel_size 0.075 --output_dir r/
ct-neq --mtf r/mtf.npz --nps r/nps.npz --output_dir r/
ct-dprime npw --mtf r/mtf.npz --nps r/nps.npz --contrast 100 --output_dir r/
ct-ttf --input inserts.npy --centre_pixels "1335,2141;765,1914" --radius 120 --pixel_size 0.075
ct-metrics --config config.json

From Python:

import microct_iq_toolbox as iq

r = iq.mtf(vol, [270, 664, 522, 640], pixel_size=0.075, edge_angle=5.4)
r.x, r.y, r.summary["mtf50"]

rois = iq.PhantomROIs.load("rois.json")
frame = iq.Frame.for_image(vol, pixel_size=0.075)
metrics = iq.run_metrics(vol, frame, rois, out_dir="results")

Each function returns a MetricResult with the curve, a summary dict and save(). The raw calculators (iq.get_MTF, ...) are still available.

Notes:

  • The edge angle is an input; a wrong value biases the MTF.
  • TTF inserts below CNR 5 are reported but excluded from the average.
  • The detectable disc size is where d' crosses 3 (Rose). It is nan if the curve never gets there.
  • Regions that do not fit the volume are listed under skipped, never clamped.

Development

pip install -e ".[dev]"
pytest

License

MIT

Metadata

Release files for micro-ct-image-quality-toolbox 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for micro-ct-image-quality-toolbox 0.2.1
File Size Uploaded
micro_ct_image_quality_toolbox-0.2.1.tar.gz 65.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for micro-ct-image-quality-toolbox 0.2.1
File Interpreter ABI Platform
micro_ct_image_quality_toolbox-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 141.2 kB

Release files / micro_ct_image_quality_toolbox-0.2.1.tar.gz

Download URL micro_ct_image_quality_toolbox-0.2.1.tar.gz
Size 65.9 kB
Tags Source
SHA-256 checksum
How to use checksums
131b1bb9c10d65cb707e416af872c36d858b92635a3ca1afedc551965adb1668
BLAKE2b-256 checksum
How to use checksums
446939aebd953174a38b041d73bdb77773107a6e65d8658581a3cd23e09b2f26
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.12

Release files / micro_ct_image_quality_toolbox-0.2.1-py3-none-any.whl

Download URL micro_ct_image_quality_toolbox-0.2.1-py3-none-any.whl
Size 75.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
84fc0c78677ed5b850d8d41ad49903b0f06a9e4fbb0aa6a738dd371d76452ae4
BLAKE2b-256 checksum
How to use checksums
18f5b1f253f83ebbe6a36ad5bbea45caa5e00a45d6e581ff5d1234c6b327f0ce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.12

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page