Skip to main content
Yanked

This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Consider using release 0.2.1 instead.
Reason given by maintainers: Crashes on NumPy >= 2.3 (np.trapz removed); use 0.2.1.

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.0

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.0
File Size Uploaded
micro_ct_image_quality_toolbox-0.2.0.tar.gz 65.8 kB Details

Built distribution (wheel)

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

Total release size: 141.1 kB

Release files / micro_ct_image_quality_toolbox-0.2.0.tar.gz

Download URL micro_ct_image_quality_toolbox-0.2.0.tar.gz
Size 65.8 kB
Tags Source
SHA-256 checksum
How to use checksums
0ea21d0dd23ac30af769fdd07f2c33fc7dedace0c32107550729b9576ebca31b
BLAKE2b-256 checksum
How to use checksums
e88e61a8251bb84ab1be628345828ac0f4abab6adf393e881fa34ce02d023887
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.0-py3-none-any.whl

Download URL micro_ct_image_quality_toolbox-0.2.0-py3-none-any.whl
Size 75.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6df997d06f172bf6eab4ac8ebe453531713a8fb408932b8fff86236fcbc78162
BLAKE2b-256 checksum
How to use checksums
bb99594bf9ae63c20bba92d4e0af73acc6e6dd8158b34b128478a306bc9ffa37
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

0.2.1

2 release files

This release

0.2.0 This release

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