fix: Enhance multiframe instance handling and improve instance valida… (#5956)
fix: Enhance multiframe instance handling and improve instance validation - Updated `getDisplaySetInfo` to ensure local file frame imageIds resolve correctly, falling back to the source multiframe instance when necessary. - Improved instance filtering in `isDisplaySetReconstructable` to handle undefined instances more robustly. - Modified `App` prop types to make `routerBasename` optional and added new props for loading indicators and data sources. - Refactored `CinePlayer` component to replace Button with a div for better accessibility and interaction.
This commit is contained in:
1 parent
3069d33c99
commit
f5a66b9eea
4 files changed
+30
-15
No files matched your search
@@ -48,12 +48,20 @@ function getDisplaySetInfo(instances) {
|
||||
let firstTimePointInstances;
|
||||
|
||||
if (instances[0].NumberOfFrames > 1 && timePoints.length > 1) {
|
||||
// handle multiframe dynamic volume
|
||||
firstTimePointInstances = timePoints[0].map(imageId => metaData.get('instance', imageId));
|
||||
// Handle multiframe dynamic volumes. Local file frame imageIds do not
|
||||
// always resolve to a frame-level instance object, so keep resolved
|
||||
// entries and fall back to the source multiframe instance when needed.
|
||||
firstTimePointInstances = timePoints[0]
|
||||
.map(imageId => metaData.get('instance', imageId))
|
||||
.filter(Boolean);
|
||||
|
||||
if (!firstTimePointInstances.length) {
|
||||
firstTimePointInstances = [instances[0]];
|
||||
}
|
||||
} else {
|
||||
// O(n) to convert it into a map and O(1) to find each instance
|
||||
instances.forEach(instance => instancesMap.set(instance.imageId, instance));
|
||||
firstTimePointInstances = timePoint.map(imageId => instancesMap.get(imageId));
|
||||
firstTimePointInstances = timePoint.map(imageId => instancesMap.get(imageId)).filter(Boolean);
|
||||
}
|
||||
displaySetInfo = isDisplaySetReconstructable(firstTimePointInstances, appConfig);
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user