flashdrr.utils

Lightweight utilities for volumetric tensors. This module no longer contains transfer-function texturing helpers — transfer functions now live in :mod:flashdrr.rendering (see :func:piecewise_linear_channelwise).

make_nd

flashdrr.utils.make_2d(t)[source]
flashdrr.utils.make_3d(t)[source]
flashdrr.utils.make_4d(t)[source]

Prepends singleton dimensions to t until 4D

flashdrr.utils.make_5d(t)[source]

Prepends singleton dimensions to t until 5D

flashdrr.utils.make_nd(t, n)[source]

Prepends singleton dimensions to t until n-dimensional

normalize_hounsfield

flashdrr.utils.normalize_hounsfield(vol, dtype=None)[source]

Normalizes vol by 4095 and clamps to [0,1]. dtype=None defaults to 32-bit float

normalize_voxel_scale

flashdrr.utils.normalize_voxel_scale(vol, vox_scl)[source]