Join GitHub today
Finding ways to modify tags in order to avoid error #599
I am trying to get pixel_data from some dicom images but get an error AttributeError: Amount of pixel data 20145932 does not match the expected data 20145931.
I'm using cbis-ddsm( Digital Database for Screening Mammography ) for research, and I guess this error is due to a conflict in the header file of dicom images in this database.
(0028, 0010) Rows US: 5941
As you can see in these tags: 5941*3391 = 20145931 which is not equal to (7fe0, 0010).
I can open these images via ImageJ, therefore the pixel data must be intact. Anyone can help me change (7fe0, 0010) Pixel Data?
Other solutions are greatly appreciated. Thank you.
Steps/Code to Reproduce
RefDs = pydicom.read_file('F:\data_tmp\masks\P_00019_RIGHT_CC_1_MASK.dcm')
pixel_value as numpy array
I think the GDCM handler is OK as it trims the padding around line 156 before checking... I think I must have just copied the length checking code from GDCM to numpy when we refactored the data handlers out. There must have been some reason, but I can't find it in the history. I am not going to take it out just in case. I will add a fix for padding to the numpy handler.