Login  Register

"Unclean code" in FFT class

Posted by Joachim Wesner on Mar 16, 2006; 4:58pm
URL: http://imagej.273.s1.nabble.com/diameter-automatic-calculation-tp3703389p3703390.html

Hi there,

I´m planning to write a ImageJ plugin for fringe processing (of
interferometric data etc.) based on the so-called "spatial carrier phase
measurement" method. As I´m pretty new to ImageJ and because the algorithm
in one step requires a fully complex inverse FFT, I have been looking
carefully at the existing FFT and FHT code (I will need to split that
complex FFT in two appropritate FHTs).

However, I am wondering about some strange issues in the FFT class:

As I understand, this class is meant to be both a Plugin to be used for the
current image(s) ("manually", or from a macro), but also exports some
public methods for more general usage.

I´m wondering why does doForewardTransform (and also the private
doInverseTransform) require an FHT object AND an image processor object ip?
Everything about the current image should already be available through he
FHT object, or no?

Even more, the argument ip seems not to be referenced at all in the code
for both methods, but instead, IMHO incorrectly, a reference to a private
Imageplus imp is used. This works as long as the class is only used as a
plugin, but if you call the public method from another place, the old (if
it even already exists?!) imp from the last "manual" call of the plugin
will be referenced. Am I missing something here?


BTW, ImageJ does not yet seem to have any plugin for (2-dimensional) phase
unwrapping - OR? I could not find one, so I will add that too.


Sincerely

Joachim Wesner


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________