ofgulban / bvbabel

A lightweight Python library for reading & writing BrainVoyager file formats.
MIT License
20 stars 11 forks source link

An issue in read_fmr #55

Open kenshukoiso opened 6 months ago

kenshukoiso commented 6 months ago

Hi Faruk,

Thank you so much for always solving my issues!

I am facing an issue that when I read fmr and write nifti with your example script, it looks like the image below. (Matrix dimension is messed up.) The thing is for most of the data it works perfectly, but for some data (maybe peculiar scanning setup data). I will send you this fmr/stc file via email.

Thank you so much in advance!

Best regards, Kenshu

read_fmr_write_nifti
kenshukoiso commented 6 months ago

I couldn't send it via email due to its large data size so I uploaded it here.

ofgulban commented 6 months ago

Thanks for posting this issue @kenshukoiso , Upon inspection, it seems that your FMR header has x and y dimensions mixed up somehow. As a general advice, please use the latest version of BrainVoyager if you are creating these fmr files from dicom directly in BrainVoyager.

Nevertheless, I have created a new example to show how you can have lower level access to the FMR data (voxel values), that are the STC files which comes coupled with FMRs. For this, see 0d90ca82f44fb1ae0e5d28c00fe10910694be4df . Direct access to STC files requires you to figure out the data dimensions manually. However, once done you can correctly convert your data to nifti (see below.)

Screenshot 2024-05-18 at 10 25 20 Screenshot 2024-05-18 at 10 24 46