BIDS dataset validator OpenNeuro: Errors

Dear Sir or Madam,

I am trying to validate my dataset with the OpenNeuro BIDS validator and I have some errors. Because of that, I have tried also to perform the validation with a OpenNeuro dataset which is already validated [ [Flavour Pleasantness (Regular Products) - Snapshot 00001 - OpenNeuro] OpenNeuro)], but I keep having the same error.

Why do I obtain an error with the cited dataset if it is already validated?

This are my errors:

1.-Invalid JSON file. The file is not formatted according the schema.

2.-Files with such naming scheme are not part of BIDS specification. This error is most commonly caused by typos in file names that make them not BIDS compatible. Please consult the specification and make sure your files are named correctly. If this is not a file naming issue (for example when including files not yet covered by the BIDS specification) you should include a “.bidsignore” file in your dataset (see GitHub - bids-standard/bids-validator: Validator for the Brain Imaging Data Structure for details). Please note that derived (processed) data should be placed in /derivatives folder and source data (such as DICOMS or behavioural logs in proprietary formats) should be placed in the /sourcedata folder.

Thank you in advance.

You should copy the whole error message so we know what files are not BIDS compliant.

How did you make your nifti files? Dcm2niix is usually a safe bet, and will automatically make the JSON files.

Are you using the most up to date version of the validator (I think 1.5.8 at time of writing)?

Could you provide an example directory structure for a single subject?

Thanks,
Steven

Thanks for your response,

I made the BIDs structure using clinica software that uses Dcm2niix package. Also, I am validating using the BIDs validator of OpenNeuro so I dont know which files are not BIDs compliant.

Error: 18

Files with such naming scheme are not part of BIDS specification. This error is most commonly caused by typos in file names that make them not BIDS compatible. Please consult the specification and make sure your files are named correctly. If this is not a file naming issue (for example when including files not yet covered by the BIDS specification) you should include a “.bidsignore” file in your dataset (see GitHub - bids-standard/bids-validator: Validator for the Brain Imaging Data Structure for details). Please note that derived (processed) data should be placed in /derivatives folder and source data (such as DICOMS or behavioural logs in proprietary formats) should be placed in the /sourcedata folder.

Also I obtain the following error. Notice that my dataset is from ADNI and a convert it using the clinica software to BIDs structure.

Error: 61 file

_T1w.nii[.gz] files must have exactly three dimensions.

Example tree of a single subject:

├── conversion_info-20210127T160753Z-001
│ └── conversion_info
│ ├── amyloid_pet_paths.tsv
│ ├── dwi_paths.tsv
│ ├── fdg_pet_paths.tsv
│ ├── flair_paths.tsv
│ ├── fmri_paths.tsv
│ ├── pib_pet_paths.tsv
│ ├── t1_paths.tsv
│ └── tau_pet_paths.tsv
├── participants.tsv
└── sub-ADNI013S6768-20210127T155656Z-001
└── sub-ADNI013S6768
├── ses-M00
│ ├── anat
│ │ └── sub-ADNI013S6768_ses-M00_T1w.nii.gz
│ ├── dwi
│ │ └── sub-ADNI013S6768_ses-M00_acq-axial_dwi.nii.gz
│ ├── func
│ │ └── sub-ADNI013S6768_ses-M00_task-rest_bold.nii.gz
│ └── sub-ADNI013S6768_ses-M00_scans.tsv
└── sub-ADNI013S6768_sessions.tsv

The full error message should also spit out the names of files that are not bids compliant.

The BIDS directory itself should have the following folders: sourcedata (where raw data are stored, like dicoms or pre-converted niftis), code (code used for anything on the project), derivatives (further processing done on the bids data), stimuli (if applicable), and one folder for each subject (sub-ADNIXXXX). There should also be a README, dataset_description.json, and participants.tsv (w/ participants.json).

So that convension_info folder is not bids compliant, and may belong in sourcedata. Also, you may want to run dcm2niix with the -b y argument to generate the BIDS sidecar json files, as I am not seeing any in the subject folders. But the one subject you show here has the correct naming conventions for the niftis and other tsv.

Not sure what to make of that T1 error. Can you open it in a visualization program like fslview/fsleyes/freeview?

Hi and thanks for your response!

Taking into account that error: _T1w.nii[.gz] files must have exactly three dimensions I dont know how I can solve it. I used a niiviewer to visualize the brain image and it works. But then the BIDs validator give me that error of dimensios.

How can I solve it?

Thanks

Can you confirm you are using the latest version of bids-validator? I ask because others have had this issue but I think it was fixed in a subsequent release. XXX_FILE_WITH_TOO_MANY_DIMENSIONS · Issue #565 · bids-standard/bids-validator · GitHub

