fiji / Colocalisation_Analysis

Fiji's plugin for colocalization analysis
http://imagej.net/Coloc_2
GNU General Public License v3.0
24 stars 18 forks source link

Exception while trying to use Coloc2 #64

Closed zeitgeist1 closed 7 years ago

zeitgeist1 commented 7 years ago

Hi,

Could anybody please help me solve this exception. I am trying to use this in two images with one red channel and another green channel image. I have set both the image type to be RGB colour. I have updated my installation of the software. But still, I get the below error. I am sure there is a simple solution but I am not sure I understand this exception.

Thanks a lot

(Fiji Is Just) ImageJ 2.0.0-rc-61/1.51n; Java 1.8.0_66 [64-bit]; Windows 10 10.0; 70MB of 6032MB (1%)

java.lang.ClassCastException: net.imglib2.type.numeric.ARGBType cannot be cast to net.imglib2.type.numeric.RealType
    at net.imglib2.algorithm.math.ImageStatistics.getImageMean(ImageStatistics.java:105)
    at sc.fiji.coloc.gadgets.DataContainer.calculateStatistics(DataContainer.java:230)
    at sc.fiji.coloc.gadgets.DataContainer.<init>(DataContainer.java:127)
    at sc.fiji.coloc.Coloc_2.colocalise(Coloc_2.java:486)
    at sc.fiji.coloc.Coloc_2.colocalise(Coloc_2.java:452)
    at sc.fiji.coloc.Coloc_2.run(Coloc_2.java:176)
    at ij.IJ.runUserPlugIn(IJ.java:217)
    at ij.IJ.runPlugIn(IJ.java:181)
    at ij.Executer.runCommand(Executer.java:137)
    at ij.Executer.run(Executer.java:66)
    at java.lang.Thread.run(Thread.java:745)
imagejan commented 7 years ago

You should not use RGB color images to measure colocalization. Try providing each channel as 8-bit or 16-bit image. (Instead of throwing an exception, the plugin should be improved to warn users when supplying RGB inputs.)

ctrueden commented 7 years ago

@etarena This is where I suggest adding the check to guard against RGB images.

etadobson commented 7 years ago

Done. :)