brainvisa / axon

Brainvisa main GUI
Other
0 stars 1 forks source link

Graph load and converted, has a different type #48

Closed Hboni closed 3 years ago

Hboni commented 3 years ago

I tried to use the graphToVolume.py process in the Tools toolbox in brainvisa.In my development environment, which is not fully up-to-date, I do not have any problem. In my tests, I convert a Graph and data file, which corresponds to a .arg file with only one volume, into a nifti file.

I compiled a new casa-distro from scratch, and when I use the same process with the same values I get an error :

Traceback (most recent call last):

  [ ... ]

  File "/casa/host/build/python/brainvisa/processes.py", line 3107, in runProcess
    result = self._processExecution(_process, None)
  File "/casa/host/build/python/brainvisa/processes.py", line 3389, in _processExecution
    result = process.execution(self)
  File "/casa/host/build/brainvisa/toolboxes/tools/processes/converters/graphToVolume.py", line 112, in execution
    raise RuntimeError(_t_('the ROI graph contains no voxel data'))
RuntimeError: the ROI graph contains no voxel data

I looked at the corresponding lines and tried to understand why it no longer works: https://github.com/brainvisa/axon/blob/47642d524ef59aa58ec203b3e6974593f45c0c99/brainvisa/toolboxes/tools/processes/converters/graphToVolume.py#L96-L105

It appears that the bucket2Volume() method complete the graph object with a aims.rc_ptr_AimsData_S16 in my "old" version, but with a aims.carto.Object in my up-to-date version.

I was wondering if it is possible to have the same type as before, or if the two types are equivalents?

P.S: after some local modification to try to select the good key with aims.carto.Object, and I have another issue AttributeError: 'GenericObject' object has no attribute 'dimX'

denisri commented 3 years ago

That's true: first this process needs to be updated (we changed the internal representation using Volume instead of the old AimsData classes, and there were missing conversion functions from generic objects in the Volume classes. I'm fixing that.

Hboni commented 3 years ago

Thanks, it works well now :tada: