Ticket #582 (closed defect: fixed)
Opened 2011-06-08T14:15:14-05:00
Last modified 2012-12-12T09:18:36-06:00
Better support for selections (e.g., for Crop plugin)
Reported by: | curtis | Owned by: | dscho |
---|---|---|---|
Priority: | critical | Milestone: |
|
Component: | Display API | Version: | |
Severity: | serious | Keywords: | |
Cc: | leek | Blocked By: | |
Blocking: | #1583 |
Description
Right now, CropImage operates on a Dataset together with a bounding box (as four ints). Instead, it should probably operate on a Display, cropping the active Dataset using the bounding box defined by the Display's selected views. The associated API needs work before the plugin can be changed, however.
Change History
comment:1 Changed 2011-07-31T13:11:48-05:00 by gharris
comment:2 Changed 2011-07-31T13:17:19-05:00 by gharris
Though, it is not working correctly at the moment.
comment:3 Changed 2011-08-02T10:36:51-05:00 by curtis
Added method to obtain selection bounds in e3cf78f8d67ec01f6d97bcd3b05925c618c6ca0d, with bugs fixed in ee70c3ac1a90b2a3b2bbd151e4b37725c1af697f. Updated Crop plugin to use selection bounds in 44b65302920087b3a0ede5d1538a9d01c1704df6.
One problem with this approach is that it only returns the bounding box. For Crop, that's fine. But some plugins (e.g., math plugins) need to do more, actually obtaining the overlays in the selection itself so that they can iterate through the region of interest. That work is still pending.
comment:7 Changed 2011-11-21T13:02:12-06:00 by curtis
- Owner changed from curtis to dscho
- Status changed from accepted to assigned
comment:10 Changed 2012-03-05T10:48:44-06:00 by curtis
- Milestone changed from imagej-2.0-beta1 to imagej-2.0-beta2
comment:11 Changed 2012-07-12T14:18:39-05:00 by curtis
- Milestone changed from imagej-2.0.0-beta3 to imagej-2.0.0-beta4
comment:12 Changed 2012-08-14T10:32:02-05:00 by curtis
- Milestone changed from imagej-2.0.0-beta4 to imagej-2.0.0-beta6
ROIs will be the focus of beta6.
comment:13 Changed 2012-12-11T16:07:16-06:00 by bdezonia
Are we really waiting on #660? I made the math plugins respect the Roi shape some time ago. Is this ticket complete?
comment:14 Changed 2012-12-11T16:09:01-06:00 by curtis
If you think our behavior matches ImageJ1's now, go ahead and close.
comment:15 Changed 2012-12-12T09:18:11-06:00 by bdezonia
- Status changed from accepted to closed
- Resolution set to fixed
- Blocking 1572 added; 285 removed
- Milestone changed from imagej2-b9-rois to imagej2-b6-legacy-undo
The math plugins rely on a class called InplaceUnaryTransfrom that can be used to transform data in a dataset. One passes the transformation function. It iterates a region and changes pixels. The region defaults to the whole image (or the current plane of the image in a slightly different incarnation). If a user provides an Overlay as an argument it only changes pixels whose coordinate is contained in the Overlay's region of interest.
I think everything this ticket was about is satisified. Closing.
I made an attempt at this: CropToRoi plugin. (GBH)