-
Notifications
You must be signed in to change notification settings - Fork 42
Real transform #533
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
base: master
Are you sure you want to change the base?
Real transform #533
Conversation
ece2370
to
8bed815
Compare
final RandomAccessibleInterval<T> result = | ||
(RandomAccessibleInterval<T>) ops().run( | ||
net.imagej.ops.transform.realTransform.DefaultTransformView.class, in, | ||
transform); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be ops().run(Ops.Transform.RealTransform.class, in, transform)
. That way, in the future, someone could write an op which is a specialized version of this and it could also be matched.
Please change this for all your other realTransform(...)
namespace methods as well.
InvertibleRealTransform transform; | ||
|
||
@Parameter(required = false) | ||
private Interval outputInterval = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't need to be explicitly set to null
. You can just have private Interval outputInterval
.
private Interval outputInterval = null; | ||
|
||
@Parameter(required = false) | ||
private InterpolatorFactory<T, RandomAccessible<T>> interpolator = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can just be private InterpolatorFactory<T, RandomAccessible<T>> interpolator;
. There's no need for the = null
.
|
||
@Parameter(required = false) | ||
private OutOfBoundsFactory<T, RandomAccessibleInterval<T>> outOfBoundsFactory = | ||
new OutOfBoundsMirrorFactory<>(OutOfBoundsMirrorFactory.Boundary.SINGLE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't used (unless I'm missing something?). On line 97 you call Views.extendZero(input)
, so zero padding is always the out of bounds strategy. Do you want the user to be able to specify their own out of bounds strategy?
transform.translate(image.dimension(0) / 2, image.dimension(0) / 2); | ||
|
||
final RandomAccessibleInterval<UnsignedByteType> actualOutput = ops | ||
.transform().realTransform(image, transform); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here you should use ops().run(net.imagej.ops.transform.realTransform.DefaultTransformView.class, image, transform);
, to ensure that DefaultTransformView
is always tested.
@bnorthan I've rebased this branch over master, updated the license header, and fixed a few whitespace issues. I've also noted a few minor changes that need to be fixed, but after that this should be good to merge. Thank you for all your work on this! 😺 |
@awalter17 I just did all the changes you requested. Please let me know if there is anything else. Thanks. |
Hi @imagejan It's been a while... I made some changes to this over a year ago but it looks like it slipped through the cracks after that. I'm not sure what the best approach is for changes to imagej-ops/scijava-ops right now. I've only made a couple of small changes in the last few months, and just flagged @gselzer so he can make the same change in scijava-ops. |
@gselzer How much effort do you think it would be to port this to scijava-ops soon? I'd rather not add more new features to imagej-ops at this juncture—but I really want this function in the new ops. 😄 |
@ctrueden I only have time to quickly glance over this, but we can probably add all this functionality with a couple of |
@gselzer @ctrueden is anything like this usable in the new It would be a good argument for me to get started exploring your recent work of overhauling the ops framework 🙂 |
This commit applies a realtransform to an input image.
Round 2
The Op is now called
DefaultTransformView
and wrapsViews.transformReal
. And the transforms are more "intuitive" (trans.scale(0.5) makes the image smaller. Use case is below