-
Notifications
You must be signed in to change notification settings - Fork 13
Description
Description
This becomes evident when running multi-context import with contexts differing the the values of fields like PostLabelingDelay, but the fields per context are all identical.
Note that the function xASL_io_ReadJson is now used instead of the spm_jsonread. I've fixed only that function.
Check also #1268
Example of no issue studyPar.json:
{
"StudyPars": [
{
"SubjectRegExp": "GESubject001",
"ASLContext": "deltam, m0scan",
"M0Type": "Included",
"M0": true,
"Manufacturer": "GE",
"PulseSequenceType": "3D_spiral",
"MRAcquisitionType": "3D",
"ArterialSpinLabelingType": "PCASL",
"PostLabelingDelay": 1.525,
"LabelingDuration": 1.45,
"BackgroundSuppression": false,
"BackgroundSuppressionNumberPulses": 0,
"BackgroundSuppressionPulseTime": []
},
{
"SubjectRegExp": "SiemensSubject002",
"ASLContext": "control, label",
"M0Type": "Separate",
"M0": true,
"Manufacturer": "Siemens",
"PulseSequenceType": "3D_spiral",
"MRAcquisitionType": "3D",
"ArterialSpinLabelingType": "PASL",
"PostLabelingDelay": 2,
"BolusCutOffFlag": true,
"BolusCutOffTechnique": "QUIPSSII",
"BolusCutOffDelayTime": 0.8,
"BackgroundSuppression": true,
"BackgroundSuppressionNumberPulses": 2,
"BackgroundSuppressionPulseTime": [0.05, 0.95]
}
]
}^ Correctly interpreted because the JSON object elements of the array are slightly different in the fields they showcase:
K>> spm_jsonread('C:\Users\Maurice\Documents\ExploreASLJSTesting\GEAndSiemensMultiContextTestSet\studyPar.json')
Reading C:\Users\Maurice\Documents\ExploreASLJSTesting\GEAndSiemensMultiContextTestSet\studyPar.json
ans =
struct with fields:
StudyPars: {2×1 cell}Example of error:
{
"StudyPars": [
{
"SubjectRegExp": "C9ORF194V11|GRN224V14",
"ASLContext": "label, control",
"M0Type": "Absent",
"M0": false,
"Manufacturer": "Siemens",
"PulseSequenceType": "3D_GRASE",
"MRAcquisitionType": "3D",
"MagneticFieldStrength": 3,
"ArterialSpinLabelingType": "PASL",
"PostLabelingDelay": 2,
"BolusCutOffFlag": true,
"BolusCutOffTechnique": "Q2TIPS",
"BolusCutOffDelayTime": [0.8, 1.99],
"BackgroundSuppression": true,
"BackgroundSuppressionNumberPulses": 2,
"BackgroundSuppressionPulseTime": [0.25, 1.476]
},
{
"SubjectRegExp": "MAPT050V01|MAPT051V01",
"ASLContext": "label, control",
"M0Type": "Absent",
"M0": false,
"Manufacturer": "Siemens",
"PulseSequenceType": "3D_GRASE",
"MRAcquisitionType": "3D",
"MagneticFieldStrength": 3,
"ArterialSpinLabelingType": "PASL",
"PostLabelingDelay": 1.7,
"BolusCutOffFlag": true,
"BolusCutOffTechnique": "Q2TIPS",
"BolusCutOffDelayTime": [0.7, 1.69],
"BackgroundSuppression": true,
"BackgroundSuppressionNumberPulses": 2,
"BackgroundSuppressionPulseTime": [0.25, 1.476]
},
{
"SubjectRegExp": "C9ORF059V12|C9ORF060V11|C9ORF060V12",
"ASLContext": "label, control",
"M0Type": "Absent",
"M0": false,
"Manufacturer": "Siemens",
"PulseSequenceType": "3D_GRASE",
"MRAcquisitionType": "3D",
"MagneticFieldStrength": 3,
"ArterialSpinLabelingType": "PASL",
"PostLabelingDelay": 1.99,
"BolusCutOffFlag": true,
"BolusCutOffTechnique": "Q2TIPS",
"BolusCutOffDelayTime": [0.7, 1.98],
"BackgroundSuppression": true,
"BackgroundSuppressionNumberPulses": 2,
"BackgroundSuppressionPulseTime": [0.25, 1.476]
}
]
}Is misinterpreted because all JSON object elements have the same BIDS field names.
K>> spm_jsonread('F:\Siemens_3D_GRaSE_M0Absent\studyPar.json')
Reading F:\Siemens_3D_GRaSE_M0Absent\studyPar.json
ans =
struct with fields:
StudyPars: [3×1 struct]Notice that it is interpretd as a regular array instead of a cell array. This leads to wonderful indexing issues because MATLAB has a special place in programmers' hearts. slow clap 👏
As soon as any of the objects is different by introducing a random field-value pair, correct behavior is restored.
Tasks
- Fix
spm_jsonread. Either make it more robust via some "coerce" argument or add additional sanity checks whenever it is used to perform a coercion in edge cases.
Release notes
Fixed a bug in xASL_io_ReadJson incorrectly interpreted same-field studyPar contexts.