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

Scale bar lengths #253

Merged
merged 3 commits into from
Apr 2, 2019
Merged

Scale bar lengths #253

merged 3 commits into from
Apr 2, 2019

Conversation

will-moore
Copy link
Member

@will-moore will-moore commented Mar 19, 2019

See #252

Now we calculate the length of the scalebar to show a nice rounded number.

To test:

E.g, zooming in looks something like this:

Screen Shot 2019-03-19 at 04 08 15

Screen Shot 2019-03-19 at 04 08 31

Screen Shot 2019-03-19 at 04 08 50

Screen Shot 2019-03-19 at 04 08 57

Screen Shot 2019-03-19 at 04 09 08

Screen Shot 2019-03-19 at 04 09 15

@rgozim
Copy link
Member

rgozim commented Mar 19, 2019

Added a single comment to the code, but otherwise works fine. Tested on firefox, safari and chrome.

@jburel jburel added this to the 0.7.0 milestone Mar 19, 2019
@jburel jburel mentioned this pull request Mar 19, 2019
Copy link
Member

@sbesson sbesson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the IDR perspective, the rounded scale bar values matches the expectations from publication figures. Overall strong endorsement to have this in the next OMERO.iviewer release candidate.

For testing the lower units, it might be worth testing it against https://idr.openmicroscopy.org/webclient/img_detail/4495402/?dataset=4408 which scale bars should range from Angströms to microns.

@@ -222,7 +222,7 @@ export const PROJECTION = {
*/
export const UNITS_LENGTH = [
{ unit: 'angstrom',
threshold: 0.1, multiplier: 10000, symbol: '\u212B'},
threshold: 0.01, multiplier: 10000, symbol: '\u212B'},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the impact of modifying this threshold?

Copy link
Member Author

@will-moore will-moore Apr 1, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If, for example, the minimum length of scalebar was 0.08 microns, then we look for a UNIT where the threshold is larger than this (starting at the smallest, angstrom). With the old value of 0.1, we pick angstrom as a suitable unit for a scalebar of 0.08 microns. When the scalebar is increased from 800 angstrom to a rounded length, we end up with a length of 1000 angstrom.
With the change in threshold, we instead end up picking nm and we get a scalebar of 100 nm which seems more appropriate.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I see, so anything below 0.01 microns will be turned into angstroms rather than nanometers. Sounds like a fair cutoff and certainly better than 100 nm. We can review this and further push towards 1nm if needed.

Copy link
Member

@sbesson sbesson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ready for inclusion in the next 0.7.0 pre-release from my side.

@jburel jburel merged commit eca02d7 into ome:master Apr 2, 2019
@kouichi-c-nakamura
Copy link
Member

Thanks a lot guys for implementing this! People are going to love this (though they may just assume that it has been like this)!

@kouichi-c-nakamura
Copy link
Member

We have finally updated iviewer for our CHAMBER server and delighted to see the improved scale bar in action. Thanks, guys!

http://chamber.mrc.ox.ac.uk/iviewer/?images=120&dataset=51

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 this pull request may close these issues.

5 participants