Skip to content

Commit

Permalink
fix bugs with SRs
Browse files Browse the repository at this point in the history
  • Loading branch information
IbrahimCSAE committed Nov 29, 2024
1 parent 96f6b06 commit bbfc2a3
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,13 @@ export default function hydrateStructuredReport(
) {
const annotationManager = CsAnnotation.state.getAnnotationManager();
const dataSource = extensionManager.getActiveDataSource()[0];
const { measurementService, displaySetService, customizationService } = servicesManager.services;
const {
measurementService,
displaySetService,
customizationService,
viewportGridService,
cornerstoneViewportService,
} = servicesManager.services;

const codingValues = customizationService.getCustomization('codingValues', {});

Expand Down Expand Up @@ -191,13 +197,18 @@ export default function hydrateStructuredReport(
// StudyInstanceUID,
} = instance;

const activeViewportId = viewportGridService.getActiveViewportId();
const cornerstoneViewport =
cornerstoneViewportService.getCornerstoneViewport(activeViewportId);
const viewRef = cornerstoneViewport.getViewReference({ referenceImageId: imageId });

const annotation = {
annotationUID: toolData.annotation.annotationUID,
data: toolData.annotation.data,
metadata: {
toolName: annotationType,
referencedImageId: imageId,
FrameOfReferenceUID,
...viewRef,
},
};

Expand Down
4 changes: 1 addition & 3 deletions extensions/cornerstone/src/initMeasurementService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -420,9 +420,7 @@ const connectMeasurementServiceToTools = (measurementService, cornerstoneViewpor
isLocked: false,
invalidated: false,
metadata: {
toolName: measurement.toolName,
FrameOfReferenceUID: measurement.FrameOfReferenceUID,
referencedImageId: imageId,
...measurement.metadata,
},
data: {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { utils } from '@ohif/core';
import { config } from '@cornerstonejs/tools/annotation';

const Length = {
toAnnotation: measurement => {},
toAnnotation: measurement => { },

/**
* Maps cornerstone annotation event data to measurement service format.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,14 +282,14 @@ export default function PanelStudyBrowserTracking({
const { displaySetsAdded, options } = data;
displaySetsAdded.forEach(async dSet => {
const displaySetInstanceUID = dSet.displaySetInstanceUID;

const isExcludedFromThumbnailBrowser = dSet.excludeFromThumbnailBrowser;
const newImageSrcEntry = {};
const displaySet = displaySetService.getDisplaySetByUID(displaySetInstanceUID);
if (displaySet?.unsupported) {
return;
}

if (options.madeInClient) {
if (options.madeInClient && !isExcludedFromThumbnailBrowser) {
setJumpToDisplaySet(displaySetInstanceUID);
}

Expand Down

0 comments on commit bbfc2a3

Please sign in to comment.