read_mhd#
- medicalimageanalysis.read_mhd(file=None, modality=None, reference_name=None, moving_name=None, roi_name=None, dose=None, dvf=None)[source]
Load an MHD (MetaImage) file using MhdReader.
- Parameters:
file (str | None) – Path to the MHD file.
modality (str | None) – Imaging modality (e.g., CT, MR).
reference_name (str | None) – Name of the reference image for registration workflows.
moving_name (str | None) – Name of the moving image for registration workflows.
roi_name (str | None) – ROI name to associate with this image.
dose (optional) – Dose object to associate with this image.
dvf (optional) – Deformation vector field (DVF) to associate with this image.
- Return type:
None
Examples
Load a basic MHD image:
>>> read_mhd(file='C:/Data/scan.mhd')
Load an MHD with modality labeling:
>>> read_mhd( ... file='C:/Data/scan.mhd', ... modality='CT', ... )
Load MHD for registration workflow:
>>> read_mhd( ... file='C:/Data/fixed.mhd', ... reference_name='FixedImage', ... moving_name='MovingImage', ... )
Load MHD and associate ROI and dose:
>>> read_mhd( ... file='C:/Data/scan.mhd', ... roi_name='PTV', ... dose=dose_object, ... )