Skip to content Skip to sidebar Skip to footer

Create A Dicom From Multiple Jpg Images

I've successfully built dicoms with one images but I cannot find a way to add more... I think the problem may be in my pixel array, can anyone help me correct it ? # Populate requi

Solution 1:

Pixel Data should be bytes. If your transfer syntax is uncompressed then you need to concatenate the data together and if the length of the concatenated data is odd then you must add a trailing padding byte:

# For uncompressed transfer syntaxes only!
pixel_data = b"".join(pixel_data_list)
ds.PixelData = pixel_data + b"\x00"iflen(pixel_data) % 2else pixel_data

For compressed transfer syntaxes you must use encapsulation

Post a Comment for "Create A Dicom From Multiple Jpg Images"