Break IJ2's reliance on RealType

Description

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

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.

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.