Ticket #1871 (closed defect: fixed)

Opened 7 years ago

Last modified 6 years ago

Change how binary data is checked and synchronized

Reported by: bdezonia Owned by: bdezonia
Priority: major Milestone: imagej2-b7-ndim-data
Component: Legacy Compatibility Version:
Severity: serious Keywords:
Cc: Blocked By:
Blocking: #1661

Description

The isBinary() code that is utilized in the legacy layer ir problematic:

  • it can be expensive since it potentially checks every pixel of an image
  • it can call getProcessor() a number of times which messes up virtual stack caching
  • it can change images that are all black or all white into 1-bit data

We should simplify this code:

1) avoid unnecessary isBinary() class by only checking this code when IJ2 started as 1-bit and only then do we type munge the output. If the IJ1 data is no longer binary we could ignore and clamp to 1 bit (relative to 0 or 128 as we see fit). (never translate back 8-bit nonbinary data)

2) isBinary could change in the future to return true only is it has all 0's and 255's but with at least one of each. This avoid patholgical cases like all 0 image becoming 1-bit image.

3) isBinary could also be less thorough only checking the one loaded plane. This would improve performance for cases like big virtual stacks.

Change History

comment:1 Changed 6 years ago by bdezonia

The decision was made to entirely eliminate isBinary() tracking. This simplifies harmonization code and speeds it also. The code is currently on the scifiocells branch as commit 1eb7b90f77d05e900320197eda927a9a9e5a8359

Last edited 6 years ago by bdezonia (previous) (diff)

comment:2 Changed 6 years ago by bdezonia

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

Merged. Closing.

Note: See TracTickets for help on using tickets.