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

Interval functionality for various Transform Ops #515

Merged
merged 10 commits into from Dec 5, 2017
Merged

Conversation

gselzer
Copy link
Contributor

@gselzer gselzer commented Jul 7, 2017

This branch solves issue #486 by adding Interval functionality for the Rotate and Hyperslice ops. The branch also adds Interval functionality for the Permute, InvertAxis, Subsample and Translate ops.

This branch also fixes a Transform Namespace bug. Previously, the Transform Namespace was not being tested correctly because it was looking for ops in the "View" namespace, which does not exist.

Finally this branch removes the DefaultScaleView and renames WrappedScaleView as the new DefaultScaleView. This was done due to the redundancy between the two ops and due to the fact that DefaultScaleView would never be called.

Closes #486.

@@ -235,6 +238,10 @@ private int pseudoRandom() {
}
assertFalse("More elements than expected", a.hasNext());
}

public static <T> RandomAccessible<T> deinterval(RandomAccessibleInterval<T> input){
return Views.extendBorder(input);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at where this method is used, replacing the original casts with calls to it seems legit. In general, however, this is not the case: with L243 you are replacing an already existing OutOfBoundsFactory of input with an OutOfBoundsBorderFactory.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stelfrich How would you suggest it be changed?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ctrueden No changes, since it seems to be the only alternative to replacing the casts.

@ctrueden ctrueden force-pushed the issue-486 branch 2 times, most recently from 29baac0 to 2ff87f2 Compare July 18, 2017 21:03
public void testDefaultRotate() {
final Img<DoubleType> img = new ArrayImgFactory<DoubleType>().create(new int[] { 20, 10 }, new DoubleType());

final MixedTransformView<DoubleType> il2 = Views.rotate((RandomAccessible<DoubleType>) img, 1, 0);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also use deinterval? (applies to other tests as well...)

@ctrueden ctrueden merged commit 5c060be into master Dec 5, 2017
@ctrueden ctrueden deleted the issue-486 branch December 5, 2017 23:14
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

Successfully merging this pull request may close these issues.

Wrap Views signatures that return Interval
3 participants