Skip to content

API reference

Run the full pipeline on a single series and return its audit record.

Bases: BaseModel

Top-level configuration for a single pipeline run.

from_json(path) classmethod

Load and validate a configuration file.

to_json(path)

Persist the configuration as indented JSON.

Bases: BaseModel

Complete, serialisable record of one pipeline run.

Load a single DICOM series from path.

If the path contains multiple series, series_uid selects one; otherwise the largest series (most instances) is chosen and a debug note is logged.

An ordered DICOM series with a lazily assembled voxel volume.

metadata property

Validated, non-identifying descriptive metadata for the series.

representative property

The first dataset, used to read series-level attributes.

volume()

Return the series as a 3D array (slices, rows, cols) in stored units.

Rescale slope/intercept are applied so CT data is returned in Hounsfield units. The result is cached after first assembly.

De-identify a single dataset in place and return an audit record.

Run all QC checks against series and return a structured report.

Convert series to output in the requested format.

Returns a :class:ConversionResult recording the written path, shape, and spacing. Raises :class:ConversionError if SimpleITK fails to write.

Write an integer labelmap as a Slicer .seg.nrrd segmentation.

Parameters:

Name Type Description Default
labelmap ndarray

Integer array shaped like reference.volume() -- (slices, rows, cols). Voxel value 0 is background; each positive value is a segment.

required
reference DicomSeries

The series the labelmap was derived from, used for output geometry.

required
segment_names dict[int, str] | None

Optional mapping of label value -> human-readable segment name.

None

Models

Bases: _Frozen

Descriptive, non-identifying metadata for a single DICOM series.

Bases: _Frozen

Result of running quality-control checks on an ingested series.

passed property

True when no hard errors were recorded (warnings are non-blocking).

Bases: _Frozen

Audit record describing what de-identification changed.

Bases: _Frozen

Record of a volume successfully written to disk.