Closed alexrockhill closed 5 years ago
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.
can you provide some data to replicate the pb?
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.
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)
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
can you have a look @jasmainak ?
Great
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
======================================================
It's not clear if the acquisition parameter would fix this, maybe someone can suggest how to get these parameters from an MGH file.