Ticket #1273 (closed feature: fixed)

Opened 7 years ago

Last modified 6 years ago

Add thresholding capabilities

Reported by: curtis Owned by: bdezonia
Priority: major Milestone: imagej2-b7-ndim-data
Component: Core Version:
Severity: serious Keywords:
Cc: Blocked By: #756, #964, #977, #1122
Blocking:

Description

ImageJ2 needs native support for thresholding, and plugins need to take advantage of it where warranted.

Change History

comment:1 Changed 7 years ago by curtis

  • Blocked By 756 added

comment:2 Changed 7 years ago by curtis

  • Blocked By 964 added

comment:3 Changed 7 years ago by curtis

  • Blocked By 1122 added

comment:4 Changed 7 years ago by curtis

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

comment:5 Changed 7 years ago by curtis

I chatted with bdezonia about the details of how to implement thresholding.

There are several layers we need:

  1. A ThresholdRegionOfInterest in ImgLib2. Tentatively, it would store a min and max values (of type T) defining the thresholded range, as well as a reference to the actually thresholded interval (a RealRandomAccessibleInterval<T extends Comparable<? super T>>).
  2. A ThresholdOverlay in ImageJ2. It would of course wrap a ThresholdRegionOfInterest. Unlike other Overlays though, it would need to exist in the entire N-space of its linked data object (the ImgPlus of a particular Dataset? Or the Display itself? Needs further thought; this is very relevant to handling of multiple datasets in a single display: ticket #579).
  3. A ThresholdAdapter (JHotDrawAdapter implementation) that knows how to generate a JHotDraw Figure from the threshold. Every time the dimensional position changes, the figure needs to be updated. Probably this thresholding should take place on the fly, to avoid a large upfront threshold computation cost. Hopefully the logic for actually constructing a Figure consisting of arbitrary pixels can be reused from other bit-mask-style ROI code (not sure how that currently works though).

We should probably have a ThresholdService to help manage some of this. In particular, it makes sense to maintain only a single ThresholdOverlay at any given time. The Image > Adjust > Threshold command would create/update/delete it as necessary. In this way, the Overlay Manager would display a single entry for the threshold, which would be pretty ideal for manipulating an N-dimensional dataset's threshold easily.

See also tickets #1495 and #1496.

comment:6 Changed 6 years ago by curtis

  • Milestone changed from imagej-2.0.0-beta6 to imagej-2.0.0-beta7

comment:7 Changed 6 years ago by curtis

  • Blocking 904 added

comment:8 Changed 6 years ago by bdezonia

Note that I have a functional demo of a threshold overlay and a noninteractive plugin in the sandbox (Threshold Toy) that can adjust such a threshold. This is a proof of concept that uses PointSets. For demo purposes you use a Tool to insert a ThresholdOverlay into an image. The toy-threshold-stuff branch has all the code. It works reasonably well and was quick to implement.

comment:9 Changed 6 years ago by bdezonia

  • Blocked By 1650 added

comment:10 Changed 6 years ago by bdezonia

  • Blocked By 1651 added

comment:11 Changed 6 years ago by curtis

  • Owner changed from curtis to bdezonia
  • Status changed from new to assigned

Since bdezonia is doing most of the hard work on this, he should get the credit too.

comment:12 Changed 6 years ago by bdezonia

  • Blocked By 1650 removed

comment:13 Changed 6 years ago by bdezonia

  • Blocked By 1652 added

comment:14 Changed 6 years ago by bdezonia

  • Milestone changed from imagej2-b8-analysis to imagej2-b7-ndim-data

comment:15 Changed 6 years ago by bdezonia

  • Blocked By 1651 removed

comment:16 Changed 6 years ago by bdezonia

  • Blocking 904 removed

comment:17 Changed 6 years ago by curtis

  • Priority changed from critical to major

comment:18 Changed 6 years ago by bdezonia

  • Blocked By 1652 removed

comment:19 Changed 6 years ago by bdezonia

  • Status changed from assigned to closed
  • Resolution set to fixed

All constituent tickets have been resolved for this beta. Closing feature.

Note: See TracTickets for help on using tickets.