-
Notifications
You must be signed in to change notification settings - Fork 9
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
The size of emailed screenshots of the same image varies with browser window size #4
Comments
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? |
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. |
I agree that the size should be configurable either by the user or by a configuration option somewhere in the future. It is OK by me for the size to be hard-coded at this time for the purposes of this operational test by Stanford.
… On Apr 23, 2021, at 6:08 PM, Scott Wittenburg ***@***.***> wrote:
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.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub <#99 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAQNT5VC3DZ3INTPDERMQKTTKHVWBANCNFSM43PMIJMA>.
|
Looping in @jimklo in case he has thoughts. |
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.
|
Great questions. I think we should keep the longer side of the image equal to 512 ( which is often the native resolution) and resize the shorter side to keep the aspect ratio. I would use BILINEAR resampling, which is supported by the PIL.Image.resize method. We should be able to do all with PIL without having to go to ITK. In many cases, we won’t have to resample much, I hope.
… On Apr 26, 2021, at 8:04 PM, Scott Wittenburg ***@***.***> wrote:
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.
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.
What kind of interpolation (for growing) and what kind of sampling (for shrinking) should we use in resizing?
Should the screenshot dimensions be chosen based on the original image resolution (perhaps to avoid excessive interpolation/sampling)?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
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. |
@scottwittenburg from Sebastien, we can it on the client side
|
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. |
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. |
OpenImaging/miqa-phase1#114 is a work in progress, in a sense that it depends on Kitware/vtk-js#1907. |
I will follow up on this issue and revert back here |
I have created a new issue that clarifies the requirements (#18). Closing this issue in favor of the new one. |
From a user:
The text was updated successfully, but these errors were encountered: