Expand description
Bio / medical CV algorithms — specialized_libs::computer_vision::bio.
Modules§
- dicom_
lite - Honest partial DICOM helpers — not a full pydicom replacement.
- histopathology
- Histopathology color / stain algorithms (pure Rust, caller-buffered).
- medical
- Medical volume helpers (pure Rust).
- morphology
- Native pure-Rust morphology / cell-detection kernels.
- radiomics
- Radiomics feature extractors (pure Rust).
- tracking
- Particle tracking: Crocker–Grier linking + centroid extraction.
Structs§
- Anonymize
Report - Report of anonymization actions.
- Crocker
Grier Linker - Bounded Crocker–Grier particle tracker.
- Crocker
Grier Params - Parameters for Crocker–Grier linking.
- Detection2
- Compact detection for the free-function linker (x, y, frame only).
- First
Order Stats - First-order radiomics features (IBSI-style subset).
- Glcm
Features - Haralick-style features averaged over 0° and 90° (symmetric GLCM).
- LabStats
- Lab mean (L, a, b).
- Linked
Particle - One linked particle observation (detection + assigned track id).
- Macenko
Result - Result of Macenko: two unit-ish stain vectors in OD space (rows: H, E; cols: R,G,B).
- Nucleus
Feature - Fixed-layout region feature (no heap).
- OdPositive
Index - Result of a positive-OD index computation.
- Parsed
Dicom Tags - Subset returned as typed convenience fields + full map of found strings.
- Particle
Centroid - 2D particle feature used by
super::crocker_grier_link(). - RgbBg
- Per-channel background estimate (linear RGB8 mean of bright pixels).
- Shape2d
- Compact 2D shape summary.
- Shape2d
Features - 2D shape features from a binary mask (nonzero = foreground).
- Shape3d
Features - 3D shape features from a sparse voxel list.
- Stain
Basis - Stain basis in optical-density space: up to 3 vectors × RGB.
- Track
Link - Per-detection link result for
crocker_grier_link. - Unmix
Result - Result of a single spectrum unmix.
Enums§
- Dicom
Lite Error - DICOM-lite errors (fail closed).
- Histo
Error - Errors for histopathology kernels.
- Medical
Error - Medical imaging helper errors.
- MipAxis
- Projection axis for a 3D volume stored as stacked 2D slices.
- Radiomics
Error - Shared radiomics error for the radiomics submodule.
- TopHat
Kind - Top-hat polarity.
Constants§
- DEFAULT_
HE_ TARGET_ MEAN - Approximate H&E appearance targets in CIE Lab (D65).
- DEFAULT_
HE_ TARGET_ STD - Companion std for
DEFAULT_HE_TARGET_MEAN. - GLCM_
LEVELS_ 16 - Common quantization levels for radiomics GLCM.
- GLCM_
LEVELS_ 32 - MAX_
FRAME_ DETS - Max detections considered per frame (association scratch).
- MAX_
NUCLEUS_ LABELS - Maximum distinct labels tracked in one pass (stack/table bound).
- MAX_
OD_ LABELS - Maximum distinct nucleus labels for OD aggregation.
- MAX_
PARTICLES_ PER_ FRAME - Maximum particles reported from a single frame (stack-friendly bound for callers).
- MAX_
PARTICLE_ TRACKS - Maximum simultaneous active tracks.
- NO_
TRACK_ ID - Sentinel: detection not assigned a track.
- PHI_
TAG_ KEYS - PHI / identity tags zeroed or replaced with a fixed placeholder.
Functions§
- anonymize_
tag_ map - Zero/redact known PHI keys in
map(in place). - apply_
background_ correct - Correct RGB illumination:
out = clamp(rgb * 255 / bg, 0..255)per channel. - apply_
hu_ window_ f32 - Window/level on
f32intensity (HU or similar) →u8display. - apply_
hu_ window_ i16 - Window/level on
i16HU values →u8display. - background_
intensity_ sample - Sample background as the mean RGB of pixels whose luminance is at or above
the given percentile (e.g.
percentile = 95.0→ top ~5% brightest). - centroid_
from_ bbox - Centroid of a bounding box (integer mid-point) — convenience for box→particle bridges.
- centroids_
from_ binary - Extract centroids of connected components where pixel ≥
thresh(4-connected). - centroids_
from_ labels - Extract centroids from a pre-labelled
u8mask (label 0 = background). - crocker_
grier_ link - Free-function Crocker–Grier link over compact
Detection2rows. - extended_
minima - Compute extended minima of a gray topographic surface.
- first_
order_ stats - Compute first-order stats over
samples(gray / intensity ROI values). - glcm_
features - Compute GLCM features on a 2D gray image at distance 1 with 16 levels (default).
- glcm_
features_ d1 - Compute GLCM features on a 2D gray image at distance 1.
- hu_
window_ i16 - Window/level on
i16HU values →u8display. - intensity_
to_ od_ u8 - Map brightfield intensity to an 8-bit optical-density-like value.
- 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.
- lab_
to_ rgb - Convert interleaved Lab f32 to packed RGB8.
outlength ≥lab.len(). - link_
particles - One-shot convenience: link a full detection list with fresh linker state.
- macenko_
deconvolution - Macenko deconvolution.
- mip_
project_ axis - Max-intensity project a 3D volume of
f32voxels. - mip_
project_ z - MIP along Z (classic axial max-intensity projection).
- morphological_
tophat - Morphological top-hat into caller buffer (
width * heightbytes). - nucleus_
features - Extract geometric features for each labeled nucleus region.
- optical_
density_ rgb - Convert packed RGB8 intensities to optical density (f32, same layout).
- otsu_
threshold_ from_ hist - Otsu threshold for a Gray8 histogram (returns 0 if image empty / single-tone).
- parse_
dicom_ tags_ basic - Scan
bytesfor common DICOM tags (little-endian explicit VR). - positive_
od_ threshold - Compute Ki-67-style positive index from a gray channel and nucleus label map.
- reinhard_
normalize - Reinhard-normalize packed RGB8 toward
targetLab stats (or H&E defaults ifNone). - rgb_
to_ lab - Convert packed RGB8 to interleaved Lab f32.
outlength ≥rgb.len(). - shape_
2d_ features - Extract 2D shape from a binary mask (
nonzero= object). - shape_
2d_ from_ mask - Extract 2D shape from a binary mask (
nonzero= object). - shape_
3d_ from_ voxels - Extract 3D shape from a sparse list of voxel coordinates.
- snmf_
unmix_ lite - Unmix packed RGB into non-negative concentrations via multiplicative updates.
- spectral_
unmix_ nnls - Unmix one observed spectrum
y(lengthn_channels) against endmember matrixendmemberslaid out as column-major: componentkoccupiesendmembers[k * n_channels .. (k+1) * n_channels]. - spectral_
unmix_ roi_ mean - Mean the ROI spectra then unmix once (cheap path for bulk regions).
- suv_bw
- Convenience: SUV_bw from activity concentration, injected activity (Bq), body weight in kg, and decay factor.
- suv_
from_ activity - Body-weight SUV (SUV_bw).
- voronoi_
otsu_ label - Voronoi–Otsu label map: split touching bright objects.
- watershed_
markers - Marker-controlled watershed.
Type Aliases§
- Dicom
TagMap - Simple string-valued attribute map after parse/anonymize.