moloney / dcmstack

DICOM to Nifti conversion with meta data preservation
Other
72 stars 52 forks source link

support for python 3 #43

Closed satra closed 6 years ago

satra commented 8 years ago

is there a plan to support python 3?

  File "/users/satra/miniconda3/envs/banda/lib/python3.5/site-packages/dcmstack/dcmstack.py", line 1054
    except Exception, e:
TheChymera commented 8 years ago

@moloney I am providing your software for Gentoo Linux, and I'd also be interested to know whether it will continue to be developed.

TheChymera commented 8 years ago

@moloney @satra I tested the code from master on Gentoo - it seems to work well with python 3 given the changes in #45 .

cbrnr commented 8 years ago

FYI, https://github.com/icometrix/dicom2nifti works fine in Python 3. I wonder if it makes sense to join efforts and try to go for one working dicom to nifti converter for Python... at the moment this seems to be dicom2nifti. Maybe worth a separate issue if there is interest?

satra commented 8 years ago

@cbrnr - thanks for the pointer - it indeed looks promising and they even have a bunch of tests and uses nibabel. @yarikoptic, @matthew-brett, @moloney - what do you all think?

having a clean python dicom metadata reader and converter would be very useful. there are a lot of clinical use-cases where we need to take analysis output and convert it back to dicom. so having that chain available within the python ecosystem would be nice.

matthew-brett commented 8 years ago

How about a Google hangout in the near future?

cbrnr commented 8 years ago

@matthew-brett OK, good idea. Maybe we should start to put forward some ideas that people have. IMHO, the best way to proceed would be to integrate DICOM support directly into nibabel - from a user's perspective, there's no reason why DICOM should be treated separately by a different package. Also everything is already there in dcmstack and dicom2nifti (which both use nibabel functionality). Comments?

@satra my use case is fMRI analysis, so I'm more concerned with a decent DICOM reader (and/or converter to Nifti). Ideally, nibabel should be able to load DICOM images just like any other format. Once the data is in an image object, users can write the result into a Nifti file if they want.

cbrnr commented 8 years ago

Also, @abrys and @dloeckx, what are your thoughts?

cbrnr commented 7 years ago

Here's a quick update: it seems like dicom2nifti does not populate all NIfTI header fields, whereas everything looks fine with dcmstack. The following fields are affected:

dim_info, datatype, pixdim, xyzt_units

dicom2nifti shows 0 for dim_info and xyzt_units; unit16 instead of int16 for datatype, and [-1. 1. 1. 1. 1. 1. 1. 1.] instead of [ -1. 1. 1. 1. 1560. 1. 1. 1.] (in the latter two values, I guess the ones from dcmstack are correct).

ghisvail commented 7 years ago

Trying to run the dcmstack from a Python 3 venv fails with many Python 2 related syntax problems (Exception, print et al). So, nope not fully Python 3 compatible yet.

vsoch commented 7 years ago

+1 on python 3 support