Skip to content

Commit

Permalink
Merge pull request #27 from rii-mango/rordenlab-master2
Browse files Browse the repository at this point in the history
merge in rordenlab METHOD 0 fix and add new build
  • Loading branch information
hanayik authored Apr 13, 2023
2 parents 01675ae + 7eade89 commit a04dee0
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 16 deletions.
17 changes: 3 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nifti-reader-js",
"version": "0.6.2",
"version": "0.6.3",
"description": "A JavaScript NIfTI file format reader.",
"main": "src/nifti.js",
"directories": {
Expand Down
2 changes: 1 addition & 1 deletion release/current/nifti-reader-min.js

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions release/current/nifti-reader.js
Original file line number Diff line number Diff line change
Expand Up @@ -5118,6 +5118,12 @@ nifti.NIFTI1.prototype.readHeader = function (data) {
// Added by znshje on 27/11/2021
//
/* See: https://nifti.nimh.nih.gov/pub/dist/src/niftilib/nifti1.h */
if ((this.qform_code < 1) && (this.sform_code < 1)) {
// METHOD 0 (used when both SFORM and QFORM are unknown)
this.affine[0][0] = this.pixDims[1];
this.affine[1][1] = this.pixDims[2];
this.affine[2][2] = this.pixDims[3];
}
if ((this.qform_code > 0) && (this.sform_code < this.qform_code)) {
// METHOD 2 (used when qform_code > 0, which should be the "normal" case):
// ---------------------------------------------------------------------
Expand Down
6 changes: 6 additions & 0 deletions src/nifti1.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,12 @@ nifti.NIFTI1.prototype.readHeader = function (data) {
// Added by znshje on 27/11/2021
//
/* See: https://nifti.nimh.nih.gov/pub/dist/src/niftilib/nifti1.h */
if ((this.qform_code < 1) && (this.sform_code < 1)) {
// METHOD 0 (used when both SFORM and QFORM are unknown)
this.affine[0][0] = this.pixDims[1];
this.affine[1][1] = this.pixDims[2];
this.affine[2][2] = this.pixDims[3];
}
if ((this.qform_code > 0) && (this.sform_code < this.qform_code)) {
// METHOD 2 (used when qform_code > 0, which should be the "normal" case):
// ---------------------------------------------------------------------
Expand Down

0 comments on commit a04dee0

Please sign in to comment.