Skip to content

Commit

Permalink
check for effective echo spacing values
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisgorgo committed Jul 6, 2018
1 parent 646bb1a commit 4c6c5a4
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions utils/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,14 +247,19 @@ function readNiftiHeader (file, callback) {
callback(handleGunzipError(buffer, file));
});

fs.open(file.path, 'r', function(status, fd) {
fs.read(fd, buffer, 0, bytesRead, 0, function() {
if (file.name.endsWith('.nii')) {
callback(parseNIfTIHeader(buffer, file));
} else {
decompressStream.write(buffer);
}
});
fs.open(file.path, 'r', function(err, fd) {
if (err){
callback({error: new Issue({code: 44, file: file})});
return;
} else {
fs.read(fd, buffer, 0, bytesRead, 0, function () {
if (file.name.endsWith('.nii')) {
callback(parseNIfTIHeader(buffer, file));
} else {
decompressStream.write(buffer);
}
});
}
});
});
} else {
Expand Down

0 comments on commit 4c6c5a4

Please sign in to comment.