bids-validator icon indicating copy to clipboard operation
bids-validator copied to clipboard

PET data: 'ReconFilterSize' expected but NOT required when 'ReconFilterType' is "none"

Open arovai opened this issue 2 years ago • 2 comments

bids-validator v1.9.9 on a dataset with PET images. As per BIDS doc for PET, the field ReconFilterSize is required only when ReconFilterType is not "none". On my data, there is no recon filter (empty dicom tag), so my json contains: "ReconFilterType": "none" Still, bids-validator gives me the following error:

1: [ERR] Invalid JSON file. The file is not formatted according the schema. (code: 55 - JSON_SCHEMA_VALIDATION_ERROR)
		./sub-001/pet/sub-001_pet.json
			Evidence:  should have required property 'ReconFilterSize'

Maybe I am not entering the "none" value correctly (I have tried some variations like None, none, "n/a", n/a... without luck), or maybe bids-validator misses this case. Any guess?

arovai avatar Jan 19 '23 21:01 arovai

Looking at:

https://github.com/bids-standard/bids-validator/blob/82a3a42bb786d2feab1391da46b7df36ecd71fcc/bids-validator/validators/json/schemas/pet.json#L191-L204

I think you need to use "n/a" in both fields.

effigies avatar Jan 20 '23 00:01 effigies

Hum, that's weird, I have tried having

    "ReconFilterType": "n/a",
    "ReconFilterSize": "n/a",

but this still gives me a bunch of errors:

		./sub-001/pet/sub-001_pet.json
			Evidence: .ReconFilterSize should be number
		./sub-001/pet/sub-001_pet.json
			Evidence: .ReconFilterSize should be array
		./sub-001/pet/sub-001_pet.json
			Evidence: .ReconFilterSize should match some schema in anyOf

arovai avatar Jan 20 '23 09:01 arovai