Posted by
Harry Parker on
Aug 30, 2007; 9:17pm
URL: http://imagej.273.s1.nabble.com/dev-overriding-multiple-classes-tp3698479p3698480.html
Converting to polar coordinates is fine for reporting positions in an image, but expecting current software to work with polar coordinates is not seem realistic. Pixel coordinates are integers that map directly to memory locations. These can be mapped to other real dimensions such as mm by application of simple scaling factors.
What is wrong with simply mapping (x,y) to (r,theta) and back, as you need, in your plugin code?
--
Harry Parker
Senior Systems Engineer
Digital Imaging Systems, Inc.
----- Original Message ----
From: Leonard Sitongia <
[hidden email]>
To:
[hidden email]
Sent: Thursday, August 30, 2007 1:02:29 PM
Subject: Re: dev: overriding multiple classes
Volker Bäcker wrote:
> Create a jar-file with your subclasses and put the jar file in the
> same directory as your plugin that uses them. You could as well put
> them somewhere else in the classpath or add the location to the
> classpath.
> Volker
>
> Leonard Sitongia a écrit :
>> What is the best practice for overriding multiple classes in ij that
>> aren't related in a class hierarchy? I could write invisible plugins
>> (no underscore) and call them from the plugin I want visible (with
>> the underscore)?
>>
>> In this case, I want to extend ImagePlus and Calibration, and maybe
>> more.
Thank you for your help. I'd like to follow up on this with more basic
questions about how to proceed.
My goal is to adapt ImageJ to work on my image data that is in polar
coordinates. They are images of the Sun. They're 2D FITS pixel image
files. But, the natural coordinates to use are polar. This way moving
the mouse around the image shows coordinate status at the bottom of the
ImageJ window in (r,theta) instead of the (x,y) coordinates.
I started out extending Calibration with PolarCalibration, adding getR
and getTheta. I also extend ImagePlus with PolarImagePlus to override
getLocationAsString to display (r,theta) by using PolarCalibration.
The fundamental question is, with inheritance, I can't get ImageJ to use
my new classes, right? I need to then create a plugin that loads a
PolarImagePlus, and displays it. Then the main ImageJ window will show
status with (r,theta). But, other stuff in ImageJ, for example
measuring, will not use getR, for example, because they use getX. That
is, the other operations in ImageJ will use the methods from the
ImagePlus part of my PolarImagePlus.
I can't override getX and getY in Calibration because getR and getTheta
need two arguments, (x,y).
I can't think of a way to accomplish this without modifying Calibration
and ImagePlus, or duplicating the code in parts of ImageJ to create my
own polar coordinate version of it, which I would of course want to
avoid doing.
Thanks!
--
==Leonard E. Sitongia
High Altitude Observatory
National Center for Atmospheric Research
P.O. Box 3000 Boulder CO 80307 USA
[hidden email] voice: (303)497-2454 fax: (303)497-1589
____________________________________________________________________________________
Luggage? GPS? Comic books?
Check out fitting gifts for grads at Yahoo! Search
http://search.yahoo.com/search?fr=oni_on_mail&p=graduation+gifts&cs=bz