Skip to content

GroupBy - Merge Image: Pixel type BitType not supported for merging. #514

Open
@imagejan

Description

@imagejan

WTF? Why can't BitType images not be merged with the GroupBy node, but get merged just fine using the Merger node? This limitation seems unnecessary, and the special casing going on here is not very imglibby:

if (m_type instanceof ByteType) {
m_typeHandler = (RealTypeHandler<T, A, ADA>)new ByteTypeHandler();
} else if (m_type instanceof UnsignedByteType) {
m_typeHandler = (RealTypeHandler<T, A, ADA>)new UnsignedByteTypeHandler();
} else if (m_type instanceof UnsignedShortType) {
m_typeHandler = (RealTypeHandler<T, A, ADA>)new UnsignedShortTypeHandler();
} else if (m_type instanceof ShortType) {
m_typeHandler = (RealTypeHandler<T, A, ADA>)new ShortTypeHandler();
} else if (m_type instanceof IntType) {
m_typeHandler = (RealTypeHandler<T, A, ADA>)new IntTypeHandler();
} else if (m_type instanceof LongType) {
m_typeHandler = (RealTypeHandler<T, A, ADA>)new LongTypeHandler();
} else if (m_type instanceof FloatType) {
m_typeHandler = (RealTypeHandler<T, A, ADA>)new FloatTypeHandler();
} else if (m_type instanceof DoubleType) {
m_typeHandler = (RealTypeHandler<T, A, ADA>)new DoubleTypeHandler();
} else {
throw new IllegalArgumentException(
"Pixel type " + m_type.getClass().getSimpleName() + " not supported for merging.");
}


Example workflow to reproduce the issue:

image

BitType Merging.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions