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

Script for calculating min/max #103

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from
Open

Conversation

joshmoore
Copy link
Member

After importing with --skip=all the rendering settings for an image can be quite unattractive. If the range is large, finding a good setting manually can be problematic. This calculates the min/max per Channel and optionally creates or updates the StatsInfo for each Channel.

cc: @manics @jburel @will-moore @sbesson

Script which calculates the min/max for a given number
of images and resets the StatsInfo if so directed.
@jburel
Copy link
Member

jburel commented Jul 1, 2015

For performance, It might be actually better to calculate the rendering settings for the default plane (z =SizeZ/2, t=0)
WindowStart will be set to the min of that plane (one per channel) and WindowEnd = max of that plane
this means that we will only scan few planes.

@joshmoore
Copy link
Member Author

Is it useful to allow either/or?

@jburel
Copy link
Member

jburel commented Jul 1, 2015

Both will be useful.
The second one follows more the aim of --skip=all in my opinion.
i.e. we still offer a good visualisation experience at a low cost.

@joshmoore
Copy link
Member Author

Thoughts on the argument name and the default "off" or "on"?

@manics
Copy link
Member

manics commented Jul 1, 2015

Another option to speed things up: randomly pick N tiles across all C/Z/T/X/Y/wells, and use a single set of rendering settings for the whole plate.

@jburel
Copy link
Member

jburel commented Jul 1, 2015

The "shared" rendering settings will require some major adjustments in the way we use them to generate thumbnails or display images.

@joshmoore
Copy link
Member Author

The "shared" rendering settings will require some adjustments in the way we use them to generate thumbnails or display images.

Hadn't thought about having anything shared. I'll probably leave that for further efforts.

@joshmoore
Copy link
Member Author

joshmoore@ccabe32 is a start on "default" and "random".

Add options under the 'Choice' argument to reduce the
processing overhead.

Note: this does not yet search for random tiles across
*all* images but rather per image
@jburel
Copy link
Member

jburel commented Oct 11, 2016

Going back to the script, I am now wondering if we should not "run" it when calculating the min/max during the rendering steps

@joshmoore
Copy link
Member Author

Note: @emilroz had also started working on a version for big images while this is for HCS images. I haven't found time to unify yet.

@jburel
Copy link
Member

jburel commented May 2, 2018

Could such option be part of omero-cli-render?

@joshmoore
Copy link
Member Author

Certainly, that would match the strategy we've used with populate metadata as well:

 - library
    |_ cli
    \_ script

cc: @sbesson

"""
Process the script params to make a list of channel_offsets, then iterate
through the images creating a new image from each with the specified
channel offsets
Copy link
Member

Choose a reason for hiding this comment

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

May be out of date.

@joshmoore joshmoore changed the base branch from metadata to develop November 15, 2019 14:58
@joshmoore joshmoore self-assigned this Nov 15, 2019
pixels = oldImage.getPrimaryPixels()
rv = dict()
dt = pixels.getTile(0, 0, 0, (0, 0, 16, 16)).dtype
tile_min = iinfo(dt).max # Everything is less
Copy link
Member Author

Choose a reason for hiding this comment

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

Note: this fails for floating point data types.

statsInfos.update(x)

if debug:
print "Loaded %s tile(s) (%s bytes)" % (tile_count, byte_count)
Copy link
Member

Choose a reason for hiding this comment

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

This one and other similar print statements error in my hands. Is it because of the python3 environment I am using ?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, just use print() like

print("Loaded %s tile(s) (%s bytes)" % (tile_count, byte_count))

@jburel
Copy link
Member

jburel commented Jun 12, 2023

--exclude

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

Successfully merging this pull request may close these issues.

None yet

6 participants