dicom_converter.utils.dicom_to_img

Created on Wed Sep 1 15:44:11 2021

Module with functions used to convert DICOM files (.dcm) to .png/.bmp and .json files and from .png/.bmp to DICOM.

The function ‘compress_to_png’ calls executables from OpenJPEG (https://www.openjpeg.org/) available at ‘https://github.com/uclouvain/openjpeg/releases/tag/v2.4.0’.

Functions

compress_to_png(file_path, software_root[, …])

Compresses an image to a .png with a specified ‘compress_ratio’

decompose_dicom(file_path, output_path[, …])

Divides dicom file into a .json file with the dicom metadata and a .’img_format’ file containing the image.

dicom_from_img_or_json(file_path, output_folder)

Creates a dicom from a .json file or a .png/.bmp file

get_tag_from_json(json_path, tag)

Get tag value from .json fiel containing DICOM metadata

img_from_dicom(ds)

Extract array from dicom dataset ‘dcm’ with [0,256] pixel intensities.