Skip to main content

Module medical

Module medical 

Source
Expand description

Medical volume helpers (pure Rust).

HU window/level display, max-intensity projection, isotropic nearest-neighbour resample, and non-negative spectral unmixing for multi-channel fluorescence.

Modules§

hu_window
Apply CT Hounsfield Unit window/level → 8-bit display.
isotropic_resample_nn
Nearest-neighbour resample of anisotropic 2D/3D grids to isotropic spacing.
mip_project
Max Intensity Projection (MIP) along a volume axis.
spectral_unmix_nnls
Non-negative least-squares lite for multi-channel spectral unmixing.

Structs§

UnmixResult
Result of a single spectrum unmix.

Enums§

MedicalError
Medical imaging helper errors.
MipAxis
Projection axis for a 3D volume stored as stacked 2D slices.

Functions§

apply_hu_window_f32
Window/level on f32 intensity (HU or similar) → u8 display.
apply_hu_window_i16
Window/level on i16 HU values → u8 display.
hu_window_i16
Window/level on i16 HU values → u8 display.
isotropic_resample_2d_nn
Resample a 2D image from anisotropic pixel spacing to isotropic.
isotropic_resample_3d_nn
Resample a 3D volume (stacked slices) to isotropic voxel spacing.
isotropic_resample_nn_2d
Resample a 2D image from anisotropic pixel spacing to isotropic.
mip_project_axis
Max-intensity project a 3D volume of f32 voxels.
mip_project_z
MIP along Z (classic axial max-intensity projection).
spectral_unmix_nnls
Unmix one observed spectrum y (length n_channels) against endmember matrix endmembers laid out as column-major: component k occupies endmembers[k * n_channels .. (k+1) * n_channels].
spectral_unmix_per_pixel
Per-pixel unmix: writes abundances into out_abundances laid out as pixel-major × n_components. Returns number of pixels written.
spectral_unmix_roi_mean
Mean the ROI spectra then unmix once (cheap path for bulk regions).