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

OutOfBoundsStrategy for ROIs #6

Open
dietzc opened this issue Feb 17, 2015 · 5 comments
Open

OutOfBoundsStrategy for ROIs #6

dietzc opened this issue Feb 17, 2015 · 5 comments

Comments

@dietzc
Copy link
Member

dietzc commented Feb 17, 2015

Hi @tpietzsch,

would it make sense to offer a method in Regions which one can pass an IterableRegion, RandomAccessible<T> and an OutOfBoundsStrategy<T> and which returns a RandomAccessible<T> which returns the values of the passed RandomAccessible<T> on positions defined by the IterableRegion and values from the OutOfBoundsStrategy<T> on positions which lie outside the IterableRegion<T>?

@tpietzsch
Copy link
Member

@dietzc I don't really understand the question. What would T be? The returned RandomAccessible<T> would have pixel values that are related to the IterableRegion how? I mean: assume I access position x in the returned RA. The source RA has value t, the (iterable) region is false at that position, what do I get?

@dietzc
Copy link
Member Author

dietzc commented Feb 23, 2015

T can be arbitrary. You would get something defined by the OutOfBoundsStrategy<T>, which can be the t defined in the RandomAccessible<T> at the position you access (which is false for the (iterable) region) or something else (e.g. a constant value or some kind of mirroring). Of course one could achieve this by always checking if the (iterable) region I access is false or not at a given position and then return a constant value or the value of the RandomAccessible<T>. In the end the suggested method would just be a convenience method.

@tpietzsch
Copy link
Member

@dietzc Ok, now I get it. Sounds like a good idea. Do you have any use-cases in mind?

@tpietzsch
Copy link
Member

@dietzc Maybe I would name it differently though. We cannot use all of the existing OutOfBoundsStrategies, I think only Constant would make sense.

@dietzc
Copy link
Member Author

dietzc commented Feb 23, 2015

ConstantValue is the only use-case I can currently think of. Mirror etc is tricky, because we of course of irregular shapes.

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