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

NonCubic RectangleShape Neighborhood #80

Closed
tischi opened this issue Feb 3, 2019 · 5 comments
Closed

NonCubic RectangleShape Neighborhood #80

tischi opened this issue Feb 3, 2019 · 5 comments

Comments

@tischi
Copy link

tischi commented Feb 3, 2019

@stelfrich @tinevez
I was wondering why there only is a constructor with one single integer for the span:
https://github.com/imglib/imglib2-algorithm/blob/master/src/main/java/net/imglib2/algorithm/neighborhood/RectangleShape.java#L67
To me, that would indicate that it is a cube rather than a rectangle.
Could one add a constructor where one can specify different lengths of the span in all dimensions?

@tischi
Copy link
Author

tischi commented Feb 3, 2019

I just saw that this was raised already here: #10

@tischi tischi closed this as completed Feb 3, 2019
@tinevez
Copy link
Contributor

tinevez commented Feb 3, 2019

Hi @tischi
Yes you are right, but this is how we started at the beginning.
If you look around for other implementations of Shape you will see that there are various classes that vary with their capabilities. The decision to rename this belong to its author, @tpietzsch

@tischi
Copy link
Author

tischi commented Feb 4, 2019

Hi @tinevez
I don't think we'd need to change the name in this case. I feel adding more constructors would do the job. Just specifying one integer would be just one very specific rectangle, namely a cube. In this way one would be backwards compatible and still have the chance to specify an actual rectangle. What do you think?

@tinevez
Copy link
Contributor

tinevez commented Feb 4, 2019

I don't completely agree. Name -> function.
So I would make a class for a Cube with skipCenter flag.
And another class for general Rectangle.

@tischi
Copy link
Author

tischi commented Feb 4, 2019

Yes, that would be nicer!
In that case one could maybe add a HyperCube neighborhood and add more constructors to the RectangleNeighborhood. This looks to me like it would be backwards compatible.

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