loli / medpy

Medical image processing in Python
http://loli.github.io/medpy/
GNU General Public License v3.0
559 stars 136 forks source link

medpy is NOT compatible with LATEST pydicom? #85

Closed jiapei100 closed 5 years ago

jiapei100 commented 5 years ago

After a trivial modification from dicom to pydicom in 2 files,

io/load.py
io/header.py

I still got the following 2 ERROR messages:

➜  Medical python 02_medpy.py
Traceback (most recent call last):
  File "~/.local/lib/python3.6/site-packages/medpy/io/header.py", line 95, in get_offset
    return __get_offset_pydicom(hdr)
  File "~/.local/lib/python3.6/site-packages/medpy/io/header.py", line 269, in __get_offset_pydicom
    return tuple(map(float, hdr.ImagePositionPatient)[:2])
TypeError: 'map' object is not subscriptable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "02_medpy.py", line 14, in <module>
    header.get_offset(image_header)
  File "~/.local/lib/python3.6/site-packages/medpy/io/header.py", line 101, in get_offset
    raise AttributeError('The provided header {} is of unknown type or does not support queries for offsets.'.format(type(hdr)))        
AttributeError: The provided header <class 'pydicom.dataset.FileDataset'> is of unknown type or does not support queries for offsets.

Any plan to upgrade medpy to be compatible with pydicom 1.2.2 ??

Cheers

loli commented 5 years ago

MedPy 0.3.0 from PyPi is not compatible with Python3.

Please pull the current master branch from GitHub, which is transitioning to Python3 right now. And thanks for reporting the error, this one escaped us before (fixed with a1e7d11).

Let me now if you encounter any further errors.

loli commented 5 years ago

For the import problem: It should be fixed and the required pydicom version in the setup.py increased.

loli commented 5 years ago

Least required version should be set to: https://github.com/pydicom/pydicom/releases/tag/v1.0.2

loli commented 5 years ago

Fixed with 7e9c0b4