NIH LISTSERV
NIH LISTSERV
IMAGEJ archives -- May 2002 (#124)

Go to: Previous Message | Next Message
Previous in Topic | Next in Topic
Previous by Same Author | Next by Same Author
Previous Page (May 2002) | Back to Main IMAGEJ Page


Options: Reply | Post a New Message | Join or Leave IMAGEJ, or Change Options | Search
View: Chronologically | Most Recent First | Wrap Text (Proportional Font) | Don't Wrap Text (Non-proportional Font)
*

References:  <[log in to unmask]>
Content-Type: text/plain; charset="iso-8859-1"
Message-ID:  <006b01c200fd$87f261d0$b6010b98@MOBILENICK>
Date:         Tue, 21 May 2002 15:25:07 -0400
Reply-To:     ImageJ Interest Group <[log in to unmask]>
Sender:       ImageJ Interest Group <[log in to unmask]>
From:         Nick Linnenbrügger <[log in to unmask]>
Subject:      Re: Accessing ROIs from ROI Manager

Dear Wayne, Thanks for your comprehensive help. I'm looking forward to having version 1.28f available. I'm sorry for asking stupid questions -- I really could have found the contains() method myself. However, I have a few questions and suggestions in order to better understand ImageJ's ROIs: I understand that the basic region covered by a ROI is described by a Rectangle returned by getBoundingRect(). Then, the mask as returned by getMask() only describes a mask for pixels inside the bounding rectangle. Right? Then, I would suggest that getMask() in class 'Roi' (for rectangular ROIs) should return a mask with all pixels set to black color (which means true) in order to make writing plugins that deal with all kinds of ROIs easier. I think, this would also be necessary in order to calculate logic combinations of ROIs, right? Or is there a particular reason why you chose to return 'null'? However, I'm not sure whether I actually understood how to create logic combinations of ROIs. Do you suggest to 1. create an empty ColorProcessor of the same size as the source image, 2. copy the mask of the first ROI into the new ColorProcessor at the position defined by the bounding rectangle of the ROI using Blitter.COPY, 3. and copy the second ROI in the ColorProcessor (according to its bounding rectangle) using one of Blitter.AND, Blitter.OR, Blitter.XOR? Is it true that this would result in an image with black pixels only at positions that define the new ROI? Also, I don't see how I could use polygon ROIs to define a rotated ellipse (other than drawing it free-hand). Could you please give me some hints where to start ... Thanks! Kind regards, Nick. ----- Original Message ----- From: "Wayne Rasband" <[log in to unmask]> To: <[log in to unmask]> Sent: Tuesday, May 21, 2002 2:04 PM Subject: Re: Accessing ROIs from ROI Manager > > I would like to access ROIs stored in the ROI Manager from within a > > plugin. > > I've had a look at the code and it doesn't seem to be possible since the > > member variable 'rois' has friendly access. It would be useful, if > > such a > > possibility could be added to the 'RoiManager' class, e.g. by adding a > > getROIs() method. Then, one could use the ROI Manager similarly to the > > Window Manager. Also, it would be helpful if one could access the 'list' > > variable in order to be able to determine which ROIs are currently > > selected > > in the ROI Manager. > > I have added getInstance(), getROIs() and getList() methods to the > RoiManager in ImageJ 1.28f, due later this week. > > > This would introduce the ability to process an image based on several > > ROIs, > > e.g., analyzing a region enclosed by two concentric circles/ellipses > > (ring > > shape). Then, it would be very useful to have a function (e.g. in class > > 'ROI') that returns whether a point (x,y) lies within a particular ROI > > or > > not (maybe this is already available?). > > The contains() method in the Roi class does this. > > > Also, it would be great if one could calculate > > masks (ROIs) that represent logic AND, OR, and XOR combinations of two > > ROIs > > (although this is probably a little more complicated). What do you > > think? > > You can do this now using by getting the masks that represent the ROIs > using getMask() and doing the logic combinations using > ImageProcessor.copyBits(). > > > Have you ever thought about allowing for rotated oval ROIs, i.e., oval > > ROIs > > with their principal axis not being parallel to the image borders? > > You can do this by creating polygon ROIs. > > -wayne >




Back to: Top of message | Previous page | Main IMAGEJ page

NIH LISTSERV Home Page

CIT
Center for Information Technology
National Institutes of Health
Bethesda, Maryland 20892
301 594 6248 (v) 301 496 8294 (TDD)
Comments and Assistance
Accessibility wheelchair icon