Skip to content

Commit

Permalink
fix(health imaging): studies not loading from healthimaging if imagep…
Browse files Browse the repository at this point in the history
…ositionpatient is missing (#3646)
  • Loading branch information
IbrahimCSAE authored Sep 12, 2023
1 parent 7eda0c5 commit 74e62a1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ export default function areAllImagePositionsEqual(instances: Array<any>): boolea
return false;
}
const firstImageOrientationPatient = toNumber(instances[0].ImageOrientationPatient);
if (!firstImageOrientationPatient) {
return false;
}
const scanAxisNormal = calculateScanAxisNormal(firstImageOrientationPatient);
const firstImagePositionPatient = toNumber(instances[0].ImagePositionPatient);
const lastIpp = toNumber(instances[instances.length - 1].ImagePositionPatient);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ export default function areAllImageSpacingEqual(
return;
}
const firstImagePositionPatient = toNumber(instances[0].ImagePositionPatient);
if (!firstImagePositionPatient) {
return;
}
const lastIpp = toNumber(instances[instances.length - 1].ImagePositionPatient);

const averageSpacingBetweenFrames =
Expand Down
9 changes: 8 additions & 1 deletion platform/app/src/routes/Mode/Mode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@ function defaultRouteInit(
})
);

// log the error if this fails, otherwise it's so difficult to tell what went wrong...
allRetrieves.forEach(retrieve => {
retrieve.catch(error => {
console.error(error);
});
});

// The hanging protocol matching service is fairly expensive to run multiple
// times, and doesn't allow partial matches to be made (it will simply fail
// to display anything if a required match fails), so we wait here until all metadata
Expand Down Expand Up @@ -436,7 +443,7 @@ export default function ModeRoute({
<ImageViewerProvider
// initialState={{ StudyInstanceUIDs: StudyInstanceUIDs }}
StudyInstanceUIDs={studyInstanceUIDs}
// reducer={reducer}
// reducer={reducer}
>
<CombinedContextProvider>
<DragAndDropProvider>
Expand Down

0 comments on commit 74e62a1

Please sign in to comment.