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

pyminc crashes on files without a history attribute #9

Closed mcvaneede closed 10 years ago

mcvaneede commented 10 years ago

Currently if you run for instance minc_label_ops on a MINC file that has no history attribute, you get an error message related to getHistory. See for an example below. Correct behavior would be to check whether the history attribute is present, and if not to create one.

Traceback (most recent call last): File "/projects/mice/share/arch/linux-precise/bin/minc_label_ops", line 43, in inlabels = volumeFromFile(args[0], dtype='ushort') File "/projects/mice/share/arch/linux-precise/python/pyminc/volumes/factory.py", line 8, in volumeFromFile v.openFile() File "/projects/mice/share/arch/linux-precise/python/pyminc/volumes/volumes.py", line 323, in openFile self.history = self.getHistory(size=999999) File "/projects/mice/share/arch/linux-precise/python/pyminc/volumes/volumes.py", line 438, in getHistory testMincReturn(r) File "/projects/mice/share/arch/linux-precise/python/pyminc/volumes/volumes.py", line 14, in testMincReturn raise mincException pyminc.volumes.volumes.mincException