Posted by
Joachim Wesner on
Mar 20, 2009; 10:20am
URL: http://imagej.273.s1.nabble.com/Missing-Classes-for-CallJavaDemo-tp3693236p3693237.html
Hi list,
while updating some plugin of mine, I noted something:
Usually, if you have an (non-float) ImageProcessor, that has a calibration
attached, that calibration will be automatically applied, when you do
ImageProcessor.convertToFloat().
(BTW, can a FloatProcessor have an extra calibration??)
Now, If you want your PlugInFilter not need to fiddle with the details of
non-float input formats, you can set CONVERT_TO_FLOAT in the return to the
setup()
method. However, that´s what I noted, it seem that this flag will NOT apply
any calibration of the input processor!
So, question, what to do. Probably the current behaviour should not be
changed, but an extra bit-field could be defined, that, when set, also
causes the
calibrated conversion!?
Or, leave everthing as is, do NOT use CONVERT_TO_FLOAT if calibration is
important and add only a little bit of code like:
float calib[] = ip.getCalibrationTable();
ip = ip.duplicate();
ip.setCalibrationTable(calib);
if (!(ip instanceof FloatProcessor))
ip = ip.convertToFloat();
(The duplication in the code below can even be optimized away in most cases
and would only be needed
if the input is ALREADY float, as the filter promises not to change the
input data...)
Any suggestions?
Mit freundlichen Grüßen / Best regards
Joachim Wesner
Leica Microsystems CMS GmbH | GmbH mit Sitz in Wetzlar | Amtsgericht
Wetzlar HRB 2432
Geschäftsführer: Dr. Stefan Traeger | Dr. Wolf-Otto Reuter | Dr. David Roy
Martyr | Colin Davis
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit
http://www.messagelabs.com/email
______________________________________________________________________