[Code 0] Internal Error: Cannot read property 'HED' of null

I have some questions regarding the issue I am having when I check the validation of my dataset, converted with my custom tool from Bruker MRI data. This issue is not showing when I check the box for ‘Ignore NifTi header’. The error message does not point out anything, but it just says an internal error occurred. The file indication is shown as ‘NaN KB |’

with the error message of -> Cannot read property ‘HED’ of null; please help the BIDS team and community by opening an issue at (https://github.com/bids-standard/bids-validator/issues) with the evidence here.

I’ve used the website, so the version will be, I assumed, up to date (1.5.2).

The file converted with Python module I developed, which I had open a pull request #125 to be added on bids-webpage. And I’ve used the ‘to_filename’ method on nibabel to dump the Nifti1Image object to file.

If any additional information required to clarify the cause of the issue, please let me know. I would appreciate all of your help!

Do you have any events.tsv files? If so could you post an example of one of them, are there any subjects that don’t have an events.tsv file, or are any of the events files completely empty?

@rwblair Thank you for responding on this. I have no event file since its all resting state. Is there any header file that validator parsing from Nifti file? If so , I may trying to remove or add them to test if it caused bu something in the header?

@rwblair I think I found where this error come from. It seems the code ‘hed.js’ loading both the header from nifti and json together to check their data type matching, then it crushed when one of them (in my case, in json) has null value.

I put to my converter uses the all recommended ‘key-value’ for BIDS standard, which is several data is not accessible from the raw data, and returned None in python and converted to null when I dump the json file. After I remove this field, then error was gone. so I think it causes this error (only at hed.js?).

Ah good this makes sense. Can you post an example of the json if you still have it so I can use it as a test for fixing the check in hed.js that’s failing?

@rwblair
Here is the file, I also added with the paired subject .nii file as tell for your testing.
link for example data

1 Like