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

Image appears zoomed and cropped #106

Closed
richardc-zapsurgical opened this issue May 19, 2022 · 5 comments · Fixed by #138
Closed

Image appears zoomed and cropped #106

richardc-zapsurgical opened this issue May 19, 2022 · 5 comments · Fixed by #138

Comments

@richardc-zapsurgical
Copy link

Any idea what might be causing the image to be cropped? I've seen similar issues in the older version, but a lot of the API has changed, and I am unsure how to approach it. I've tried changing the camera options but it doesn't appear to do anything for the stack version.

The image currently looks like this:
image

It should look like this:
image

This is a stack view. I've added the zoom and pan tool, but it seems like the image is still cropped.
Changing the properties or camera through setCamera and setProperties doesn't appear to do anything. I tried directly setting sHeight and sWidth, but that also doesn't appear to help.

Possibly Software Versions:

    "@cornerstonejs/calculate-suv": "1.0.2",
    "@cornerstonejs/core": "0.8.1",
    "@cornerstonejs/streaming-image-volume-loader": "0.2.24",
    "@cornerstonejs/tools": "0.15.4",
    "@kitware/vtk.js": "24.0.0",
    "react": "17.0.2",
    "vite": "2.7.2"

These are the current viewport settings:
image

These are the metadata associated with the image using a custom metadataprovider with cornerstonewebimageloader
(not a real patient below)

accessionNumber: 7974669
acquisitionDate: 20150519
acquisitionNumber: 25
acquisitionTime: "082223"
additionalPatientHistory: ""
angleOfFirstView: 0
biopsyPosition: 0
biopsyRefLocation: 0
biopsyTLocation: 0
bitsAllocated: 16
bitsStored: 16
cellNumberAtTheta: 389.75
cellSpacing: 1.0239
centerACoordOfPlaneImage: 47.5999985
centerRCoordOfPlaneImage: 2.5999999
centerSCoordOfPlaneImage: -135.75
columns: 512
contentDate: 20150519
contentTime: "082225"
convolutionKernel: "STANDARD"
correctedAfterglowTerms: 0
dasAdInput: 0
dasCalMode: 0
dasFpaGain: 0
dasOutputSource: 0
dasTriggerSource: 0
dataCollectionDiameter: 500
degreeOfRotation: 362.926819
degreesOfAzimuth: 87
deltaStartTime: 0
dependantOnNumberOfViewsProcessed: 2
distanceSourceToDetector: 949.075012
distanceSourceToPatient: 541
durationOfXrayOn: 1
exposure: 37
exposureTime: 1000
filterType: "BODY FILTER"
firstScanRas: "S"
focalSpots: 1.2
frameOfReferenceUid: "1.3.6.1.4.1.5962.99.1.2260725868.1504138972.1445369770092.7.0"
fullFidelity: "CT_LIGHTSPEED"
gantryDetectorTilt: 0
gantryPeriod: 1
generatorPower: 36000
highBit: 15
horizontalFrameOfReference: 640.039978
imageActualDate: 1432023674
imageFromWhichPrescribed: 2
imageOrientationPatient: (6) [1, '0.000000', '0.000000', '0.000000', 1, '0.000000']
imagePositionPatient: (3) [-131.1, -176.1, -135.75]
imageType: (3) ['ORIGINAL', 'PRIMARY', 'AXIAL']
instanceCreationDate: 20150519
instanceCreationTime: "082225"
instanceNumber: 200
institutionName: "Stanford"
kvp: 120
lastScanRas: "I"
manufacturer: "GE MEDICAL SYSTEMS"
manufacturerModelName: "Discovery ST"
maxOverrangesInAView: 0
midScanFlag: 1
midScanTime: 56.425903
modality: "CT"
nameOfPhysiciansReadingStudy: ""
noViewsRefChannelsBlocked: 0
normalACoord: -0
normalRCoord: 0
normalSCoord: 1
numberOfCellsInDetector: 912
numberOfOverranges: -1
numberOfTriggers: 992
operatorsName: "JL"
patientAge: "068Y"
patientBirthDate: 19470328
patientId: 8907068
patientName: "Kim^SphericalMets"
patientPosition: "HFS"
patientSex: "F"
patientWeight: 70
performedProcedureStepDescription: "Radiation Oncology CT"
performedProcedureStepId: "PPS ID  21429"
performedProcedureStepStartDate: 20150519
performedProcedureStepStartTime: "081652"
photometricInterpretation: "MONOCHROME2"
pixelData: null
pixelPaddingValue: -2000
pixelRepresentation: 1
pixelSpacing: (2) [0.501953, 0.501953]
planeType: 2
positionReferenceIndicator: "OM"
privateCreator: "GEMS_HELIOS_01"
privateScanOptions: 2
productId: "Discovery ST"
protocolName: "2.3 STEREO BRAIN"
raCoordOfTargetReconCentre: (2) [2.6, 47.599998]
reconPostProcessingFlag: 1
reconstructionDiameter: 257
referenceChannels: 0
referencedImageSequence: [{…}]
referencedPatientSequence: [{…}]
referencedStudySequence: [{…}]
referringPhysicianName: ""
requestAttributesSequence: [{…}]
rescaleIntercept: -1024
rescaleSlope: 1
rescaleType: "HU"
rotationDirection: "CW"
rows: 512
samplesPerPixel: 1
scanFovType: 16
scanOptions: "AXIAL MODE"
scanPitchRatio: ""
scoutType: 0
segmentNumber: 0
seriesContrast: 0
seriesDate: 20150519
seriesDescription: "STEREO BRAIN"
seriesFromWhichPrescribed: 1
seriesInstanceUid: "1.3.6.1.4.1.5962.99.1.2260725868.1504138972.1445369770092.6.0"
seriesNumber: 2
seriesTime: "082114"
sliceLocation: -135.75
sliceThickness: 1.25
smartScanOnOffFlag: 0
softwareVersions: "CyberKnife Information System 2.6.0.8"
sopClassUid: "1.2.840.10008.5.1.4.1.1.2"
sopInstanceUid: "1.3.6.1.4.1.5962.99.1.2260725868.1504138972.1445369770092.189.0"
startScanToXrayOnDelay: 0
startTimeSecsInFirstAxial: 1432023687.773211
stationName: "stct"
studyDate: 20150519
studyDescription: "Radiation Oncology CT"
studyId: 21429
studyInstanceUid: "1.3.6.1.4.1.5962.99.1.2260725868.1504138972.1445369770092.2.0"
studyTime: "081652"
suiteId: "STCT"
tableEndLocation: 0
tableHeight: 176
tableSpeed: 0
tableStartLocation: 0
totalSegmentsRequested: 0
triggerFrequency: 984
triggerOnPosition: 147.926682
uniqueImageIdentifier: null
unknownTagData: ""
viewCompressionFactor: 1
vmaClip: 0
vmaMamp: 0
vmaMod: 0
windowCenter: 40
windowValue: 400
windowWidth: 400
xRayTubeCurrent: 300
xrayChain: 99
@sedghi
Copy link
Member

