question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Rescaling images on two layers

See original GitHub issue

Hi! I’m trying to display two images in layers onto an element. One is loaded through the WADO Loader and has dimensions of eg. 2000x3000 and the other through Web Image Loader and has dimensions of e.g. 500x500.

Browsing through the API, I noticed rescaleImage() and tried to use it. Initially, trying to use it as cornerstone.rescaleImage(layer1, layer2) returned cornerstone.rescaleImage is not a function. After adding it to exports I was able to call it but it doesn’t really match layers dimensions as I expected.

Is that the proper usage of rescaleImage()? If I understand correctly, the best (only?) way to match two images would be a custom image loader that rescales the images in there?

Thanks!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
despritcommented, Jun 7, 2021

In my case it was a little bit different. I’m rendering a SEG dicom on top of the normal one. I tried to manually change scale and pixel spacing on both of them bit it didn’t work - the SEG dicom always had different scale. Then I changed it’s originalScale and it worked!

layers[i].syncProps.originalScale = layers[0].viewport.scale;
0reactions
CredoSperocommented, Jun 24, 2022

Hi @CredoSpero, unfortunately I don’t have access to that code and I haven’t used cornerstonejs in a while, sorry… Maybe one of the cornerstone devs will be able to help here, it’s probably best if you open a new issue with your code and link to this one as a reference?

Okay thank you so much for the quick response. Will open a new issue instead!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to resize layers in Adobe Photoshop
Press Ctrl+T on Windows or Command+T on Mac to instantly access the Free Transform tool and bring up the sizing handles so you...
Read more >
How To Resize, Combine, & Merge Layers In Photoshop
You can resize, rearrange, and merge image layers in Photoshop to get the effect you desire. Start by uploading an image to Photoshop....
Read more >
How to resize multiple images, or layers, on one ... - Quora
In the Layers panel, select one or more layers that contain images or objects you want to resize. Choose Edit > Free Transform....
Read more >
How To Resize A Layer In Photoshop
To put your image into Free Transform mode, go to Edit > Free Transform. You can do this faster by pressing Control +...
Read more >
How do I resize multiple images at once in Photoshop?
If you want to resize multiple images at the same time, you can use the Canvas Size option in the Image > Canvas...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found