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

Normalization of pixel values between 0 and 1 #4

Open
dietzc opened this issue Feb 2, 2015 · 3 comments
Open

Normalization of pixel values between 0 and 1 #4

dietzc opened this issue Feb 2, 2015 · 3 comments
Assignees

Comments

@dietzc
Copy link
Contributor

dietzc commented Feb 2, 2015

CellProfiler, for now, only accepts images with pixel values between 0 and 1. We should normalize the images in the knime-bridge, rather than in KNIME itself. Therefore we can directly do it on the underlying data-array, which is faster. Additionally, users don't need to worry about a suitable format for CellProfiler, as the bridge takes care about.

@dietzc dietzc self-assigned this Feb 2, 2015
@LeeKamentsky
Copy link

The problem is that Knime hasn't filled in the ImgPlus.set/getValid bits field:

https://github.com/CellProfiler/knime-bridge/blob/master/src/main/java/org/cellprofiler/knimebridge/message/RunReq.java#L68

If you did this for integer images, the bridge would normalize properly. Floating-point images should probably not be normalized.

I should probably pass this through the bridge because applications like ImageJ and Ilastik need to have the image un-normalized: converted to 8-bit or 16-bit ranges for analysis.

@dietzc
Copy link
Contributor Author

dietzc commented Feb 3, 2015

So how can I decide on KNIME side which images I should normalize between 0...1 and which I shouldn't? Can I get this information from the pipeline?

@LeeKamentsky
Copy link

Is there some way you can call ImgPlus.setValidBits()? It should be easy for 8-bit (if you have a byte image, setValidBits(8), but for 16, some of them are really 12 (0-4095) which you can tell by reading the TIFF. If you do that, it's my job to normalize (or the job of the bridge).

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

No branches or pull requests

2 participants