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

The size of emailed screenshots of the same image varies with browser window size #4

Closed
scottwittenburg opened this issue Apr 23, 2021 · 13 comments · May be fixed by OpenImaging/miqa-phase1#114
Assignees
Projects

Comments

@scottwittenburg
Copy link

From a user:

It seems that the sizing of the attached snapshots for the same session vary in relationship to the client browser’s window size.  e.g. I’ve got a huge 4k display… if I maximize the browser and send screenshots, the resulting image attachments are very large.  However if I shrink the browser window down to ¼ of the display, I get much smaller attachments.  I would expect to get the same sized image irrespective of the browser window dimensions. Is there a way we can make this consistent irrespective of the browser size.

@curtislisle
Copy link
Contributor

curtislisle commented Apr 23, 2021

How about adding an ITK processing step in the email handler somewhere around https://github.com/OpenImaging/miqa/blob/master/server/miqa_server/email.py#L46 to resample the image to 512x512 before appending it to the HTML?

@scottwittenburg
Copy link
Author

That's an option. But I'm also wondering if we can find api somewhere on the client that would let us generate the image at a specified size. These values could either be 512 x 512 as you suggested, or else exposed to the user as an option as time permits.

@curtislisle
Copy link
Contributor

curtislisle commented Apr 23, 2021 via email

@scottwittenburg
Copy link
Author

Looping in @jimklo in case he has thoughts.

@scottwittenburg
Copy link
Author

So far I haven't found api in vtk.js that would let us request a screenshot at a specified size.

Regardless of the approach we end up taking in the long run, I think I still have some questions about how this should behave.

  1. I assume we want the screenshot to maintain the aspect ratio of the original image? If so, how should we choose an image size? E.g. we could choose to fix the larger dimension of screenshots to certain size, or fix the width to a certain size, and let the other dimension vary with the aspect ratio of the original image.
  2. What kind of interpolation (for growing) and what kind of sampling (for shrinking) should we use in resizing?
  3. Should the screenshot dimensions be chosen based on the original image resolution (perhaps to avoid excessive interpolation/sampling)?

@curtislisle
Copy link
Contributor

curtislisle commented Apr 27, 2021 via email

@curtislisle
Copy link
Contributor

Per discussion with Kilian & Jim on 4/28 - They indicated that aspect ratio has to be maintained. Their use case is that sometimes images are too large. Images almost/never need to be made larger. We discussed that MIQA (in the longer term) could be configurable somewhere to have default image sizes. In the current version, I believe we can set a fixed, reasonable size (e.g. 512xYYY). I suggest we implement either in the client or server. Looking at the server code, it looks not too hard to add an ITK filter in the Email section of the server code.

@aashish24
Copy link

aashish24 commented Apr 28, 2021

@scottwittenburg from Sebastien, we can it on the client side

  1. screenshot same size to replace the rw with it

  2. hide and resize rw

  3. take screenshot

  4. resize rw to origin and put it back to its original location

@aashish24
Copy link

As per our discussions @scottwittenburg will push a PR to vtk.js to address MIQA needs (which also benefits others efforts) and if time remains integrate it in MIQA or hand if off to someone else.

@jimklo
Copy link
Collaborator

jimklo commented May 12, 2021

I've reviewed OpenImaging/miqa-phase1#114 in our integration environment. The unless there's some additional setting that needs to be done, this doesn't appear to work quite yet. Via email all images I receive appear to be significantly larger than 512x512 (which is the fixed size hard coded in the PR.

@dzenanz
Copy link
Member

dzenanz commented May 12, 2021

OpenImaging/miqa-phase1#114 is a work in progress, in a sense that it depends on Kitware/vtk-js#1907.

@aashish24
Copy link

I will follow up on this issue and revert back here

@aashish24 aashish24 transferred this issue from OpenImaging/miqa-phase1 May 28, 2021
@aashish24 aashish24 added this to Backlog in scrum board via automation May 28, 2021
@aashish24 aashish24 moved this from Backlog to Sprint Tasks (Priority) in scrum board May 28, 2021
@aashish24 aashish24 moved this from Sprint Tasks (Priority) to In progress in scrum board May 28, 2021
@aashish24 aashish24 self-assigned this Jun 3, 2021
@aashish24
Copy link

I have created a new issue that clarifies the requirements (#18). Closing this issue in favor of the new one.

scrum board automation moved this from In progress to Done Jun 4, 2021
annehaley pushed a commit that referenced this issue Jun 10, 2022
Fix Scan decision field values
dzenanz pushed a commit that referenced this issue Jul 22, 2022
Fix Scan decision field values
zachmullen pushed a commit that referenced this issue Dec 19, 2022
Fix Scan decision field values
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging a pull request may close this issue.

5 participants