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

Validator warning for write_anat with no acquisition #238

Closed
alexrockhill opened this issue Jul 18, 2019 · 8 comments · Fixed by #241
Closed

Validator warning for write_anat with no acquisition #238

alexrockhill opened this issue Jul 18, 2019 · 8 comments · Fixed by #241

Comments

@alexrockhill
Copy link
Contributor

I get the following warning from the validator during write_anat without passing an acquisition parameter:

File Path: NIfTI file's header field for unit information for x, y, z, and t dimensions empty or too short

Type:		Warning
File:		sub-sample_ses-01_T1w.nii.gz
Location:		data_BIDS/sub-sample/ses-01/anat/sub-sample_ses-01_T1w.nii.gz
Reason:		NIfTI file's header field for unit information for x, y, z, and t dimensions empty or too short

======================================================

It's not clear if the acquisition parameter would fix this, maybe someone can suggest how to get these parameters from an MGH file.

@alexrockhill
Copy link
Contributor Author

Also, when I use mri_convert to change the MGH file to NIfTI, the dataset is successfully validated. This makes sense to me and per @jasmainak this would suggest this is an MNE-BIDS issue.

@agramfort
Copy link
Member

agramfort commented Jul 18, 2019 via email

@alexrockhill
Copy link
Contributor Author

Sure:

from mne_bids import write_anat
from mne import read_trans

subject = 'sample'
session = '01'
t1f = 'MNE-sample-data/subjects/sample/mri/T1.mgz'
raw = 'MNE-sample-data/MEG/sample/sample_audvis-raw.fif'
trans = 'MNE-sample-data/MEG/sample/sample_audvis_raw-trans.fif'
write_anat('data_BIDS', subject, t1f, session=session,
raw=raw, trans=read_trans(transf), overwrite=True)

That worked but raised the validator error for me.

@alexrockhill
Copy link
Contributor Author

alexrockhill commented Jul 18, 2019

Sorry

from mne_bids import write_anat

from mne.datasets import sample
from mne import read_trans
from mne.io import read_raw_fif

subject = 'sample'
session = '01'

data_path = sample.data_path()
t1f = data_path + '/subjects/sample/mri/T1.mgz'
raw = read_raw_fif(data_path + '/MEG/sample/sample_audvis_raw.fif')
transf = data_path + '/MEG/sample/sample_audvis_raw-trans.fif'
write_anat('data_BIDS', subject, t1f, session=session,
                  raw=raw, trans=read_trans(transf), overwrite=True)

@jasmainak
Copy link
Member

I can confirm the problem. I edited your comment @alexrockhill

Here is the validator output

(mne) mainak@mainak-ThinkPad-W540 ~/Desktop $ bids-validator data_BIDS/
	1: [ERR] The compulsory file /dataset_description.json is missing. See Section 03 (Modality agnostic files) of the BIDS specification. (code: 57 - DATASET_DESCRIPTION_JSON_MISSING)

	1: [WARN] Nifti file's header field for unit information for x, y, z, and t dimensions empty or too short (code: 41 - NIFTI_UNIT)
		./sub-sample/ses-01/anat/sub-sample_ses-01_T1w.nii.gz

	2: [WARN] The recommended file /README is missing. See Section 03 (Modality agnostic files) of the BIDS specification. (code: 101 - README_FILE_MISSING)


        Summary:               Available Tasks:        Available Modalities: 
        2 Files, 4.77MB                                T1w                   
        1 - Subject                                                          
        1 - Session                                                          


If you have any questions please post on https://neurostars.org/tags/bids

@agramfort
Copy link
Member

agramfort commented Jul 19, 2019 via email

@jasmainak
Copy link
Member

@agramfort
Copy link
Member

agramfort commented Jul 20, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants