|
1 | | -var async = require('async'); |
2 | 1 | var utils = require('../utils'); |
3 | 2 | var Issue = utils.issues.Issue; |
4 | 3 |
|
@@ -219,32 +218,32 @@ module.exports = function NIFTI (header, file, jsonContentsDict, bContentsDict, |
219 | 218 | } |
220 | 219 |
|
221 | 220 | if (path.includes("_phasediff.nii") || path.includes("_phase1.nii") || |
222 | | - path.includes("_phase2.nii") || path.includes("_fieldmap.nii") || path.includes("_epi.nii")) { |
223 | | - if (mergedDictionary.hasOwnProperty('IntendedFor')) { |
224 | | - var intendedFor = typeof mergedDictionary['IntendedFor'] == "string" ? [mergedDictionary['IntendedFor']] : mergedDictionary['IntendedFor']; |
225 | | - |
226 | | - for (var key = 0; key < intendedFor.length; key++) { |
227 | | - var intendedForFile = intendedFor[key]; |
228 | | - var intendedForFileFull = "/" + path.split("/")[1] + "/" + intendedForFile; |
229 | | - var onTheList = false; |
230 | | - |
231 | | - for (var key2 in fileList) { |
232 | | - var filePath = fileList[key2].relativePath; |
233 | | - if (filePath === intendedForFileFull) { |
234 | | - onTheList = true; |
235 | | - } |
236 | | - } |
237 | | - if (!onTheList) { |
238 | | - issues.push(new Issue({ |
239 | | - file: file, |
240 | | - code: 37, |
241 | | - reason: "'IntendedFor' property of this fieldmap ('" + path + |
242 | | - "') does not point to an existing file('" + intendedForFile + "'). Please mind that this value should not include subject level directory " + |
243 | | - "('/" + path.split("/")[1] + "/').", |
244 | | - evidence: intendedForFile |
245 | | - })); |
| 221 | + path.includes("_phase2.nii") || path.includes("_fieldmap.nii") || path.includes("_epi.nii") && |
| 222 | + mergedDictionary.hasOwnProperty('IntendedFor')) { |
| 223 | + var intendedFor = typeof mergedDictionary['IntendedFor'] == "string" ? [mergedDictionary['IntendedFor']] : mergedDictionary['IntendedFor']; |
| 224 | + |
| 225 | + for (var key = 0; key < intendedFor.length; key++) { |
| 226 | + var intendedForFile = intendedFor[key]; |
| 227 | + var intendedForFileFull = "/" + path.split("/")[1] + "/" + intendedForFile; |
| 228 | + var onTheList = false; |
| 229 | + |
| 230 | + for (var key2 in fileList) { |
| 231 | + var filePath = fileList[key2].relativePath; |
| 232 | + if (filePath === intendedForFileFull) { |
| 233 | + onTheList = true; |
246 | 234 | } |
247 | 235 | } |
| 236 | + if (!onTheList) { |
| 237 | + issues.push(new Issue({ |
| 238 | + file: file, |
| 239 | + code: 37, |
| 240 | + reason: "'IntendedFor' property of this fieldmap ('" + path + |
| 241 | + "') does not point to an existing file('" + intendedForFile + "'). Please mind that this value should not include subject level directory " + |
| 242 | + "('/" + path.split("/")[1] + "/').", |
| 243 | + evidence: intendedForFile |
| 244 | + })); |
| 245 | + } |
| 246 | + } |
248 | 247 | } |
249 | 248 | } |
250 | 249 | } |
|
0 commit comments