Quality-control Dashboards

Interactive viewer in Jupyter Notebook

Viewer interface example

Example of the IMPERANDI interactive viewer interface in a Jupyter Notebook.

class imperandi.qc.viewer.CTScanViewer(df, ct_scan_col, segmentation_cols=None, phase_col=None, HU_min=-100, HU_max=400, exploration_mode='ordered', isotropic_resolution_mm=1.0)[source]

Bases: object

Interactive Jupyter viewer for CT volumes and segmentation overlays.

The viewer navigates cohort rows, patients, exams, phases, and anatomical planes while applying configurable HU windows and isotropic resampling.

init_widgets()[source]
load_data()[source]
on_center_on_lesion(button)[source]
on_date_change(change)[source]
on_key_press(event)[source]
on_next(button)[source]
on_next_date(button)[source]
on_next_patient(button)[source]
on_next_slice_manual(button)[source]
on_patient_change(change)[source]
on_phase_change(change)[source]
on_plane_change(change)[source]
on_prev(button)[source]
on_prev_date(button)[source]
on_prev_patient(button)[source]
on_prev_slice(button)[source]
on_resolution_change(change)[source]
on_seg_visibility_change(change)[source]
on_slice_change(change)[source]
on_window_preset_change(change)[source]
update_display(*_)[source]
update_info_display()[source]
update_slice_slider()[source]
imperandi.qc.viewer.clip_hu_values(ct_scan, min_hu, max_hu)[source]

Clip the Hounsfield Unit (HU) values of the CT scan.

imperandi.qc.viewer.load_nifti(file_path, orientation='LAS', isotropic_resolution_mm=1.0, order=1)[source]

Load a NIfTI file, orient it, and resample to isotropic display spacing.

Viewer resampling helpers

imperandi.qc.viewer_resample.load_nifti_isotropic(file_path, orientation='LAS', resolution_mm=1.0, order=1)[source]

Load, orient, and resample a NIfTI volume for isotropic display.

imperandi.qc.viewer_resample.load_oriented_nifti(file_path, orientation='LAS')[source]

Load NIfTI data and voxel spacing after applying viewer orientation.

imperandi.qc.viewer_resample.resample_to_isotropic(data, spacing, resolution_mm, order=1)[source]

Resample 3D data to isotropic voxel spacing for display.

imperandi.qc.viewer_resample.validate_isotropic_resolution(value)[source]

Validate and return a positive finite display resolution in millimetres.