itkwasm_dicom.write_segmentation

Module Contents

Functions

write_segmentation

Write DICOM segmentation object.

API

itkwasm_dicom.write_segmentation.write_segmentation(seg_image: itkwasm.Image, meta_info: Any, output_dicom_file: str, ref_dicom_series: List[os.PathLike] = [], skip_empty_slices: bool = False, use_labelid_as_segmentnumber: bool = False) os.PathLike

Write DICOM segmentation object.

Parameters:
  • seg_image (Image) – dicom segmentation object as an image

  • meta_info (Any) – JSON file containing the meta-information that describesthe measurements to be encoded. See DCMQI documentation for details.

  • output_dicom_file (str) – File name of the DICOM SEG object that will store theresult of conversion.

  • ref_dicom_series (os.PathLike) – List of DICOM files that correspond to the original.image that was segmented.

  • skip_empty_slices (bool) – Skip empty slices while encoding segmentation image.By default, empty slices will not be encoded, resulting in a smaller output file size.

  • use_labelid_as_segmentnumber (bool) – Use label IDs from ITK images asSegment Numbers in DICOM. Only works if label IDs are consecutively numbered starting from 1, otherwise conversion will fail.