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

MCNR Exception calling #27

Open
ezemiron opened this issue Mar 31, 2016 · 5 comments
Open

MCNR Exception calling #27

ezemiron opened this issue Mar 31, 2016 · 5 comments

Comments

@ezemiron
Copy link

Running SIMcheck>Raw data>Modulation contrast on an image with negative pixel values, inf or NaN's produce an Exception window to pup up with the following information:

(Fiji Is Just) ImageJ 2.0.0-rc-43/1.50g; Java 1.6.0_65 [64-bit]; Mac OS X 10.10.5; 1618MB of 7241MB (22%)

java.lang.NumberFormatException: Infinite or NaN
at java.math.BigDecimal.(BigDecimal.java:797)
at SIMcheck.J.d2s(J.java:111)
at SIMcheck.ResultSet.report(ResultSet.java:146)
at SIMcheck.Raw_ModContrast.run(Raw_ModContrast.java:106)
at ij.IJ.runUserPlugIn(IJ.java:212)
at ij.IJ.runPlugIn(IJ.java:176)
at ij.Executer.runCommand(Executer.java:137)
at ij.Executer.run(Executer.java:66)
at java.lang.Thread.run(Thread.java:695)

@iandobbie
Copy link
Member

No surprise there. This function is for raw data and doesn't expect negative or non-existent numbers. Maybe it should fail more cleanly but I don't think this is a serious bug.

Ian

Sent from my iPhone

On 31 Mar 2016, at 12:59, ezemiron <[email protected]mailto:[email protected]> wrote:

Running SIMcheck>Raw data>Modulation contrast on an image with negative pixel values, inf or NaN's produce an Exception window to pup up with the following information:

(Fiji Is Just) ImageJ 2.0.0-rc-43/1.50g; Java 1.6.0_65 [64-bit]; Mac OS X 10.10.5; 1618MB of 7241MB (22%)

java.lang.NumberFormatException: Infinite or NaN
at java.math.BigDecimal.(BigDecimal.java:797)
at SIMcheck.J.d2s(J.java:111)
at SIMcheck.ResultSet.report(ResultSet.java:146)
at SIMcheck.Raw_ModContrast.run(Raw_ModContrast.java:106)
at ij.IJ.runUserPlugIn(IJ.java:212)
at ij.IJ.runPlugIn(IJ.java:176)
at ij.Executer.runCommand(Executer.java:137)
at ij.Executer.run(Executer.java:66)
at java.lang.Thread.run(Thread.java:695)


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHubhttps://github.com//issues/27

@ezemiron
Copy link
Author

That is what I thought.
However, I am using it on raw data that has been aligned to match the alignment of my reconstructed data.

The rationale behind this is to use an aligned MCNR and create a binary mask of "trustworthy" values to overlay on to my aligned reconstructed results, excluding some results based on SIM quality not just intensity (like what happens in the modal-threshold tool).

The problem arises with how the alignment software fills the 1-pixel gap between the pixels left by the alignment shift (all zeros) and the rest of the real image pixels. What it seems to do is some interpolation between these zeros and the pixels of the image to generate a 1-pixel row/column of intermediate values, possibly to avoid a hard edge?. On some datasets these pixels are positive (perhaps like a weighted average), so no MCNR problems, but for other datasets these are small negative values (no idea how they are derived) and then MCNR can't cope.

E

@graemeball
Copy link
Contributor

@ezemiron thanks for letting us know -- I will make a note to fix the issue. In the meantime, did you try adding a small offset to the pixel intensities to make them all positive?

Cheers,
Graeme

@ezemiron
Copy link
Author

Thanks,
I've thought of something similar, although I can't do a standard small offset value because this changes from image to image.
I was thinking of using a threshold at 0 and working from there.
E

@graemeball
Copy link
Contributor

@ezemiron you could use ImageJ's Process>Math>Min function with a value of 0

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

No branches or pull requests

3 participants