sedghi commented May 20, 2022

Is this happening for this Stack of images only? or other stacks work fine?

@richardc-zapsurgical
Copy link
Author

richardc-zapsurgical commented May 20, 2022

It happens on all stacks, and I've tried just swapping out my source URLs with random images. It still gives me a zoomed in and cropped image.

@sedghi
Copy link
Member

sedghi commented May 20, 2022

hmmm, the demo examples are working fine (https://www.cornerstonejs.org/docs/examples)

I'm wondering if this is related to your metadataProvider. How are you loading the images?

@richardc-zapsurgical
Copy link
Author

Using the cornerstone webimageloader library. The metadata gives back exactly what is shown with the exception that the custom metadata checks if type is calibratedPixelSpacing; if so, it gives back the pixelSpacing value.

@LSanchez94
Copy link

LSanchez94 commented Jul 20, 2022

Hi, I'm having the same error, I'm using the latest versions of the packages and still having errors when loading the example Image
https://rawgit.com/cornerstonejs/cornerstoneWebImageLoader/master/examples/Renal_Cell_Carcinoma.jpg

I'm getting this result, also working with the cornerstoneWebImageLoader
example

if it's a metaprovider error, please can someone show the correct values for this, because in the code examples the metadaprovider are not similar to the examples that are in the documentation.

https://www.cornerstonejs.org/docs/how-to-guides/custom-metadata-provider

is nothing clear to the data that need to be defined in the provider for the viewer to work.

sorry for bothering you both
@sedghi can you help me with this please,
@richardc-zapsurgical did you solve this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants