Skip to content

Commit

Permalink
fix: update to use the header promise while acquiring the header for …
Browse files Browse the repository at this point in the history
…making the image plane meta data consistent for each slice on every request
  • Loading branch information
Trenser-SandeepNayathil committed Jan 5, 2023
1 parent ecd2c29 commit 428e7ac
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/nifti/VolumeAcquisitionStreamer.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,10 @@ export default class VolumeAcquisitionStreamer {
acquireHeaderOnly (imageIdObject, isRangeRead = true) {
const fetcherData = this.getFetcherData(imageIdObject);

if (fetcherData.headerPromise) {
return fetcherData.headerPromise;
const headerPromise = fetcherData.headerPromise || fetcherData.headerOnlyPromise;

if (headerPromise) {
return headerPromise;
}

// if no one has requested the header of this volume yet, we create a
Expand Down
2 changes: 1 addition & 1 deletion src/nifti/parseNiftiFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ function ensureUnitInMillimeters (nifti, header) {

function getOrientationMatrix (header) {
if (header.affine && header.sform_code > 0) {
return header.affine;
return header.affine.map((row) => row.slice());
}

if (header.qform_code > 0) {
Expand Down

0 comments on commit 428e7ac

Please sign in to comment.