feat: Allow multiframe volumes (#3089)

* Allow multiframe volumes

* feat:Allow display of multiframe volume
This commit is contained in:
Bill Wallace authored and GitHub committed 2023-01-05 20:26:26 -05:00
1 parent 00e797801d
commit fb2a60ae19
3 files changed
+63 -4

No files matched your search

@@ -38,9 +38,50 @@ export default function isDisplaySetReconstructable(instances) {
}
}
function processMultiframe(instance) {
//TODO: deal with multriframe checks! return false for now as can't reconstruct.
return { value: false };
function processMultiframe(multiFrameInstance) {
const {
PerFrameFunctionalGroupsSequence,
SharedFunctionalGroupsSequence,
} = multiFrameInstance;
// If we don't have the PixelMeasuresSequence, then the pixel spacing and
// slice thickness isn't specified or is changing and we can't reconstruct
// the dataset.
if (
!SharedFunctionalGroupsSequence ||
!SharedFunctionalGroupsSequence[0].PixelMeasuresSequence
) {
return { value: false };
}
// Check that the orientation is either shared or with the allowed
// difference amount
const {
PlaneOrientationSequence: sharedOrientation,
} = SharedFunctionalGroupsSequence;
if (!sharedOrientation) {
const {
PlaneOrientationSequence: firstOrientation,
} = PerFrameFunctionalGroupsSequence[0];
if (!firstOrientation) {
console.log('No orientation information');
return { value: false };
}
// TODO - check orientation consistency
}
const frame0 = PerFrameFunctionalGroupsSequence[0];
const firstPosition =
frame0.PlanePositionSequence || frame0.CTPositionSequence;
if (!firstPosition) {
console.log('No image position information, not reconstructable');
return { value: false };
}
// TODO - check spacing consistency
return { value: true };
}
function processSingleframe(instances) {