[ImageJ-devel] strange behaviour using calibration object.

Polder, Gerrit gerrit.polder at wur.nl
Mon Jan 28 15:41:58 CST 2013


Wayne,

thanks, the thing is I have a separate class cal, it's a class I wrote myself.
This class implements the getCalibration functions which returns a Calibration object, in which I filled w,h and the unit.
So I can imagine that you can't compile it. I did show this on the last developer conference, maybe you remember it.
This class detects a blue area in the image and decodes the qrcode within this area and does a calibration based on a black disk with holes.
The number of holes determines the size of the disk. I'm currently making a separate plugin for this calibration and decode.
The idea is that the plugin gives a new image with only the blue area, the decoded qrcode as title and calibrated according to the disk.
This way this information can be used in other plugins. I don't see other ways to get this information from the plugin. 
Or I need to return a resultstable which is little bit of overkill in my opinion.

I don't see why IJ.log("1-> "+cal.getCalibration() + " - " + cal.getCalibration().scaled()); works,
and overlay_im.setCalibration(cal.getCalibration()); not.
Even more since it worked properly last week ????
The only thing which was changed is the Fiji update this morning, I believe ij1.47h to 1.47i, along with other libraries.

In the mean time I found another problem, I have implemented the run(ImageProcessor ip) in my plugin.
I do a ip.setroi(roi of blue region) at the end and after running the plugin this roi was set on the input image.
It is very handy to have this information for further processing of the input image.
This behavior also stopped working this morning, the roi now is set to the whole image.

Is there a way to downgrade Fiji, in order to test this with 1.47h?

is Barry DeZonia right, does this question better fit on the regular list?

I'm a little bit confused,
thanks,
Gerrit.



On 28 jan. 2013, at 21:12, "Rasband, Wayne (NIH/NIMH) [E]" <rasbandw at mail.nih.gov> wrote:

> On Jan 28, 2013, at 8:52 AM, Polder, Gerrit wrote:
> 
>> Since today my calibration software doesn't work anymore.
>> After a little bit of debugging it looks like setCalibration in ImagePlus doesn't set the calibration.
>> 
>> this code:
>>       ImagePlus overlay_im = new Duplicator().run(imp);
>>       IJ.log("1-> "+cal.getCalibration() + " - " + cal.getCalibration().scaled());
>>       overlay_im.setCalibration(cal.getCalibration());
>>       IJ.log("2-> " + overlay_im.getCalibration()+ " - " + overlay_im.getCalibration().scaled());
>> produces this output:
>> 1-> w=0.19120458891013384, h=0.19120458891013384, d=1.0, unit=mm, f=20, nc=null, table=null, vunit=Gray Value - true
>> 2-> w=1.0, h=1.0, d=1.0, unit=pixel, f=20, nc=null, table=null, vunit=Gray Value - false
> 
> Your code does not compile but this version works as expected:
> 
>   ImagePlus imp = IJ.getImage();
>   ImagePlus imp2 = new Duplicator().run(imp);
>   IJ.log("1-> "+imp.getCalibration() + " - " + imp.getCalibration().scaled());
>   IJ.log("2-> " + imp2.getCalibration()+ " - " + imp2.getCalibration().scaled());
> 
> This is the output:
> 
> 1-> w=0.02, h=0.02, d=0.02, unit=mm, f=20, nc=null, table=null, vunit=Gray Value - true
> 2-> w=0.02, h=0.02, d=0.02, unit=mm, f=20, nc=null, table=null, vunit=Gray Value - true
> 
> 
> -wayne
> 
> 
> 
> 






More information about the ImageJ-devel mailing list