nipreps / fmriprep

fMRIPrep is a robust and easy-to-use pipeline for preprocessing of diverse fMRI data. The transparent workflow dispenses of manual intervention, thereby ensuring the reproducibility of the results.
https://fmriprep.org
Apache License 2.0
635 stars 294 forks source link

[fmriprep-docker][Command bids-validator not found] #2911

Closed silk1100 closed 1 year ago

silk1100 commented 1 year ago

What happened?

I installed fmriprep and fmriprep-docker. docker is up and running on my linux machine. After I ran fmriprep-docker command as follow: fmriprep-docker GU_1/ ./output/ participant -w ./work/ --participant-label 28824 --omp-nthreads 9 --mem 8000 docker started pulling the required images and then I received the following error

Traceback (most recent call last):
  File "/opt/conda/bin/fmriprep", line 8, in <module>
    sys.exit(main())
  File "/opt/conda/lib/python3.9/site-packages/fmriprep/cli/run.py", line 39, in main
    parse_args()
  File "/opt/conda/lib/python3.9/site-packages/fmriprep/cli/parser.py", line 790, in parse_args
    validate_input_dir(config.environment.exec_env, opts.bids_dir, opts.participant_label)
  File "/opt/conda/lib/python3.9/site-packages/fmriprep/utils/bids.py", line 186, in validate_input_dir
    subprocess.check_call(['bids-validator', str(bids_dir), '-c', temp.name])
  File "/opt/conda/lib/python3.9/subprocess.py", line 373, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['bids-validator', '/data', '-c', '/tmp/tmp4tpo_wz_.json']' returned non-zero exit status 1.

What command did you use?

fmriprep-docker GU_1/ ./output/ participant -w ./work/ --participant-label 28824 --omp-nthreads 9 --mem 8000

What version of fMRIPrep are you running?

fMRIPrep v22.0.2

How are you running fMRIPrep?

Docker

Is your data BIDS valid?

Yes

Are you reusing any previously computed results?

No

Please copy and paste any relevant log output.

No response

Additional information / screenshots

RUNNING: docker run --rm -e DOCKER_VERSION_8395080871=20.10.21 -it -v /home/mohamedta/ABIDEII/GU_1:/data:ro -v /home/mohamedta/ABIDEII/output:/out -v /home/mohamedta/ABIDEII/work:/scratch nipreps/fmriprep:22.0.2 /data /out participant --participant-label 28824 --omp-nthreads 9 --mem 8000 -w /scratch
bids-validator@1.8.0

        1: [ERR] Invalid JSON file. The file is not formatted according the schema. (code: 55 - JSON_SCHEMA_VALIDATION_ERROR)                                   
                ./task-rest_bold.json
                        Evidence: .AcquisitionDuration should be number

        Please visit https://neurostars.org/search?q=JSON_SCHEMA_VALIDATION_ERROR for existing conversations about this issue.                                  

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

        Please visit https://neurostars.org/search?q=README_FILE_MISSING for existing conversations about this issue.                                           

        2: [WARN] The Authors field of dataset_description.json should contain an array of fields - with one author per field. This was triggered because there are no authors, which will make DOI registration from dataset metadata impossible. (code: 113 - NO_AUTHORS)                                                     

        Please visit https://neurostars.org/search?q=NO_AUTHORS for existing conversations about this issue.                                                    

        Summary:                 Available Tasks:        Available Modalities: 
        185 Files, 3.37GB        rest                    MRI                   
        106 - Subjects                                                         
        1 - Session                                                            

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

Traceback (most recent call last):
  File "/opt/conda/bin/fmriprep", line 8, in <module>
    sys.exit(main())
  File "/opt/conda/lib/python3.9/site-packages/fmriprep/cli/run.py", line 39, in main
    parse_args()
  File "/opt/conda/lib/python3.9/site-packages/fmriprep/cli/parser.py", line 790, in parse_args
    validate_input_dir(config.environment.exec_env, opts.bids_dir, opts.participant_label)
  File "/opt/conda/lib/python3.9/site-packages/fmriprep/utils/bids.py", line 186, in validate_input_dir
    subprocess.check_call(['bids-validator', str(bids_dir), '-c', temp.name])
  File "/opt/conda/lib/python3.9/subprocess.py", line 373, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['bids-validator', '/data', '-c', '/tmp/tmp4tpo_wz_.json']' returned non-zero exit status 1.
effigies commented 1 year ago

The validator did run, and it raised an error because you have an invalid field:

        1: [ERR] Invalid JSON file. The file is not formatted according the schema. (code: 55 - JSON_SCHEMA_VALIDATION_ERROR)                                   
                ./task-rest_bold.json
                        Evidence: .AcquisitionDuration should be number

What are the contents of task-rest_bold.json? I'm a bit surprised that AcquisitionDuration is defined, since resting state runs rarely use sparse acquisition.

silk1100 commented 1 year ago

Hello, I downloaded the data from aws s3 ls fcp-indi/data/Projects/ABIDE2/RawData/ { "MagneicFieldStrength": 3.0, "AcquisitionDuration": "6:00", "PlaneOrientationSequentialuence": "Axial>Coronal-23", "SliceEncodingDirection": "k", "ManufacturersModelName": "Allegra", "AcquisitionMatrix": "80x80", "TaskName": "rest", "PixelSpacing": "3x3x3", "RepetitionTime": 2.0, "ReceiveCoilName": "8 Chan", "FieldofViewShape": "Rectangle", "SliceThickness": 4.0, "PixelBandwidth": "3906", "Manufacturer": "Siemens", "FlipAngle": 90, "ReceiveCoilType": "Head", "NumberOfSlices": 33, "FieldofViewDimensions": "240x240", "SpacingBetweenSlices": 4.0, "EchoTime": 0.015, "SliceTiming": [ 0.0, 1.0303, 0.06061, 1.09091, 0.12121, 1.1515199999999999, 0.18181999999999998, 1.2121199999999999, 0.24242, 1.27273, 0.30302999999999997, 1.33333, 0.36363999999999996, 1.39394, 0.42424, 1.45455, 0.48485, 1.51515, 0.54545, 1.57576, 0.6060599999999999, 1.6363599999999998, 0.66667, 1.69697, 0.72727, 1.75758, 0.78788, 1.8181800000000001, 0.84848, 1.87879, 0.9090900000000001, 1.9393900000000002, 0.9697 ], "NumberofMeasurements": "180", "TaskDescription": "During the resting state fMRI scan, participants were asked to relax with their eyes open, while a white cross-hair against a black background was projected on a screen. However, in a few cases, participants closed their eyes despite instructions to maintain them open. Eye status during the MRI scan was monitored via an eye tracker and is provided for each participant.", "PulseSequenceType": "EPI", "PhaseEncodingDirection": "i", "ScanOptions": "FS", "SliceAcquisitionOrder": "Interleaved Ascending", "Instructions": "Participants were asked to relax with their eyes open" }

effigies commented 1 year ago

Looks like bad metadata that doesn't conform to the BIDS specification. I would just remove the AcquisitionDuration field and report to the dataset maintainers that they need to fix it.

Dakshithas commented 1 year ago

I'm also facing the same issue.

effigies commented 1 year ago

@Dakshithas As far as I can tell this issue is resolved. Please open a new bug report with what you're seeing.