ofgulban / bvbabel

A lightweight Python library for reading & writing BrainVoyager file formats.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

VMP writing a single map results in error

27-apizzuti opened this issue · comments

Hi @ofgulban ,
while trying to save a .vmp file (vmp.write_wmp) with a single map I got the following error:

Traceback (most recent call last):

  File "<ipython-input-11-c03dcbcc2ac7>", line 3, in <module>
    bvbabel.vmp.write_vmp(OUTNAME, new_vmp_header, new_vmp_voi)

  File "C:\Users\apizz\miniconda3\lib\site-packages\bvbabel-0.0.2-py3.8.egg\bvbabel\vmp.py", line 413, in write_vmp
    data_img = data_img[::-1, ::-1, ::-1, :]  # Flip BV axes

IndexError: too many indices for array

By default it expects multiple maps. My work around solution was to create a 4D array and add 'None' to the last dimension.