Ticket #845 (closed defect: moved)

Opened 6 years ago

Last modified 3 years ago

Break IJ2's reliance on RealType

Reported by: bdezonia Owned by: curtis
Priority: major Milestone: imagej-2.5.0
Component: Data Model Version:
Severity: serious Keywords:
Cc: Blocked By:


IJ2 has much code that relies on RealType. Starting with ImglibDataset there are numerous assumptions of data type made. ImgOpener however just returns an Img<?>. So ideally we could pass that to ImglibDataset without an unsafe cast. Remove reliance on RealType if possible. This issue likely goes very deep.

Change History

comment:1 Changed 4 years ago by bdezonia

This ticket description is very old and slightly obsolete. But there is a need to make Dataset derive from NumericType rather than RealType. RealType does not work safely for LongType. Nor any future types (like BigDecimal backed).

The DataType interface was put in place to manage newer types. At a similar time I added to the data-types branch a TypedDataset class that allows one to take a Dataset and pull out various typed ImgPluses (like of ComplexType, or IntegerType, etc.). This class could be used to make Dataset more generally typed and yet allow plugins to get very specific types in order to use the most specific operations for the type. This TypedDataset has not yet been merged to master. Hoping for feedback.

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

comment:2 Changed 4 years ago by bdezonia

Rather than the TypedDataset approach I have instead created a ImgPlusService that strengthens typing of arbitrary ImgPlus data. It has been merged to master with commit be9c777fcec78e992b6a15585acdd6b04be754e0.

To do is to make Dataset's ImgPlus be derived from Type rather than RealType.

comment:3 Changed 3 years ago by curtis

  • Status changed from new to closed
  • Resolution set to moved
Note: See TracTickets for help on using tickets.