Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rearraging data axes when converting VTC and VMP to NIFTI #17

Open
27-apizzuti opened this issue Sep 27, 2022 · 3 comments
Open

Rearraging data axes when converting VTC and VMP to NIFTI #17

27-apizzuti opened this issue Sep 27, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@27-apizzuti
Copy link

27-apizzuti commented Sep 27, 2022

Hi Faruk,

I am trying to convert Brainvoyager's .VTC and .VMP outputs in NIFTI using your read_vtc_export_nifti.py and read_vtc_export_nifti.py scripts from the example folder. Unfortunately, the exported NIFTIs don't overlap when opened in an external software.

My current solution for the VTC:

header, data = bvbabel.vtc.read_vtc(FILE, rearrange_data_axes=False)
new_data = np.transpose(data, (0, 2, 1, 3))
new_data = new_data[::-1, ::-1, ::-1, :]

Alessandra

@ofgulban
Copy link
Owner

ofgulban commented Sep 27, 2022

Thanks for the issue @27-apizzuti ,

I have incorporated these changes to read_vtc_export_nifti.py example with 5d176a7.

I need to test rearrange_data_axes=True option with different vtc inputs to make sure the data aligns with nibabel's RAS+ output.

@ofgulban
Copy link
Owner

@jorievanharen maybe have a look at this change and see if the latest bvbabel effects your previous VTC conversions. Right now the safest route is to use rearrange_data_axes=False option and doing your own axes transpose and flipping if needed.

It will take some time to converge a general solution for rearrange_data_axes=True option. As I am seeing conflicting information and input/output relations in the documentations and example vtc files.

@ofgulban ofgulban changed the title Convert VTC and VMP in NIFTI format Rearraging data axes when converting VTC and VMP to NIFTI Sep 27, 2022
@ofgulban ofgulban added the bug Something isn't working label Sep 27, 2022
ofgulban added a commit that referenced this issue Sep 27, 2022
@ofgulban
Copy link
Owner

ofgulban commented Feb 21, 2023

TODO: I need to implement rearrange_axes flag for VMP and GLM read write functions (in addition to VTC).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants