Thanks, I've got it.
Firstly, you should load the JSON, not the NIFTI, so (edit: PT is mistaken about this point for this program, as he notes below; the NIFTI indeed should be loaded in with "-input .." here; this is noted below; the real error for this file is correctly diagnosed here, though, that one value appears to need to be wrapped in quotes):
abids_tool.py -input sub-s4033-ABCD_fMRI_rest.json -add_slice_times
Then, I got errors, too, reading it in:
Error: sub-s4033-ABCD_fMRI_rest.json does not exist or is not loadable!!
So, I tried reading it with the straightup Python "json" module:
python
Python 3.12.4 | packaged by Anaconda, Inc. | (main, Jun 18 2024, 10:14:12) [Clang 14.0.6 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import json
>>> x = json.load(open('sub-s4033-ABCD_fMRI_rest.json'))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/taylorpa3/miniconda3/envs/py3_afni_tiny/lib/python3.12/json/__init__.py", line 293, in load
return loads(fp.read(),
^^^^^^^^^^^^^^^^
File "/Users/taylorpa3/miniconda3/envs/py3_afni_tiny/lib/python3.12/json/__init__.py", line 346, in loads
return _default_decoder.decode(s)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/taylorpa3/miniconda3/envs/py3_afni_tiny/lib/python3.12/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/taylorpa3/miniconda3/envs/py3_afni_tiny/lib/python3.12/json/decoder.py", line 353, in raw_decode
obj, end = self.scan_once(s, idx)
^^^^^^^^^^^^^^^^^^^^^^
json.decoder.JSONDecodeError: Expecting ',' delimiter: line 5 column 29 (char 159)
That line 5 looks like:
"AcquisitionDateTime": 2022-04-08T16:58:17.937500,
If I copied the file and edited that line's value to look like a string:
"AcquisitionDateTime": "2022-04-08T16:58:17.937500",
... then that resolved the error there, and I could use the abids*py
tools on it.
I am not sure why dcm2niix
converted it that way. It may be a version thing there, too? I can only speculate.
--pt