suever / pydicom-experimental

pydicom test
0 stars 1 forks source link

TransferSyntaxUID not set on Dataset if there is no meta info in dicom file #77

Closed suever closed 9 years ago

suever commented 9 years ago

From mikewall...@gmail.com on February 16, 2010 21:04:21

What steps will reproduce the problem? 1. dcm = dicom.read_file('CR-MONO1-10-chest')

  1. dcm.pixel_array What is the expected output? What do you see instead? Expected: numpy array of pixel data Actual: dicom.dataset.PropertyError: AttributeError in pixel_array property: Dataset does not have attribute 'TransferSyntaxUID' What version of the product are you using? 0.94

If there is no meta info in the file, pydicom assumes little endian transfer syntax and implicit VR. These assumptions are not written to the file_meta attribute of the Dataset, which means they cannot be used downstream (in this case, when trying to convert the pixel data to a numpy array).

Have fixed this by setting the TransferSyntaxUID attribute of file_meta_dataset in the no header branch of the read_partial method of filereader.py (patch attached).

Attachment: filereader.py.patch CR-MONO1-10-chest

Original issue: http://code.google.com/p/pydicom/issues/detail?id=77

suever commented 9 years ago

From darcymason@gmail.com on February 16, 2010 19:10:02

This issue was closed by revision f2321645d9 .

Status: Fixed
Mergedinto: -