Utilities

Pixel Data

voxel.utils.pixel_data.apply_rescale

Apply a rescale to a volume.

voxel.utils.pixel_data.apply_window

Apply a window to a volume.

voxel.utils.pixel_data.invert

Invert the pixel values in a volume.

voxel.utils.pixel_data.pixel_dtype

Detect the NumPy dtype of the data in a header.

voxel.utils.pixel_data.pixel_range

Get the pixel range of a DICOM dataset.

Collect Env

voxel.utils.collect_env.collect_env_info

Collect environment information for reporting issues.

Env

voxel.utils.env.package_available

Returns if package is available.

voxel.utils.env.get_version

Returns package version.

Logger

voxel.utils.logger.setup_logger

Initialize the voxel logger.

If you do not want logging messages to display on your console (terminal, Jupyter Notebook, etc.), the code below will only log messages at the ERROR level or higher:

>>> import logging
>>> voxel.utils.logger.setup_logger(stream_lvl=logging.ERROR)