Re: ROI question

Posted by Davide Coppola on
URL: http://imagej.273.s1.nabble.com/Get-windows-titles-tp3700495p3700503.html

When you create a Roi using
PolygonRoi(int[] xPoints, int[] yPoints, int nPoints, int type)
data stored in the two arrays are modified.
I think the same happens every time a new Roi is created, so you have
to backup the coordinates before you work on them.

This should fix your problem.

Regards.

2007/1/25, Michal Lijowski <[hidden email]>:

> I acquired results by drawing ROIs, adding them to ROI Manager,
> measuring ROI,  and after I acquired all ROIs for all images in the
> stack I saved them without paying attention to the coordinates
> in the ROI name and their relation to the ROI coordinates.
>
> I can open the ROI set with ROI Manager but somehow the relation between
> coordinates of saved ROI and the coordinates of the actual image got
> messed up. The images are 416.13 mm by 416.13 mm. But the coordinates in
> the  name of the first ROI are 0536-0428 and the ROI coordinates from
> the results table are x 198.718 and y 248.278 with corresponding width
> and height 10.217 and 15.79.
>
> So, using the current version of ImageJ  ROIs acquired 14 months ago are
> outside the images.
>
> Michal
>
>
>
> On Thu, 2007-01-25 at 09:45 -0500, Josh D wrote:
> > How do you wish to redraw the ROIs? Why not just load the ROI? Or
> > define the ROI by points you have saved?
> >
> > I think you need to clarify your question a bit more. Are you using a
> > plugin or a macro? What data do you have to redraw/restore the ROIs?
> > -Josh D
> >
> > On 1/24/07, Michal Lijowski <[hidden email]> wrote:
> > > How  X and Y coordinates in the ROI name are related to coordinates
> > > in results table?
> > >
> > > Here is an example.
> > > This is a list of ROIs.
> > >   Length     Date   Time    Name
> > > --------    ----   ----    ----
> > >       500  10-28-05 14:56   0001-0536-0428.roi
> > >       384  10-28-05 14:56   0002-0530-0431.roi
> > >       368  10-28-05 14:56   0003-0537-0433.roi
> > >       388  10-28-05 14:56   0004-0535-0437.roi
> > >       416  10-28-05 14:56   0005-0533-0430.roi
> > >       424  10-28-05 14:56   0006-0533-0431.roi
> > >       372  10-28-05 14:56   0007-0533-0428.roi
> > >       584  10-28-05 14:56   0008-0535-0438.roi
> > >
> > > This is data from results table derived using above ROIs.
> > >         Area    Mean     X       Y       BX      BY      Width
> > > Height
> > > 1       124.672 160.187  198.718 248.278 193.668 241.039 10.217
> > > 15.791
> > > 2       69.454  161.425  200.470 246.157 195.061 241.504 10.217
> > > 9.289
> > > 3       63.846  167.740  201.033 249.810 197.383 244.290 7.431
> > > 10.682
> > > 4       64.493  163.669  203.218 248.640 200.170 241.968 6.038
> > > 13.004
> > > 5       76.572  144.614  199.858 248.307 195.990 241.039 7.895
> > > 13.468
> > > 6       74.846  148.274  200.196 247.146 195.525 241.039 9.753
> > > 13.004
> > > 7       56.081  149.385  198.401 248.713 195.525 241.968 6.502
> > > 11.611
> > > 8       125.751 146.027  203.738 247.897 195.990 241.039 15.326  14.862
> > >
> > >
> > > The ROIs were drawn and results were obtained using ImageJ version
> > > available in October 2005. From the current ImageJ online source code I
> > > figured out that X and Y coordinates are derived from the coordinates of
> > > the bounds of the rectangle surrounding ROI and its width and height.
> > >
> > > The ROIs were drawn on 16 bit 128x128  grayscale DICOM images, scaled by
> > > a factor of 3 and with magnifying glass tool focused on the specific
> > > part of the image.
> > >
> > > My intention is to draw the ROIs again on the same images.
> > >
> > > I appreciate any hints.
> > >
> > > Michal
> > >
>


--
Davide "M3xican" Coppola

http://yawi3d.sf.net/