Skip to main content

Crate openbnct_core

Crate openbnct_core 

Source

Structs§

BoundFileReference
A file on disk bound by content hash. path is resolved relative to the plan file’s directory by the caller; the referenced bytes must hash to sha256.
ComponentDoseInterchange
The interchange document: everything needed to construct a PhysicalDoseBundle without loss of meaning.
ContentReference
Immutable identity of a scientific input artifact.
DoseVolume
Exposure
One weighted exposure: a bound dose bundle plus its delivery semantics.
ExposurePlan
A set of weighted exposures accumulated onto one voxel grid.
ExternalDoseBundle
The validated, provenance-bound form produced by import_external_dose.
ExternalDoseDocument
A openbnct.external-dose/0.1.0 document as emitted by the producer.
ExternalProducer
The external system that produced the dose and how it normalized it.
GridGeometry
A regular patient-coordinate voxel grid.
LandmarkPair
One named or anonymous correspondence: a point in the moving image’s patient space and its matching point in the fixed image’s space, both LPS millimetres.
MaskDoseSummary
Mean and maximum of a per-voxel quantity inside a RegionMask.
PhysicalDoseBundle
PhysicalTotalDoseVolume
RegionMask
Named voxel mask in grid order (i + nx*j + nx*ny*k).
RegionUncertainty
Region-mean uncertainty under the correlation model.
Registration
A versioned registration record: the transform, its method, the landmarks that produced it, the achieved residual, and content bindings of the moving/fixed images when known.
RigidTransform
A rigid transform mapping moving-frame LPS points to fixed-frame LPS: p_fixed = R·p_moving + t. rotation is row-major.
SourceSummary
Summary statistics for one source’s realized per-voxel contribution.
SystematicUncertaintyReport
A versioned systematic-uncertainty report over one dose quantity.

Enums§

ContentReferenceError
DoseComponent
The four physical dose groups retained before biological weighting.
DoseUnit
ExposureCovariance
Covariance model between exposures. Only independence is supported: statistically coupled exposures (for example two fractions sharing one transport run) must be merged into a single exposure first.
ExposurePlanError
ExternalDoseError
ExternalDoseQuantity
What the imported dose field physically is. physical is absorbed dose; rbe_weighted declares the producer already applied an RBE model — the basis is carried through BED conversion so a weighted field can never be silently read as physical dose downstream.
ExternalFractionation
How the total dose divides into fractions.
ExternalTotal
How the bundle’s physical_total is determined on import.
InterchangeError
RegistrationError
RegistrationMethod
How the transform was obtained.
ResampleError
ResampleMethod
Dose-field resampling method. Trilinear interpolation at voxel centers is the only supported scheme; the choice is recorded in whatever record the resampled field lands in.
SystematicError
Errors from systematic-uncertainty evaluation and validation.
TotalUncertaintyMethod
UncertaintySource
A declared systematic uncertainty source. The variant is the audit trail — what was declared; the per-voxel contribution map is computed at apply time and summarized in SourceSummary.
ValidationError
WeightBasis
What an exposure’s delivery weight physically represents.

Constants§

COMPONENT_DOSE_INTERCHANGE_SCHEMA
Schema identifier carried by every interchange document.
EXPOSURE_PLAN_SCHEMA
Schema identifier carried by every ExposurePlan.
EXTERNAL_DOSE_SCHEMA
Current schema token for external dose documents.
LEGACY_SCHEMA_PREFIX
Contract-id namespace used by artifacts written before the project was renamed from NCTForge to OpenBNCT. Such artifacts remain valid inputs and are normalized on read; new artifacts always emit SCHEMA_PREFIX.
LEGACY_TOOL_PREFIX
Hyphenated tool/method-id namespace of the same pre-rename era (e.g. nctforge-openmc-data-inspector/0.3.0).
PHYSICAL_DOSE_BUNDLE_SCHEMA
Schema identifier carried by every PhysicalDoseBundle.
REGISTRATION_SCHEMA
Current schema token for registration documents.
SCHEMA_PREFIX
Contract-id namespace emitted by current artifacts.
SYSTEMATIC_UNCERTAINTY_QUALIFICATION
Qualification asserted on every report.
SYSTEMATIC_UNCERTAINTY_SCHEMA
Current schema token for systematic-uncertainty reports.

Functions§

accumulate_exposures
Accumulate the plan’s exposure bundles into one physical dose bundle.
boron_field_sigma
Per-voxel σ for the boron-field source: σ(v) = D_b(v)·σ_B(v)/B(v) for B(v) > 0, else 0. Returns the map plus the count of voxels skipped because the field concentration was zero.
combine_total_sigma
sqrt(σ_mc² + σ_sys²) per voxel; None entries in mc are treated as zero statistical contribution.
combine_voxel_sigma
Quadrature-combine per-voxel contribution maps of independent sources.
declared_registration
Build a validated operator-declared registration document.
deserialize_contract_id
Serde deserialize_with for schema_version fields: accepts the legacy nctforge. namespace and normalizes it to openbnct. in memory, so pre-rename artifacts load into current contracts transparently.
dose_covering_percent
D_x: the dose level such that x percent of the volume receives at least that dose. percent must lie in (0, 100]; D_100 is the minimum dose. The selection is sorted ascending and the value at the continuous position (1 - x/100) * (n - 1) is linearly interpolated — the standard discrete-DVH reading for equal-volume voxels.
equivalent_uniform_dose
Generalized equivalent uniform dose (mean_i D_i^a)^(1/a).
fit_landmark_transform
Fit the rigid transform minimizing Σ|f_i − (R·m_i + t)|² over paired landmarks, returning the transform and RMS residual in mm.
grid_geometry_equivalent
Loose grid comparison for producers that print identical meshes at finite precision: exact shape equality plus a tight relative tolerance on spacing, origin, and direction. Importers must use this rather than == on f64 fields, and must never resample disagreeing meshes into agreement.
import_component_dose
Import an interchange document into a validated PhysicalDoseBundle.
import_external_dose
Validate an external-dose document into a provenance-bound bundle.
landmark_registration
Build a validated landmark-fit registration document.
masked_values
Collect the values inside mask, requiring matching lengths, at least one selected voxel, and finite non-negative doses.
mean
Arithmetic mean of a non-empty selection.
normalize_contract_id
Returns id with a legacy nctforge./nctforge- contract or tool namespace replaced by the current openbnct./openbnct- namespace. Ids without a legacy prefix are returned unchanged.
positioning_sigma
Per-voxel positioning σ: |∇D(v)|·σ_mm by central differences on the grid (one-sided at faces). The gradient is taken along voxel axes — valid because GridGeometry direction is validated orthonormal, so the axis-gradient L2 norm equals the world-space magnitude under any rotation. dose is the physical-total volume in grid order.
region_uncertainty
Region-mean uncertainty honoring the correlation model.
relative_component_sigma
Per-voxel σ for a relative_component source: σ(v) = rel·D(v). Non-finite or negative dose values are treated as zero contribution.
resample_trilinear
Resample a voxel field onto a target grid by trilinear interpolation at voxel centers.
schema_matches
True when actual identifies the same contract as expected, tolerating the legacy nctforge. namespace on either side. Use this wherever an externally supplied artifact’s schema_version is checked, so committed nctforge.* evidence remains readable.
summarize_source
Mean/max summary of a per-voxel contribution map.
volume_at_least
V_x: the fraction of the selection receiving at least level dose.

Type Aliases§

ComponentProfileReference
Content reference used specifically for the component-definition profile.