Open stelfrich opened 6 years ago
@tinevez I fixed the handling of calibrated images!
Also fixed a weird issue with adding ROIs to the ROI Manager (see http://forum.imagej.net/t/incorrect-positioning-of-roi-when-adding-to-roi-manger-via-script/9647) thanks to @lacan!
Check if my hack works for you as well.
The current position of the active ImagePlus
also overrides a position set with roi.setPosition(pos)
. So I guess the hack doesn't really work, if that's the issue you wanted to solve. The root cause for this is how Roi
s are added to the RoiManager
. If you want to add them to an Overlay
, roi.setPosition(...)
works perfectly fine.
How should we proceed?
Arrrh it's not so cool. I would like to have a way to create ROIs properly set to the right t,z,c position without relying on an ImagePlus. Any chance you could contact Wayne about this?
I would like to have a way to create ROIs properly set to the right t,z,c position without relying on an ImagePlus.
I have investigated a little more. There is a method roiManager.add( ImagePlus, Roi, int );
that does not set the position according to the active ImagePlus
and uses the Roi
s position instead. The issue here, however, is the last argument n
that is used to determine the name of the Roi
when added to the RoiManager
. You can do roiManager.add( null, roi, -1 );
which will generate names based on the Roi's x and y position ("YYYY-XXXX"). That, however, are usually not the names that you get with a (hyper)stack because the names are prefixed with the stack position ("PPPP-YYYY-XXXX"). In order to compute a stack position you need the ImagePlus
for its dimensions...
TL;DR: I could use roiManager.add( null, roi, -1 );
but that will generate names of the form "YYYY-XXXX". What do you think?
This PR adds functionality to export
Spot
s to ellipse ROIs to the ROI Manager. ROIs are not assigned to any channel if the input was a hyperstack.