How to write DICOM file from array in Python?
I am writing a code that creates DICOM file from array in Python. So the function takes 3D array and creates DICOM for each slice in z-dimension.
When I read the created DICOM files with pydicom, it gives me error:
The length of the pixel data in the dataset (524288 bytes) doesn’t match the expected length (5242880 bytes). The dataset may be corrupted or there may be an issue with the pixel data handler.