I want to upload my dataset to OpenNeuro so I am using the bids validator that offers OpenNeuro.
I suppose that is the latest version the ones that provides OpenNeuro.

Can you type in bids-validator --version and tell me what it is?

Hello again,

First of all, I would like to thank you for all the help you have offered me. However, I think that you are not understanding how I am making the validation. I am not using the commmand prompt for doing the validation. You are asking for the version but I cannot access to this information. I suppose that there are many ways in which the BIDS-validation can be performed. However, and as I have mentioned in previous messages, I am using a validator which is automatically performed when you upload a personal dataset to the OpenNeuro platform (it works like an app).

-Steps to reproduce:
1.Enter to the main page of OpenNeuro
2.Click on the option ‘UPLOAD DATASET’ (available on the upper rigth side )
3. Select folder (the dataset you want to upload)
After these steps a validation is automatically performed in the dataset (as I understand that every tool in OpenNeuro requires the BIDS configuration). At this point, is where the error mentioned before appear (_T1w.nii [gz] files must have exactly three dimensions)

I want to upload the dataset to OpenNeuro because I want to pre-proccess my data with the pipelines that this platform offers (fMRIprep for example). However, I do not know why this error continously appear (I have used the software clinica to convert the dataset from ADNI* to BIDS).

*ADNI is an open platform that provides MRI images of patients with Alzehimer. It allows you to create a personalized dataset.

I hope that I have create you a better background of what I am trying to do, so that you are able to give me a solution. Maybe i do not have to upload the dataset in the main page? maybe I have to first select the pipeline that I want to use?

I am reallly looking forward to having a respone and if you still do not understand do not hesitate to ask.
Thanks in advance,

Ah got it, I was not aware openneuro bad a built in validator, I assumed they used the bids-validator most bids-app use, sorry for misunderstanding earlier. You may have better luck with the OpenNeuro command line interface? https://docs.openneuro.org/packages-openneuro-cli-readme

Hi again,

I am using OpenNeuro line interface with a BIDs validator (version 1.5.9) and I obtain the following two errors:

bids-validator@1.5.9

1: [ERR] This file ends in the .gz extension but is not actually gzipped. (code: 28 - GZ_NOT_GZIPPED)
./sub-ADNI013S6768/ses-M00/dwi/sub-ADNI013S6768_ses-M00_acq-axial_dwi.nii.gz
./sub-ADNI013S6768/ses-M00/func/sub-ADNI013S6768_ses-M00_task-rest_bold.nii.gz

Please visit Search results for 'GZ_NOT_GZIPPED' - Neurostars for existing conversations about this issue.

2: [ERR] _T1w.nii[.gz] files must have exactly three dimensions. (code: 95 - T1W_FILE_WITH_TOO_MANY_DIMENSIONS)
./sub-ADNI013S6768/ses-M00/anat/sub-ADNI013S6768_ses-M00_T1w.nii.gz
Evidence: this T1w file does not have exactly three dimensions.

How can I solve this errors?

Thanks for all

In this case I’ll have to see the code you used to bidsify your data. If this is something you got right from Openneuro (that is, you didn’t do anything to it) then I would suggest reaching out to them about this issue.

This means that the image is not a gzip file. If you try to run gunzip on it, it will fail. It is very common for people to copy .nii files to .nii.gz without actually compressing them, which is why this error exists.

The most likely result is that for some reason the file has an extra dimension of length 1, e.g.:

>>> import nibabel as nb
>>> img = nb.load("./sub-ADNI013S6768/ses-M00/anat/sub-ADNI013S6768_ses-M00_T1w.nii.gz")
>>> img.shape
(x, y, z, 1)

The easiest thing to do to remove the final dimension is:

>>> img.slicer[..., 0].to_filename("file.nii.gz")

And then copy the result over your old file. You may want to compare the files to make sure the contents are not changed too much.

Hi.

I am having the same issue with T1w images (converted with dcm2niix), whether I use the web version of the validator (v1.8.9) or the command line (v1.6.2) as shown below:

bids-validator@1.6.2

1: [ERR] _T1w.nii[.gz] files must have exactly three dimensions. (code: 95 - T1W_FILE_WITH_TOO_MANY_DIMENSIONS)
./sub-BPDPAF/anat/sub-BPDPAF_T1w.nii.gz
Evidence: this T1w file does not have exactly three dimensions.

Shouldn’t it have been fixed? (as described here: https://github.com/bids-standard/bids-validator/pull/567)

I appreciate very much any help.
Thanks!
João