PennLINC / ConFixel

Companion converter software for ModelArray for converting data back and forth from the HDF5 file format.
BSD 3-Clause "New" or "Revised" License
0 stars 2 forks source link

Convoxel KeyError #37

Closed ClementGuichet closed 1 year ago

ClementGuichet commented 1 year ago

Hi,

I'm getting a KeyError: 'source_file' when running the convoxel command although the input csv is organized according to the doc. Am I missing something ?

image

zhao-cy commented 1 year ago

Hi @ClementGuichet ! Thank you for contacting us! Could I confirm with you that you've included a column called source_file in the CSV file? Make sure that in your CSV, this column name is in lower cases. And I assume you've followed the guides in this markdown file for ConVoxel?

If above are all confirmed by you, that'll be pretty weird to see such error - I would probably like to see the first several rows of your CSV. You may hash your subject IDs if needed.

Thank you, Chenying

ClementGuichet commented 1 year ago

Yes exactly, I followed the markdown. I'm running ConVoxel on WSL which is prone to error, I may try on my Linux machine if this doesn't work out.

<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40">

scalar_name | source_file | source_mask_file | subject_id | age -- | -- | -- | -- | -- TW_FA | ./TW_FA/sub_1.nii | ./TW_FA_Gaussian70_155subj_mean_mask.nii | sub_1 | 45 TW_FA | ./TW_FA/sub_2.nii | ./TW_FA_Gaussian70_155subj_mean_mask.nii | sub_2 | 47 TW_FA | ./TW_FA/sub_3.nii | ./TW_FA_Gaussian70_155subj_mean_mask.nii | sub_3 | 48

ClementGuichet commented 1 year ago

Issue resolved

The KeyError was due to a weird encoding by excel when exporting to csv format (semicolon instead of commas). It worked fine after importing and writing out a new csv file via R.

Thanks for your help !

zhao-cy commented 1 year ago

Oh wow, that's a great catch and thank you for sharing this with me!

Cheers, Chenying