Skip to content

Commit cd5f058

Browse files
authored
Merge pull request #457 from chrisfilo/enh/testpixdim4
check if pixdim4 is defined
2 parents 4192f8e + 466e348 commit cd5f058

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

utils/issues/list.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,5 +371,10 @@ module.exports = {
371371
key: 'DUPLICATE_NIFTI_FILES',
372372
severity: 'error',
373373
reason: "Nifti file exist with both '.nii' and '.nii.gz' extensions."
374+
},
375+
75: {
376+
key: 'NIFTI_PIXDIM4',
377+
severity: 'error',
378+
reason: "Nifti file's header is missing time dimension information."
374379
}
375380
};

validators/nii.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,13 @@ module.exports = function NIFTI (header, file, jsonContentsDict, bContentsDict,
159159
}));
160160
}
161161

162-
if (mergedDictionary.RepetitionTime && header) {
162+
if (typeof repetitionTime === 'undefined' && header) {
163+
issues.push(new Issue({
164+
file: file,
165+
code: 75
166+
}));
167+
}
168+
else if (mergedDictionary.RepetitionTime && header) {
163169
if (repetitionUnit !== 's') {
164170
issues.push(new Issue({
165171
file: file,

0 commit comments

Comments
 (0)