Skip to content

Assess feasibility of Ops with all ImgLib2 image types #122

Closed

Description

@hinerm

When reviewing scijava/incubator#76 I was curious about its specializations for ArrayImg. I noticed we only have a copy Op for ArrayImgs and when I tried making a version of CopyArrayImgTest for PlanarImg it failed.

It seems like we want to ensure all Img types are supported, at least with a slow fallback.

Activity

  1. added this to the 1.0.0 milestone on Jun 14, 2023
  2. hinerm commented on Jun 14, 2023

    @hinerm
    MemberAuthor

    @gselzer am I off-base here? Is there a reason these operations just shouldn't be supported for other Img types?

  3. gselzer commented on Jun 14, 2023

    @gselzer
    Member

    @hinerm they are supported, just not using the Op name copy.img, because I removed the copy.img Ops in scijava/incubator#76, and now the only Op with that name is the one that works on ArrayImgs 😅

    The solution is probably to alias copy.rai, and also copy.iterableInterval to copy.img, or just to always use copy. I created a test clone on PlanarImg, and changed the name to copy and things worked just fine.

    I'll file a PR to fix the copy namespace!

  4. ctrueden commented on Jun 14, 2023

    @ctrueden
    Member

    Without thinking deeply about it, I like the idea of all copy ops just being copy. If you want to copy to a particular destination type, and it supports the computer paradigm, you can just pass the empty container of desired type. Is there ever a case where you might want to clone an object to a new type of your choosing, but can't create a new object of that type for use as a container? E.g. "copy" a FloatType to a Double? (Double is immutable so can't support the computer paradigm.)

  5. gselzer commented on Jun 14, 2023

    @gselzer
    Member

    All copy Ops are usually named copy for adaptation purposes. I personally can't think of an adaptation situation like you're describing, but I'd say we shouldn't think about it until we need it

  6. hinerm commented on Jun 16, 2023

    @hinerm
    MemberAuthor
  7. added a commit that references this issue on May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions