Mouse-Imaging-Centre / pyminc

A python interface to the MINC 2 library, allowing use of numpy arrays to access MINC data, and other such similar goodies, developed by Jason Lerch
http://en.wikibooks.org/wiki/MINC/Tutorials
Other
13 stars 8 forks source link

mincException when trying factory.volumeLikeFile with 4D file. #23

Open sulantha2006 opened 8 years ago

sulantha2006 commented 8 years ago

Hi, I am trying to write a 4D file using a reference 4D file. However, I am getting a mincException with no details. I believe it is an issue with the header of the 4D file. I will attach the reference file here.

Error:

Traceback (most recent call last): File "4dWrite.py", line 2, in _h = fc.volumeLikeFile('A1795dynres_nlinatlas.mnc', '4dWrite.mnc') File "/home/sulantha/anaconda3/lib/python3.5/site-packages/pyminc/volumes/factory.py", line 35, in volumeLikeFile labels=labels, data=data) File "/home/sulantha/anaconda3/lib/python3.5/site-packages/pyminc/volumes/factory.py", line 17, in volumeFromInstance v.createVolumeHandle(volumeType or volInstance.volumeType) File "/home/sulantha/anaconda3/lib/python3.5/site-packages/pyminc/volumes/volumes.py", line 610, in createVolumeHandle testMincReturn(r) File "/home/sulantha/anaconda3/lib/python3.5/site-packages/pyminc/volumes/volumes.py", line 21, in testMincReturn raise mincException pyminc.volumes.volumes.mincException /export/scratch01/vfonov/src/minc-toolkit/libminc/libsrc2/volume.c:1434 (from MINC2): Error: Trying to close null volume Exception ignored in: <bound method mincVolume.del of <pyminc.volumes.volumes.mincVolume object at 0x7f51262533c8>> Traceback (most recent call last): File "/home/sulantha/anaconda3/lib/python3.5/site-packages/pyminc/volumes/volumes.py", line 691, in del self.closeVolume() File "/home/sulantha/anaconda3/lib/python3.5/site-packages/pyminc/volumes/volumes.py", line 678, in closeVolume testMincReturn(r) File "/home/sulantha/anaconda3/lib/python3.5/site-packages/pyminc/volumes/volumes.py", line 21, in testMincReturn raise mincException pyminc.volumes.volumes.mincException:

Link to ref file : https://drive.google.com/open?id=0B-TWCTRv7UM1bGpYTlVlWmpOSW8

gdevenyi commented 8 years ago

Hi,

Can you provide a reproducible code example which triggers the problem. Thanks!

sulantha2006 commented 8 years ago

h = fc.volumeLikeFile('A1795dynres_nlinatlas.mnc', '4dWrite.mnc') This line triggers the problem. I attached a link to the reference file in the original issue.

gdevenyi commented 8 years ago

Hi,

Can you provide a complete reproducible example?

sulantha2006 commented 8 years ago

import pyminc.volumes.factory as fc h = fc.volumeLikeFile('A1795dynres_nlinatlas.mnc', '4dWrite.mnc')

This code is complete and it produces the error.

gdevenyi commented 8 years ago

Hi,

This appears to be NOTABUG with pyminc, but rather with minc-toolkit.

I just tried with pyminc/0.47 and minc-toolkit-v2 HEAD of the devel branch.