Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add converters from RAI to Img and II to Img #74

Closed
ctrueden opened this issue Mar 27, 2018 · 2 comments
Closed

Add converters from RAI to Img and II to Img #74

ctrueden opened this issue Mar 27, 2018 · 2 comments

Comments

@ctrueden
Copy link
Member

Converters would be a good basis for convert ops that go from RAI to Img and II to Img. @awalter17 and I think we would need six initially: RAIToArrayImg (only matches if element count is less than maxint), RAIToCellImg (but with what cell size?), RAIToListImg, and then those three again for II, and in that order of priority. This would let us implement convert.imgView.

But what about create.img? It would be nice to reuse the logic above, but only for factories. We could make e.g. RAIToImgFactory converters like RAIToArrayImgFactory, which would obviously be lossy. But is this really a "conversion"? Would someone want to pass a RAI as an argument to something that takes an ImgFactory? I don't think so.

Migrated from #72 (comment)

@imagejan
Copy link
Member

imagejan commented May 7, 2020

For the record: there is now ImgView.wrap(rai) which chooses a suitable ImgFactory, so a converter could simply make use of this, right?


and II to Img

The problem with IterableInterval is that it "is not guaranteed to iterate over all coordinates of its containing Interval.". Do we actually want to have a converter for this?

@ctrueden
Copy link
Member Author

I'm going to close this in favor of #103. In that PR, I added converters for all image types to/from one another. That does not include IterableInterval, though—I agree with @imagejan that we cannot (or at least should not) write a converter from IterableInterval generally to any of the RAI-based image types. I'm also going to ignore my musings above about ImgFactory for the time being.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants