Error for Waveness Roughness

imagej

#1

When I try to evaluate Waveness Roughness it appears this Errror

: ImageJ 1.51k; Java 1.6.0_24 [64-bit]; Windows NT (unknown) 6.2; 24MB of 3756MB (<1%)

java.lang.NoSuchMethodError: ij.plugin.filter.GaussianBlur.blur(Lij/process/ImageProcessor;D)V
at Waveness_Roughness.run(Waveness_Roughness.java:78)
at ij.plugin.filter.PlugInFilterRunner.processOneImage(PlugInFilterRunner.java:265)
at ij.plugin.filter.PlugInFilterRunner.(PlugInFilterRunner.java:114)
at ij.IJ.runUserPlugIn(IJ.java:219)
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:662)


#2

Hello LC -

According to Herbie in this forum thread:

Surface roughness

this is a known issue.

It appears that the Waveness Roughness plugin is out of date and
no longer supported. It appears that the GaussianBlur.blur()
method (of the NoSuchMethodError) had been deprecated, and
presumably removed.

Herbie offers some suggestions for possible ways forward in his post.

Thanks, mm


#3

Hi LCT,
it seems that only the compiled .class file does not work any more; the java code is ok.
Please try downloading the java source and then “Compile&Run”
(assuming you are running plain ImageJ; not sure whether it works with Fiji).
The GaussianBlur.blur( ip, radius) method was not removed; it is only deprecated for use in new plugins.
– Michael


#4

Hello Michael (and all you Fiji-Land java experts) -

For no particular reason, I am trying to figure out what
is going on here, and have embarked on some ImageJ
archeology. Any correction or clarification for my working
theory (see below) would be helpful.

LC’s error

java.lang.NoSuchMethodError: ij.plugin.filter.GaussianBlur.blur(Lij/process/ImageProcessor;D)V

looks to to me like the Waveness_Roughness.class file
that LC was running is calling for a blur method with a
return type of void (and that takes an ImageProcessor
and double as arguments).

My ij-1.52f.jar file (shipped with / auto-updated by
Fiji) contains a GaussianBlur.class that provides a
blur method returning a boolean (consistent with the
current GaussianBlur javadoc and java code):

blur???(Lij/process/ImageProcessor;D)Z

So, because of the voidboolean return-type mismatch,
NoSuchMethodError seems to make sense.

Am I reading the NoSuchMethodError and function
signatures correctly?

The current(?) Waveness_Roughness code:

Waveness_Roughness.java

   //Detect the surface waveness
   gb.blur(ipWaveness,r);

doesn’t use any return value, so it should be compile-time
compatible with a blur return type of either boolean or void.

What I assume happened is that sometime in the past,
GaussianBlur.blur(...) did have void as its return
type, and LC’s Waveness_Rougness.class was compiled
against such a version. Then blur was changed to return-type
boolean (but always returning true, go figure), and the
boolean version was shipped with Fiji / ImageJ, breaking the
old Waveness_Roughness.class (but the unchanged
Waveness_Roughness.java code still works if recompiled
against the new, boolean version of GaussianBlur.class).

However, the oldest version of GaussianBlur.java that I have
been able to find (dated Jul 10, 2008):

has blur with return type boolean (but not yet annotated as deprecated):

    /** Gaussian Filtering of an ImageProcessor. This method is for compatibility with the
     *  previous code (before 1.38r) and uses a low-accuracy kernel, only slightly better
     *  than the previous ImageJ code */
    public boolean blur(ImageProcessor ip, double radius) {
        Rectangle roi = ip.getRoi();
        if (roi.height!=ip.getHeight() && ip.getMask()==null)
            ip.snapshot();              // a snapshot is needed for out-of-Rectangle pixels
        blurGaussian(ip, 0.4*radius, 0.4*radius, 0.01);
        return true;
    }

Does this all seem to be the correct explanation of what is going on?
Is there an older, return-type-void version of GaussianBlur.blur(...)
floating around out there as this explanation would seem to require?

Thanks, mm


#5

Thank-you, best regards!


#6

Thank-you, kind regards!