Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SliceLocation #4598

Open
Cristian-tec opened this issue Dec 12, 2024 · 2 comments
Open

SliceLocation #4598

Cristian-tec opened this issue Dec 12, 2024 · 2 comments
Assignees
Labels
Awaiting Reproduction Can we reproduce the reported bug?

Comments

@Cristian-tec
Copy link

Describe the Bug

Hello, how are you all?
Question...
How can I add sliceLocation to the viewport? I have tried but I can’t get it to work, since it stops working in sagittal and coronal.
This function and the slice thickness are available in the viewport version 4.12.5.
I was able to add the patient name, series, description.
But I can’t get the position and thickness to work properly.
I read fix(CustomViewportOverlay): pass accurate data to Custom Viewport Functions by Michael-Andersen · Pull Request #4224 · OHIF/Viewers · GitHub, but I didn’t get anything, I have a bit of trouble understanding the code.
All help and recommendations are welcome.

Regards

Why should we prioritize this feature?

I think they should have all these indicators.

Steps to Reproduce

I tried copying the code from an older version of ohif, but I couldn't get it to work.

The current behavior

I cannot show the position of the cuts, only in axial, but sagittal and coronal I have problems, it does not match what it should be.

The expected behavior

Correctly display slice Location and thickness.

OS

windows 10

Node version

22

Browser

Chrome

@Cristian-tec Cristian-tec added the Awaiting Reproduction Can we reproduce the reported bug? label Dec 12, 2024
@sedghi
Copy link
Member

sedghi commented Dec 12, 2024

can you send me the customizatino item that you have added but does not work? see here https://docs.ohif.org/platform/services/ui/customization-service/

@Cristian-tec
Copy link
Author

Cristian-tec commented Dec 12, 2024

Hi Sedghi!
Mi code:

window.config = {
routerBasename: "/",
extensions: [],
modes: [],
customizationService: {
dicomUploadComponent:
"@ohif/extension-cornerstone.customizationModule.cornerstoneDicomUploadComponent",
cornerstoneOverlayTopRight: {
id: "cornerstoneOverlayTopRight",
items: [
{
id: "SliceLocation",
customizationType: "ohif.overlayItem",
label: "Loc:",
title: "Slice Location",
instanceIndex: 0,
contentF: ({
referenceInstance,
currentInstance,
viewportData,
imageSliceData,
viewportId,
instanceNumber,
formatters: { formatNumberPrecision },
}) => {
if (!referenceInstance) {
return;
}
var instanceNum;
if (referenceInstance.ImagePositionPatient == null) {
return;
}
if (viewportId.toLowerCase().includes("fusion")) {
return;
}
if (viewportId.toLowerCase().includes("sagittal")) {
instanceNum = imageSliceData.imageIndex;
var res =
formatNumberPrecision(
referenceInstance.ImagePositionPatient[0] +
referenceInstance.PixelSpacing[0] * instanceNum,
2
) + " mm";
return res;
} else if (viewportId.toLowerCase().includes("coronal")) {
instanceNum = imageSliceData.imageIndex;
var res =
formatNumberPrecision(
referenceInstance.ImagePositionPatient[1] +
referenceInstance.PixelSpacing[1] * instanceNum,
2
) + " mm";
return res;
} else {
instanceNum = currentInstance.ImageIndex - 1;
var res =
formatNumberPrecision(currentInstance.SliceLocation, 2) + " mm";
return res;
}
},
},
],
},
},
showStudyList: true,
maxNumberOfWebWorkers: 3,
showWarningMessageForCrossOrigin: true,
showCPUFallbackMessage: true,
showLoadingIndicator: true,
strictZSpacingForVolumeViewport: true,
maxNumRequests: {
interaction: 100,
thumbnail: 75,
prefetch: 25,
},

I built an image from source, and tried to get it working with docker but couldn't.
I also tried the component in the source code, but I got a bit lost here. I only managed to add patient name and some other things, but sliceLocation and thicknesses don't work well for me, sliceLocation directly can never make it work.

Regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Reproduction Can we reproduce the reported bug?
Projects
None yet
Development

No branches or pull requests

3 participants