ImageJ/Fiji error report

Please, coul anyone hepl me with this error message, when I wanted to analyze my figure through:
Image - Adjust - Brightenes/contrast - Auto - Apply, then the action is not completed et all and I only see on console this error message:

Exception in thread "ContrastAdjuster" java.lang.ClassCastException: loci.plugins.util.RecordedImageProcessor cannot be cast to ij.process.ByteProcessor

at ij.process.ByteStatistics.<init>(

at ij.process.ImageStatistics.getStatistics(

at ij.ImagePlus.getRawStatistics(

at ij.plugin.frame.ContrastAdjuster.autoAdjust(

at ij.plugin.frame.ContrastAdjuster.doUpdate(



Do you know, what I can do with it, how I can fix it,
are there any options, please?
Thank you Jana

Hey Jana,

which image did you use? I tried with an image of mine and the error doesn’t pop up :wink:

Furthermore, why do you want to use the Apply button? It recalculates pixel values - but what for? What’s your next step?


1 Like

Hello Jana -

You don’t tell us what kind of image you are working with, but
the ClassCastException error you report, together with this

suggest that your are working with a virtual stack, rather than
a regular in-memory image. If so, you can’t Apply the adjusted
Brightness/Contrast to your image.

(It would be nice if Fiji / Image would give an informative warning
about this, rather than throwing an exception.)

Like Robert, I cannot reproduce your error on a normal image.
I also can’t reproduce your ClassCastException using a virtual
stack – I get a more user-friendly warning.

If this virtual-stack business isn’t enough for you to resolve your
issue, could you post the image that fails for you, instructions (or
better, a script) that reproduce the issue, and tell us what version
of Fiji / ImageJ you are running?

Thanks, mm

Thank you for advices,
I am using ImageJ 2.0.0-rc-69/1.52n; Java 1.8.0_172 [64bit]. Is it ok?
I have the same version in my home notebook and everything is functional and ImageJ running well, but on working computer I have the problem I was told earlier.
I wanted to fine-tune the original file (e.g. 15 stacks in 1 file, 65.34x65.34 microns (724x724); 8-bit;

14MBHEK293T JUNO Fcrl3 PHALLOIDIN488 ii.czi - C=0.tif (5.1 MB)

Hello Jana -

As I indicated in my previous reply, it’s hard for us to help you if
you don’t tell us how to reproduce your problem.

When I use File > Open... to open the image stack (.tif) that
you posted, I can run
Image > Adjust > Brightness/Contrast... and run
“Auto” / “Apply” just fine.

When I use File > Import > TIFF Virtual Stack...
and try to run “Auto” / “Apply” (clicking “Yes” for “Apply LUT to
all 15 stack slices?”), I get the pop-up message “‘Apply’ does
not work with virtual stacks. Use Image>Duplicate to convert to
a normal stack.”

I haven’t found a way to reproduce the ClassCastException
you describe.

Try opening your image as an ordinary, non-virtual stack, or
convert your virtual stack to an ordinary stack. If this doesn’t
work (or isn’t relevant to your case), please post an explicit,
detailed recipe that we can use to reproduce your issue.

(Your ImageJ is essentially up to date. It is the same version
as the one I used for my tests on your image stack.)

Thanks, mm