OHIF with Cornerstone3D 2.0 (#4347)
This commit is contained in:
1 parent
8981a61b8c
commit
7ce7127d7c
803 files changed
+32760
-15893
No files matched your search
@@ -0,0 +1,32 @@
|
||||
import { usePositionPresentationStore } from '../../stores/usePositionPresentationStore';
|
||||
import { useLutPresentationStore } from '../../stores/useLutPresentationStore';
|
||||
import { useSegmentationPresentationStore } from '../../stores/useSegmentationPresentationStore';
|
||||
|
||||
export function getViewportPresentations(
|
||||
viewportId: string,
|
||||
viewportOptions: AppTypes.ViewportGrid.GridViewportOptions
|
||||
) {
|
||||
const { lutPresentationStore } = useLutPresentationStore.getState();
|
||||
const { positionPresentationStore } = usePositionPresentationStore.getState();
|
||||
const { segmentationPresentationStore } = useSegmentationPresentationStore.getState();
|
||||
|
||||
// NOTE: this is the new viewport state, we should not get the presentationIds from the cornerstoneViewportService
|
||||
// since that has the old viewport state
|
||||
const { presentationIds } = viewportOptions;
|
||||
|
||||
if (!presentationIds) {
|
||||
return {
|
||||
positionPresentation: null,
|
||||
lutPresentation: null,
|
||||
segmentationPresentation: null,
|
||||
};
|
||||
}
|
||||
|
||||
const { lutPresentationId, positionPresentationId, segmentationPresentationId } = presentationIds;
|
||||
|
||||
return {
|
||||
positionPresentation: positionPresentationStore[positionPresentationId],
|
||||
lutPresentation: lutPresentationStore[lutPresentationId],
|
||||
segmentationPresentation: segmentationPresentationStore[segmentationPresentationId],
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user