Fieldmap file error in fmriprep

PS C:\Users\axl666> E:
PS E:> cd test
PS E:\test> cd S0783
PS E:\test\S0783> fmriprep-docker .\Nifti .\Derivatives participant --participant-label sub-S0783 --fs-license-file .\license.txt --output-spaces anat --stop-on-first-crash --fs-no-reconall --ignore slicetiming
RUNNING: docker run --rm -e DOCKER_VERSION_8395080871=20.10.7 -it -v E:\test\S0783\license.txt:/opt/freesurfer/license.txt:ro -v E:\test\S0783\Nifti:/data:ro -v E:\test\S0783\Derivatives:/out nipreps/fmriprep:20.2.3 /data /out participant --participant-label sub-S0783 --stop-on-first-crash --fs-no-reconall --ignore slicetiming --output-spaces anat
You are using fMRIPrep-20.2.3, and a newer version of fMRIPrep is available: 20.2.4.
Please check out our documentation about how and when to upgrade:
https://fmriprep.readthedocs.io/en/latest/faq.html#upgrading
Traceback (most recent call last):
File “/usr/local/miniconda/lib/python3.7/site-packages/bids/layout/index.py”, line 275, in load_json
return json.load(handle)
File “/usr/local/miniconda/lib/python3.7/json/init.py”, line 296, in load
parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
File “/usr/local/miniconda/lib/python3.7/json/init.py”, line 348, in loads
return _default_decoder.decode(s)
File “/usr/local/miniconda/lib/python3.7/json/decoder.py”, line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File “/usr/local/miniconda/lib/python3.7/json/decoder.py”, line 353, in raw_decode
obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Invalid \escape: line 18 column 26 (char 665)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “/usr/local/miniconda/bin/fmriprep”, line 10, in
sys.exit(main())
File “/usr/local/miniconda/lib/python3.7/site-packages/fmriprep/cli/run.py”, line 17, in main
parse_args()
File “/usr/local/miniconda/lib/python3.7/site-packages/fmriprep/cli/parser.py”, line 611, in parse_args
config.from_dict(vars(opts))
File “/usr/local/miniconda/lib/python3.7/site-packages/fmriprep/config.py”, line 634, in from_dict
execution.load(settings)
File “/usr/local/miniconda/lib/python3.7/site-packages/fmriprep/config.py”, line 218, in load
cls.init()
File “/usr/local/miniconda/lib/python3.7/site-packages/fmriprep/config.py”, line 459, in init
re.compile(r"^."),
File “/usr/local/miniconda/lib/python3.7/site-packages/bids/layout/layout.py”, line 156, in init
indexer(self)
File “/usr/local/miniconda/lib/python3.7/site-packages/bids/layout/index.py”, line 112, in call
self._index_metadata()
File “/usr/local/miniconda/lib/python3.7/site-packages/bids/layout/index.py”, line 380, in _index_metadata
file_md.update(pl())
File “/usr/local/miniconda/lib/python3.7/site-packages/bids/layout/index.py”, line 278, in load_json
raise IOError(msg) from e
OSError: Error occurred while trying to decode JSON from file /data/sub-S0783/ses-1/fmap/sub-S0783_ses-1_acq-fmap_dir-AP_run-01_epi.json
fMRIPrep: Please report errors to https://github.com/nipreps/fmriprep/issues

What is the command you used to run fmriprep? Did you check that your data are BIDS-compliant?

What is on Line 18 of sub-S0783_ses-1_acq-fmap_dir-AP_run-01_epi.json?
It looks like you are using windows. I bet you have a path with a backslash (windows format) that is being incorrectly being interpretted as a character escape sequence.

Hi Steven

I using this command

fmriprep-docker .\Nifti .\Derivatives participant --participant-label sub-S0783 --fs-license-file .\license.txt --output-spaces anat --stop-on-first-crash --fs-no-reconall --ignore slicetiming

Hi Jarod

I have used forward slash

To further debug I would 1) look at the faulty JSON file and what is on line 18 of it, as specified in the error message, and 2) use the BIDS validator to see if the data are BIDS compliant.

I have checked my file for BIDS VALIDATOR, there is no error

Error only appears while fmriprep preprocessing

Please check if I am using correct command

fmriprep-docker .\Nifti .\Derivatives participant --participant-label sub-S0783 --fs-license-file .\license.txt --force-syn --output-spaces anat --stop-on-first-crash --fs-no-reconall --ignore slicetiming

and this also I have tried

fmriprep-docker .\Nifti .\Derivatives participant --participant-label sub-S0783 --fs-license-file .\license.txt --output-spaces anat --stop-on-first-crash --fs-no-reconall --ignore slicetiming

What about the JSON file?

can you just paste line 18, which is apparently causing the error?

“ProcedureStepDescription”: “MRI BRAIN FUNCTIONAL REQ PHYSICIAN ADMIN OF NEUROFUNC”,

Just as a test, can you try updating to the most recent release (20.2.5) and also try another subject?

okay, I will try to do this.

Are you sure this is line 18? Try posting a few lines above and below to make sure there isn’t a counting discrepancy (or ideally the whole file if you’re able).

I think the error is due to python its not because of fap json file.

I have checked by using BIDS VALIDATOR