NOTICE! This is a static HTML version of a legacy ImageJ Trac ticket.

The ImageJ project now uses GitHub Issues for issue tracking.

Please file all new issues there.

Ticket #1273 (closed feature: fixed)

Opened 2012-07-03T14:48:22-05:00

Last modified 2013-06-06T15:42:40-05:00

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


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

Change History

comment:1 Changed 2012-07-12T17:02:32-05:00 by curtis

  • Blocked By 756 added

comment:2 Changed 2012-07-12T17:02:55-05:00 by curtis

  • Blocked By 964 added

comment:3 Changed 2012-07-13T22:41:43-05:00 by curtis

  • Blocked By 1122 added

comment:4 Changed 2012-08-03T13:39:41-05:00 by curtis

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

comment:5 Changed 2012-09-21T13:41:59-05:00 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 2012-10-10T13:52:03-05:00 by curtis

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

comment:7 Changed 2012-10-10T13:56:26-05:00 by curtis

  • Blocking 904 added

comment:8 Changed 2013-01-31T15:37:12-06:00 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 2013-02-07T12:39:31-06:00 by bdezonia

  • Blocked By 1650 added

comment:10 Changed 2013-02-11T10:10:51-06:00 by bdezonia

  • Blocked By 1651 added

comment:11 Changed 2013-02-11T13:55:04-06:00 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 2013-02-15T14:38:47-06:00 by bdezonia

  • Blocked By 1650 removed

comment:13 Changed 2013-02-19T14:33:48-06:00 by bdezonia

  • Blocked By 1652 added

comment:14 Changed 2013-03-05T16:17:06-06:00 by bdezonia

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

comment:15 Changed 2013-03-06T13:25:26-06:00 by bdezonia

  • Blocked By 1651 removed

comment:16 Changed 2013-03-06T16:59:42-06:00 by bdezonia

  • Blocking 904 removed

comment:17 Changed 2013-04-03T12:46:06-05:00 by curtis

  • Priority changed from critical to major

comment:18 Changed 2013-06-04T12:29:02-05:00 by bdezonia

  • Blocked By 1652 removed

comment:19 Changed 2013-06-06T15:42:40-05:00 by bdezonia

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

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