From 845970c5fdc4d078a5a246ec4c4edb83bae87c89 Mon Sep 17 00:00:00 2001 From: Niveauet Date: Fri, 6 Mar 2020 15:25:31 +0100 Subject: [PATCH] Validation of PET data --- .../rules/file_level_rules.json | 37 +++- .../tsv/non_custom_columns.json | 1 + bids-validator/utils/issues/list.js | 9 +- bids-validator/utils/modalities.js | 2 +- bids-validator/utils/type.js | 28 ++- bids-validator/validators/json/json.js | 4 + .../validators/json/schemas/pet.json | 205 ++++++++++++++++++ .../validators/json/schemas/pet_blood.json | 170 +++++++++++++++ bids-validator/validators/tsv/tsv.js | 8 +- .../validators/tsv/validateTsvColumns.js | 3 +- 10 files changed, 458 insertions(+), 9 deletions(-) create mode 100644 bids-validator/validators/json/schemas/pet.json create mode 100644 bids-validator/validators/json/schemas/pet_blood.json diff --git a/bids-validator/bids_validator/rules/file_level_rules.json b/bids-validator/bids_validator/rules/file_level_rules.json index 4438f32d5..6d41d397c 100644 --- a/bids-validator/bids_validator/rules/file_level_rules.json +++ b/bids-validator/bids_validator/rules/file_level_rules.json @@ -204,7 +204,14 @@ "meg": { "regexp": "^\\/(sub-[a-zA-Z0-9]+)\\/(?:(ses-[a-zA-Z0-9]+)\\/)?meg\\/\\1(_\\2)?(?:_task-[a-zA-Z0-9]+)?(?:_acq-[a-zA-Z0-9]+)?(?:_run-[0-9]+)?(?:_proc-[a-zA-Z0-9]+)?(?:_part-[0-9]+)?(_digitizer.txt|_meg(@@@_meg_type_@@@\\/(.(?!\\.(sqd|con|fif|raw|raw\\.mhd|trg|kdf|chn)$))*|\\/(.(?!\\.(sqd|con|fif|raw|raw\\.mhd|trg|kdf|chn)$))*)|(@@@_meg_ext_@@@))$", "tokens": { - "@@@_meg_type_@@@": ["\\.ds/.*", "\\.(?:chn|kdf|trg)", "\\.(?:raw|raw\\.mhd)", "\\.fif", "\\.(?:con|sqd)", "\\.(?:kdf|chn|trg)"], + "@@@_meg_type_@@@": [ + "\\.ds/.*", + "\\.(?:chn|kdf|trg)", + "\\.(?:raw|raw\\.mhd)", + "\\.fif", + "\\.(?:con|sqd)", + "\\.(?:kdf|chn|trg)" + ], "@@@_meg_ext_@@@": [ "_events\\.json", "_events\\.tsv", @@ -219,6 +226,34 @@ } }, + "pet": { + "regexp": "^\\/(sub-[a-zA-Z0-9]+)\\/(?:(ses-[a-zA-Z0-9]+)\\/)pet\\/(sub-[a-zA-Z0-9]+)_(?:(ses-[a-zA-Z0-9]+))|((@@@_pet_ext_@@@))$", + "tokens": { + "@@@_pet_ext_@@@": ["_pet.json", "_pet\\.nii\\.gz", "_pet\\.nii"] + } + }, + + "pet_blood": { + "regexp": "^\\/(sub-[a-zA-Z0-9]+)\\/(?:(ses-[a-zA-Z0-9]+)\\/)pet\\/(sub-[a-zA-Z0-9]+)_(?:(ses-[a-zA-Z0-9]+))|((@@@_pet_ext_@@@))$", + "tokens": { + "@@@_pet_ext_@@@": ["_pet-blood\\.nii\\.json"] + } + }, + + "pet_data": { + "regexp": "^\\/(sub-[a-zA-Z0-9]+)\\/(?:(ses-[a-zA-Z0-9]+)\\/)pet\\/(sub-[a-zA-Z0-9]+)_(?:(ses-[a-zA-Z0-9]+))|((@@@_pet_ext_@@@))$", + "tokens": { + "@@@_pet_ext_@@@": ["_pet\\.nii\\.gz", "_pet\\.nii"] + } + }, + + "pet_blood_data": { + "regexp": "^\\/(sub-[a-zA-Z0-9]+)\\/(?:(ses-[a-zA-Z0-9]+)\\/)pet\\/(sub-[a-zA-Z0-9]+)_(?:(ses-[a-zA-Z0-9]+))|((@@@_pet_ext_@@@))$", + "tokens": { + "@@@_pet_ext_@@@": ["_pet-blood\\.tsv"] + } + }, + "stimuli": { "regexp": "^\\/(?:stimuli)\\/(?:.*)$" } diff --git a/bids-validator/bids_validator/tsv/non_custom_columns.json b/bids-validator/bids_validator/tsv/non_custom_columns.json index c56e0c948..228d715ab 100644 --- a/bids-validator/bids_validator/tsv/non_custom_columns.json +++ b/bids-validator/bids_validator/tsv/non_custom_columns.json @@ -38,6 +38,7 @@ "sample", "value" ], + "pet-blood": ["Time", "PlasmaActivity"], "misc": [], "participants": ["participant_id", "age", "sex"], "phenotype": ["participant_id"], diff --git a/bids-validator/utils/issues/list.js b/bids-validator/utils/issues/list.js index af748f4e0..e3deb6913 100644 --- a/bids-validator/utils/issues/list.js +++ b/bids-validator/utils/issues/list.js @@ -695,12 +695,17 @@ export default { key: 'INVALID_TSV_UNITS', severity: 'error', reason: - 'Units in .tsv files must be valid SI units as described in the BIDS spec Appendix V (https://bids-specification.readthedocs.io/en/stable/99-appendices/05-units.html).' + 'Units in .tsv files must be valid SI units as described in the BIDS spec Appendix V (https://bids-specification.readthedocs.io/en/stable/99-appendices/05-units.html).', }, 125: { key: 'CHANNELS_COLUMN_STATUS', severity: 'error', reason: - 'Status column in channels.tsv files must contain only one of two values: good or bad. Per the BIDS spec: (https://bids-specification.readthedocs.io/en/stable/04-modality-specific-files/04-intracranial-electroencephalography.html#channels-description-_channelstsv).' + 'Status column in channels.tsv files must contain only one of two values: good or bad. Per the BIDS spec: (https://bids-specification.readthedocs.io/en/stable/04-modality-specific-files/04-intracranial-electroencephalography.html#channels-description-_channelstsv).', + }, + 126: { + key: 'CHANNELS_COLUMN_STATUS', + severity: 'error', + reason: 'This is a test error for PET scan blood data!', }, } diff --git a/bids-validator/utils/modalities.js b/bids-validator/utils/modalities.js index b2a0f91fb..1218bd82a 100644 --- a/bids-validator/utils/modalities.js +++ b/bids-validator/utils/modalities.js @@ -45,7 +45,7 @@ export default { // MRI if ( path[0].includes('.nii') && - ['anat', 'func', 'dwi'].indexOf(path[1]) != -1 + ['anat', 'func', 'dwi', 'pet'].indexOf(path[1]) != -1 ) { isCorrectModality = true } else if (['.json', '.tsv'].some(v => path[0].includes(v))) { diff --git a/bids-validator/utils/type.js b/bids-validator/utils/type.js index ddd20dc2f..123bb851f 100644 --- a/bids-validator/utils/type.js +++ b/bids-validator/utils/type.js @@ -25,6 +25,8 @@ const anatData = buildRegExp(file_level_rules.anat) const anatDefacemaskData = buildRegExp(file_level_rules.anat_defacemask) const behavioralData = buildRegExp(file_level_rules.behavioral) const contData = buildRegExp(file_level_rules.cont) +const petDataFile = buildRegExp(file_level_rules.pet_data) +const petBloodDataFile = buildRegExp(file_level_rules.pet_blood_data) const dwiData = buildRegExp(file_level_rules.dwi) const eegData = buildRegExp(file_level_rules.eeg) const fieldmapData = buildRegExp(file_level_rules.field_map) @@ -34,6 +36,8 @@ const funcBoldData = buildRegExp(file_level_rules.func_bold) const ieegData = buildRegExp(file_level_rules.ieeg) const megData = buildRegExp(file_level_rules.meg) const stimuliData = buildRegExp(file_level_rules.stimuli) +const petData = buildRegExp(file_level_rules.pet) +const petBloodData = buildRegExp(file_level_rules.pet_blood) // Phenotypic data const phenotypicData = buildRegExp(phenotypic_rules.phenotypic_data) // Session level @@ -79,7 +83,9 @@ export default { this.file.isBehavioral(path) || this.file.isCont(path) || this.file.isFieldMap(path) || - this.file.isPhenotypic(path) + this.file.isPhenotypic(path) || + this.file.isPET(path) || + this.file.isPETBlood(path) ) }, @@ -206,6 +212,14 @@ export default { return conditionalMatch(ieegData, path) }, + isPET: function(path) { + return conditionalMatch(petData, path) + }, + + isPETBlood: function(path) { + return conditionalMatch(petBloodData, path) + }, + isBehavioral: function(path) { return conditionalMatch(behavioralData, path) }, @@ -218,6 +232,14 @@ export default { return conditionalMatch(contData, path) }, + isPETData: function(path) { + return conditionalMatch(petDataFile, path) + }, + + isPETBloodData: function(path) { + return conditionalMatch(petBloodDataFile, path) + }, + hasModality: function(path) { return ( this.isAnat(path) || @@ -230,7 +252,9 @@ export default { this.isIEEG(path) || this.isBehavioral(path) || this.isFuncBold(path) || - this.isCont(path) + this.isCont(path) || + this.isPETData(path) || + this.isPETBloodData(path) ) }, }, diff --git a/bids-validator/validators/json/json.js b/bids-validator/validators/json/json.js index d8b0da73b..d117c6918 100644 --- a/bids-validator/validators/json/json.js +++ b/bids-validator/validators/json/json.js @@ -107,6 +107,10 @@ const selectSchema = file => { file.name.endsWith('coordsystem.json') ) { schema = require('./schemas/coordsystem_eeg.json') + } else if (file.name.endsWith('pet_blood.json')) { + schema = require('./schemas/pet_blood.json') + } else if (file.name.endsWith('pet.json')) { + schema = require('./schemas/pet.json') } } return schema diff --git a/bids-validator/validators/json/schemas/pet.json b/bids-validator/validators/json/schemas/pet.json new file mode 100644 index 000000000..2446d8b1a --- /dev/null +++ b/bids-validator/validators/json/schemas/pet.json @@ -0,0 +1,205 @@ +{ + "type": "object", + "properties": { + "Modality": { "type": "string", "minLength": 1 }, + "Manufacturer": { "type": "string", "minLength": 1 }, + "ManufacturersModelName": { "type": "string", "minLength": 1 }, + "Anaesthesia": { "type": "string", "minLength": 1 }, + "BodyPart": { "type": "string", "minLength": 1 }, + "BodyWeight": { "type": "number" }, + "BodyWeightUnit": { "type": "string", "minLength": 1 }, + "Unit": { + "type": "string", + "minLength": 1, + "enum": ["becquerel per milliliter"] + }, + "TracerName": { "type": "string", "minLength": 1 }, + "TracerRadLex": { "type": "string", "minLength": 1 }, + "TracerSNOMED": { "type": "string", "minLength": 1 }, + "TracerRadionuclide": { "type": "string", "minLength": 1 }, + "TracerMolecularWeight": { "type": "number" }, + "TracerMolecularWeightUnit": { "type": "string", "minLength": 1 }, + "PharmaceuticalName": { "type": "string", "minLength": 1 }, + "PharmaceuticalDoseAmount": { "type": "string", "minLength": 1 }, + "PharmaceuticalDoseUnits": { "type": "string", "minLength": 1 }, + "PharmaceuticalDoseRegimen": { "type": "string", "minLength": 1 }, + "PharmaceuticalDoseTime": { "type": "number" }, + "PharmaceuticalDoseTimeUnits": { "type": "string", "minLength": 1 }, + + "InjectedRadioactivity": { "type": "number" }, + "InjectedRadioActivityUnit": { + "type": "string", + "minLength": 1, + "enum": ["megabecquerel"] + }, + "InjectedMass": { "type": "number" }, + "InjectedMassUnits": { + "type": "string", + "minLength": 1, + "enum": ["micrograms", "milligrams", "grams"] + }, + "SpecificRadioactivity": { "type": "number" }, + "SpecificRadioactivityUnit": { + "type": "string", + "minLength": 1, + "enum": ["becquerel per grams", "gigabecquerel per micrograms"] + }, + "SpecificRadioactivityMeasTime": { + "type": "string", + "pattern": "^(?:2[0-3]|[01][0-9]):[0-5][0-9]:[0-5][0-9]$" + }, + "MolarActivity": { "type": "number" }, + "MolarActivityUnit": { + "type": "string", + "minLength": 1, + "enum": ["becquerel per molar", "gigabecquerel per micromolar"] + }, + "MolarActivityMeasTime": { + "type": "string", + "pattern": "^(?:2[0-3]|[01][0-9]):[0-5][0-9]:[0-5][0-9]$" + }, + "ModeOfAdministration": { "type": "string", "minLength": 1 }, + "InfusionSpeed": { "type": "string", "minLength": 1 }, + "InfusionSpeedUnit": { "type": "string", "minLength": 1 }, + "InjectedVolume": { "type": "number" }, + "InjectedVolumeUnit": { "type": "string", "minLength": 1 }, + "Purity": { "type": "number" }, + "PurityUnits": { "type": "string", "minLength": 1 }, + + "ScanDate": { + "type": "string", + "pattern": "^(?:2[0-3]|[01][0-9]):[0-5][0-9]:[0-5][0-9]$" + }, + "ScanStart": { + "type": "string", + "pattern": "^(?:2[0-3]|[01][0-9]):[0-5][0-9]:[0-5][0-9]$" + }, + "InjectionStart": { + "type": "string", + "pattern": "^(?:2[0-3]|[01][0-9]):[0-5][0-9]:[0-5][0-9]$" + }, + "InjectionEnd": { + "type": "string", + "pattern": "^(?:2[0-3]|[01][0-9]):[0-5][0-9]:[0-5][0-9]$" + }, + "TimeZero": { + "type": "string", + "pattern": "^(?:2[0-3]|[01][0-9]):[0-5][0-9]:[0-5][0-9]$" + }, + "FrameTimesStart": { + "type": "array", + "items": { "type": "number" } + }, + "FrameTimesStartUnits": { "type": "string", "minLength": 1 }, + "FrameTimesEnd": { + "type": "array", + "items": { "type": "number" } + }, + "FrameTimesEndUnits": { "type": "string", "minLength": 1 }, + + "AcquisitionMode": { "type": "string", "minLength": 1 }, + "ImageDecayCorrected": { "type": "boolean" }, + "ImageDecayCorrectionTime": { + "type": "string", + "pattern": "^(?:2[0-3]|[01][0-9]):[0-5][0-9]:[0-5][0-9]$" + }, + "DiameterFOV": { + "type": "array", + "items": { "type": "number" } + }, + "DiameterFOVUnit": { "type": "string", "minLength": 1 }, + "ImageOrientation": { + "type": "array", + "items": { "type": "string" } + }, + "ReconMatrixSize": { + "type": "array", + "items": { "type": "number" } + }, + "ImageVoxelSize": { + "type": "array", + "items": { "type": "number" } + }, + "ReconMethodName": { "type": "string", "minLength": 1 }, + "ReconMethodParameterLabels": { + "type": "array", + "items": { "type": "string" } + }, + "ReconMethodParameterUnit": { + "type": "array", + "items": { "type": "string" } + }, + "ReconMethodParameterValues": { + "type": "array", + "items": { "type": "number" } + }, + "ReconMethodImplementationVersion": { "type": "string", "minLength": 1 }, + "ReconFilterType": { + "type": "array", + "items": { "type": "string" } + }, + "ReconFilterSize": { + "type": "array", + "items": { "type": "number" } + }, + "AttenuationCorrection": { "type": "string", "minLength": 1 }, + "AttenuationCorrectionMethodReference": { "type": "string", "minLength": 1 } + }, + "required": [ + "Modality", + "Manufacturer", + "ManufacturersModelName", + "Unit", + "TracerName", + "TracerRadionuclide", + + "InjectedRadioactivity", + "InjectedRadioactivityUnit", + "InjectedMass", + "InjectedMassUnits", + "SpecificRadioactivity", + "SpecificRadioactivityUnit", + "ModeOfAdministration", + + "ScanStart", + "InjectionStart", + "TimeZero", + "FrameTimesStart", + "FrameTimesStartUnits", + "FrameTimesEnd", + "FrameTimesEndUnits", + "AcquisitionMode", + "ImageDecayCorrected", + "ImageDecayCorrectionTime", + "ReconMatrixSize", + "ImageVoxelSize", + "ReconMethodName", + "ReconMethodParameterLabels", + "ReconMethodParameterUnit", + "ReconMethodParameterValues", + "ReconFilterType", + "ReconFilterSize", + "AttenuationCorrection" + ], + "dependencies": { + "TracerMolecularWeight": ["TracerMolecularWeightUnit"], + "BodyWeight": ["BodyWeightUnit"], + + "InjectedRadioactivity": ["InjectedRadioActivityUnit"], + "InjectedMass": ["InjectedMassUnits"], + "MolarActivity": ["MolarActivityUnit"], + "SpecificRadioactivity": ["SpecificRadioactivityUnit"], + "Purity": ["PurityUnits"], + "InfusionSpeed": ["InfusionSpeedUnit"], + "InjectedVolume": ["InjectedVolumeUnit"], + + "FrameTimesStart": ["FrameTimesStartUnits"], + "FrameTimesEnd": ["FrameTimesEndUnits"], + + "DiameterFOV": ["DiameterFOVUnit"], + "ReconMethodParameterLabels": [ + "ReconMethodParameterUnit", + "ReconMethodParameterValues" + ] + } +} diff --git a/bids-validator/validators/json/schemas/pet_blood.json b/bids-validator/validators/json/schemas/pet_blood.json new file mode 100644 index 000000000..a6d29b564 --- /dev/null +++ b/bids-validator/validators/json/schemas/pet_blood.json @@ -0,0 +1,170 @@ +{ + "type": "object", + "properties": { + "Modality": { "type": "string", "minLength": 1 }, + "PlasmaType": { "type": "string", "minLength": 1 }, + "FreeFraction": { + "type": "number", + "min": 0, + "max": 1 + }, + "FreeFractionMethod": { "type": "string", "minLength": 1 }, + "PlasmaTimeZero": { + "type": "string", + "pattern": "^(?:2[0-3]|[01][0-9]):[0-5][0-9]:[0-5][0-9]$" + }, + "PlasmaDecayCorrected": { "type": "boolean" }, + "PlasmaDecayCorrectionTime": { + "type": "string", + "pattern": "^(?:2[0-3]|[01][0-9]):[0-5][0-9]:[0-5][0-9]$" + }, + "PlasmaSampleTime": { + "type": "array", + "items": { "type": "number" } + }, + "PlasmaSampleTimeUnits": { "type": "string", "minLength": 1 }, + "PlasmaActivity": { + "type": "array", + "items": { "type": "number" } + }, + "PlasmaActivityUnits": { "type": "string", "minLength": 1 }, + + "MetaboliteType": { "type": "string", "minLength": 1 }, + "MetaboliteMethod": { "type": "string", "minLength": 1 }, + "MetaboliteTimeZero": { + "type": "string", + "pattern": "^(?:2[0-3]|[01][0-9]):[0-5][0-9]:[0-5][0-9]$" + }, + "MetaboliteSampleTime": { + "type": "array", + "items": { "type": "number" } + }, + "MetaboliteSampleTimeUnits": { "type": "string", "minLength": 1 }, + "MetaboliteParentFraction": { + "type": "array", + "items": { + "type": "number", + "min": 0, + "max": 1 + } + }, + "MetaboliteParentFractionUnits": { "type": "string", "minLength": 1 }, + "MetabolitePolar": { "type": "array", "items": { "type": "number" } }, + "MetabolitePolarUnits": { "type": "string", "minLength": 1 }, + "MetaboliteLipophilic": { + "type": "array", + "items": { "type": "number" } + }, + "MetaboliteLipophilicUnits": { "type": "string", "minLength": 1 }, + + "Haematocrit": { "type": "string", "minLength": 1 }, + "BloodDensity": { "type": "string", "minLength": 1 }, + "BloodDensityUnits": { "type": "string", "minLength": 1 }, + "BloodDiscreteTimeZero": { + "type": "string", + "pattern": "^(?:2[0-3]|[01][0-9]):[0-5][0-9]:[0-5][0-9]$" + }, + "BloodDiscreteDecayCorrected": { "type": "boolean" }, + "BloodDiscreteDecayCorrectionTime": { + "type": "string", + "pattern": "^(?:2[0-3]|[01][0-9]):[0-5][0-9]:[0-5][0-9]$" + }, + "BloodDiscreteType": { "type": "string", "minLength": 1 }, + "BloodDiscreteSampleTime": { + "type": "array", + "items": { "type": "number" } + }, + "BloodDiscreteSampleTimeUnits": { "type": "string", "minLength": 1 }, + "BloodDiscreteActivity": { + "type": "array", + "items": { "type": "number" } + }, + "BloodDiscreteActivityUnits": { "type": "string", "minLength": 1 }, + + "WithdrawalRate": { "type": "string", "minLength": 1 }, + "WithdrawalRateUnits": { "type": "string", "minLength": 1 }, + "TubingLength": { "type": "string", "minLength": 1 }, + "TubingLengthUnits": { "type": "string", "minLength": 1 }, + "DispersionCorrected": { "type": "boolean" }, + "DispersionConstant": { "type": "string", "minLength": 1 }, + "DispersionConstantUnits": { "type": "string", "minLength": 1 }, + "BloodContinuousTimeZero": { + "type": "string", + "pattern": "^(?:2[0-3]|[01][0-9]):[0-5][0-9]:[0-5][0-9]$" + }, + "BloodContinuousDecayCorrected": { "type": "boolean" }, + "BloodContinuousDecayCorrectionTime": { + "type": "string", + "pattern": "^(?:2[0-3]|[01][0-9]):[0-5][0-9]:[0-5][0-9]$" + }, + "BloodContinuousType": { "type": "string", "minLength": 1 }, + "BloodContinuousSampleTime": { + "type": "array", + "items": { "type": "number" } + }, + "BloodContinuousSampleTimeUnits": { "type": "string", "minLength": 1 }, + "BloodContinuousActivity": { + "type": "array", + "items": { "type": "number" } + }, + "BloodContinuousActivityUnits": { "type": "string", "minLength": 1 } + }, + "required": [ + "PlasmaType", + "PlasmaTimeZero", + "PlasmaDecayCorrected", + "PlasmaSampleTime", + "PlasmaActivity", + + "MetaboliteType", + "MetaboliteMethod", + "MetaboliteTimeZero", + "MetaboliteSampleTime", + "MetaboliteParentFraction", + + "Haematocrit", + "BloodDiscreteDecayCorrected", + "BloodDiscreteType", + "BloodDiscreteSampleTime", + "BloodDiscreteActivity", + + "BloodContinuousDecayCorrected", + "BloodContinuousSampleTime", + "BloodContinuousActivity" + ], + "dependencies": { + "PlasmaDecayCorrected": ["PlasmaDecayCorrectionTime"], + "PlasmaSampleTime": ["PlasmaSampleTimeUnits"], + "PlasmaActivity": ["PlasmaActivityUnits"], + + "MetaboliteSampleTime": ["MetaboliteSampleTimeUnits"], + "MetaboliteParentFraction": ["MetaboliteParentFractionUnits"], + "MetabolitePolar": ["MetabolitePolarUnits"], + "MetaboliteLipophilic": ["MetaboliteLipophilicUnits"], + + "BloodDensity": ["BloodDensityUnits"], + "BloodDiscreteDecayCorrected": ["BloodDiscreteDecayCorrectionTime"], + "BloodDiscreteSampleTime": ["BloodDiscreteSampleTimeUnits"], + "BloodDiscreteActivity": ["BloodDiscreteActivityUnits"], + + "WithdrawalRate": ["WithdrawalRateUnits"], + "TubingLength": ["TubingLengthUnits"], + "DispersionCorrected": ["DispersionConstant", "DispersionConstantUnits"], + "BloodContinuousSampleTime": ["BloodContinuousSampleTimeUnits"], + "BloodContinuousActivity": ["BloodContinuousActivityUnits"] + }, + "allOf": [ + { + "if": { + "properties": { + "BloodContinuousDecayCorrected": { + "enum": [true] + } + } + }, + "then": { + "required": ["BloodContinuousDecayCorrectionTime"] + } + } + ] +} diff --git a/bids-validator/validators/tsv/tsv.js b/bids-validator/validators/tsv/tsv.js index 0a8cf05de..9d56bf891 100644 --- a/bids-validator/validators/tsv/tsv.js +++ b/bids-validator/validators/tsv/tsv.js @@ -282,12 +282,16 @@ const TSV = (file, contents, fileList, callback) => { }) } - // check partcipants.tsv for age 89+ + if (file.name.endsWith('_pet-blood.tsv')) { + // Validate fields here + checkheader('Time', 0, file, 126) + checkheader('PlasmaActivity', 1, file, 126) + } + // check partcipants.tsv for age 89+ if (file.name === 'participants.tsv') { checkAge89(rows, file, issues) } - if (file.name.endsWith('_scans.tsv')) { // check _scans.tsv for column filename diff --git a/bids-validator/validators/tsv/validateTsvColumns.js b/bids-validator/validators/tsv/validateTsvColumns.js index 648d0972d..24bfce726 100644 --- a/bids-validator/validators/tsv/validateTsvColumns.js +++ b/bids-validator/validators/tsv/validateTsvColumns.js @@ -17,7 +17,8 @@ export const getTsvType = function(file) { file.name.endsWith('_electrodes.tsv') || file.name.endsWith('_events.tsv') || file.name.endsWith('_scans.tsv') || - file.name.endsWith('_sessions.tsv') + file.name.endsWith('_sessions.tsv') || + file.name.endsWith('_pet-blood.tsv') ) { const split = file.name.split('_') tsvType = split[split.length - 1].replace('.tsv', '')