Ticket #582 (closed defect: fixed)

Opened 8 years ago

Last modified 7 years ago

Better support for selections (e.g., for Crop plugin)

Reported by: curtis Owned by: dscho
Priority: critical Milestone: imagej2-b6-legacy
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 8 years ago by gharris

I made an attempt at this: CropToRoi plugin. (GBH)

comment:2 Changed 8 years ago by gharris

Though, it is not working correctly at the moment.

comment:3 Changed 8 years ago 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:4 Changed 8 years ago by curtis

  • Cc leek added

comment:5 Changed 8 years ago by curtis

Waiting on #660.

comment:6 Changed 8 years ago by curtis

  • Status changed from new to accepted

comment:7 Changed 8 years ago by curtis

  • Owner changed from curtis to dscho
  • Status changed from accepted to assigned

comment:8 Changed 7 years ago by curtis

  • Blocking 285 added

comment:9 Changed 7 years ago by dscho

  • Status changed from assigned to accepted

comment:10 Changed 7 years ago by curtis

  • Milestone changed from imagej-2.0-beta1 to imagej-2.0-beta2

comment:11 Changed 7 years ago by curtis

  • Milestone changed from imagej-2.0.0-beta3 to imagej-2.0.0-beta4

comment:12 Changed 7 years ago 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 7 years ago 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 7 years ago by curtis

If you think our behavior matches ImageJ1's now, go ahead and close.

comment:15 Changed 7 years ago 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.

comment:16 Changed 7 years ago by bdezonia

  • Blocking 1583 added; 1572 removed
Note: See TracTickets for help on using tickets.