I have an RandomAccessibleInterval
rai which happens to be of
UnsignedShortType, but I would like to keep the code generic and just specify functions to just require a
RandomAccessibleInterval< IntType >. This compiles well, but once I start iterating over the
rai within a function, for example like this:
for ( final IntType input : Views.flatIterable( rai ) )
I get a runtime error:
java.lang.ClassCastException: net.imglib2.type.numeric.integer.UnsignedShortType cannot be cast to net.imglib2.type.numeric.integer.IntType
Related to that, could someone maybe explain how I could figure out what the relation of
IntType is in terms of Class hierarchies?
Sorry, but I cannot not figure it out alone and am super helpful for any advice.