Bug in ImageJ?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Bug in ImageJ?

Andreas Maier
   Hi,

I have a question to the ImageProcessor class. In interpolated value
this statement is found:

------------------------------

public final double getInterpolatedValue(double x, double y) {
         if (useBicubic)
             return getBicubicInterpolatedPixel(x, y, this);
         if (x<0.0 || x>=width-1.0 || y<0.0 || y>=height-1.0) {
             if (x<-1.0 || x>=width || y<=1.0 || y>=height)
                 return 0.0;
             else
                 return getInterpolatedEdgeValue(x, y);
         }
-----------------------------

We are experiencing troubles in reading some of the image edge values.
Shouldn't the second constraint

  (x<-1.0 || x>=width || y<=1.0 || y>=height)

be

  (x<-1.0 || x>=width || y<-1.0 || y>=height)

                         ^^^^^^^

Best,

Andreas

P.S. Is this problem already fixed in a newer version of ImageJ? We are
using ImageJ 1.43u.

--
Dr.-Ing. Andreas Maier
Stanford University
Department of Radiology
The Lucas Center for Imaging
Mail Code 5488, Route 8
Stanford, CA  94305
http://med.stanford.edu/profiles/Andreas_Maier/
Reply | Threaded
Open this post in threaded view
|

Re: Bug in ImageJ?

Gabriel Landini
On Friday 10 September 2010 18:51:27 Andreas Maier wrote:

> P.S. Is this problem already fixed in a newer version of ImageJ? We are
> using ImageJ 1.43u.

Did you know that you can answer this question yourself by looking at the
source code of the latest build here?:

http://rsbweb.nih.gov/ij/source/

G.
Reply | Threaded
Open this post in threaded view
|

Re: Bug in ImageJ?

Andreas Maier
  Hi Gabriel,

in fact I already did answered the P.S. part of this question myself.
The problem (?) is also relevant for the newest version of ImageJ
(version 1.44f9).

The main question, however, was: Will it be fixed or is this behavior on
purpose?
It looks like a typo to me and I fixed (?) it in my personal version of
ImageJ. So you could also suggest that everyone is using his own version
of ImageJ. But this surely not the direction the project should go, right?

Andreas


Am 9/10/2010 2:14 PM, schrieb Gabriel Landini:

> On Friday 10 September 2010 18:51:27 Andreas Maier wrote:
>
>> P.S. Is this problem already fixed in a newer version of ImageJ? We are
>> using ImageJ 1.43u.
> Did you know that you can answer this question yourself by looking at the
> source code of the latest build here?:
>
> http://rsbweb.nih.gov/ij/source/
>
> G.
>


--
Dr.-Ing. Andreas Maier
Stanford University
Department of Radiology
The Lucas Center for Imaging
Mail Code 5488, Route 8
Stanford, CA  94305
http://med.stanford.edu/profiles/Andreas_Maier/
Reply | Threaded
Open this post in threaded view
|

Re: Bug in ImageJ?

Gabriel Landini
Hi Andreas,

On Friday 10 September 2010 22:34:32 Andreas Maier wrote:
> The main question, however, was: Will it be fixed or is this behavior on
> purpose?

Yes, it looks like a typo to me too, y<=1.0 could still be inside the image.

> So you could also suggest that everyone is using his own version
> of ImageJ. But this surely not the direction the project should go, right?

Sure. It is only that the way the message was constructed (reporting of an old
version and asking whether the latest version had the same problem) sounded as
being unaware of the source of the latest build (the ideal version to check
before reporting bugs).

Regards

Gabriel
Reply | Threaded
Open this post in threaded view
|

Re: Bug in ImageJ?

Andreas Maier
  Hi Gabriel,

I promise, I will check the latest version next time before I report
something like this.

Best,

Andreas

Am 9/10/2010 3:27 PM, schrieb Gabriel Landini:

> Hi Andreas,
>
> On Friday 10 September 2010 22:34:32 Andreas Maier wrote:
>> The main question, however, was: Will it be fixed or is this behavior on
>> purpose?
> Yes, it looks like a typo to me too, y<=1.0 could still be inside the image.
>
>> So you could also suggest that everyone is using his own version
>> of ImageJ. But this surely not the direction the project should go, right?
> Sure. It is only that the way the message was constructed (reporting of an old
> version and asking whether the latest version had the same problem) sounded as
> being unaware of the source of the latest build (the ideal version to check
> before reporting bugs).
>
> Regards
>
> Gabriel
>


--
Dr.-Ing. Andreas Maier
Stanford University
Department of Radiology
The Lucas Center for Imaging
Mail Code 5488, Route 8
Stanford, CA  94305
http://med.stanford.edu/profiles/Andreas_Maier/
Reply | Threaded
Open this post in threaded view
|

Re: Bug in ImageJ?

Rasband, Wayne (NIH/NIMH) [E]
In reply to this post by Andreas Maier
This bug is fixed in the 1.44g10 daily build.

-wayne

On Sep 11, 2010, at 12:13 AM, Wayne Rasband wrote:

>   Hi,
>
> I have a question to the ImageProcessor class. In interpolated value
> this statement is found:
>
> ------------------------------
>
> public final double getInterpolatedValue(double x, double y) {
>         if (useBicubic)
>             return getBicubicInterpolatedPixel(x, y, this);
>         if (x<0.0 || x>=width-1.0 || y<0.0 || y>=height-1.0) {
>             if (x<-1.0 || x>=width || y<=1.0 || y>=height)
>                 return 0.0;
>             else
>                 return getInterpolatedEdgeValue(x, y);
>         }
> -----------------------------
>
> We are experiencing troubles in reading some of the image edge values.
> Shouldn't the second constraint
>
>  (x<-1.0 || x>=width || y<=1.0 || y>=height)
>
> be
>
>  (x<-1.0 || x>=width || y<-1.0 || y>=height)
>
>                         ^^^^^^^
>
> Best,
>
> Andreas
>
> P.S. Is this problem already fixed in a newer version of ImageJ? We are
> using ImageJ 1.43u.
>
> --
> Dr.-Ing. Andreas Maier
> Stanford University
> Department of Radiology
> The Lucas Center for Imaging
> Mail Code 5488, Route 8
> Stanford, CA  94305
> http://med.stanford.edu/profiles/Andreas_Maier/