-
Notifications
You must be signed in to change notification settings - Fork 26
ENH: Add ITK_Example_RegistrationWithCorrespondingPointsInMemory.ipynb #303
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
ENH: Add ITK_Example_RegistrationWithCorrespondingPointsInMemory.ipynb #303
Conversation
8fda924
to
4efcdd2
Compare
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
d884538
to
35a278e
Compare
35a278e
to
32f8b80
Compare
32f8b80
to
268a532
Compare
3d3a493
to
fcf3501
Compare
@@ -0,0 +1,529 @@ | |||
{ |
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.
Line #22. # Converts an itk.Point to a tuple.
We probably want to use pointset_from_dict
and itk.dict_from_pointset
-- these provide simple, efficient, familiar interfaces for folks who are used to working with NumPy arrays.
Reply via ReviewNB
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.
Thanks Matt, maybe the use of pointset_from_dict/dict_from_pointset could be added as a follow-up.
By the way, I found Python's tuple
more convenient than itk.Point
, especially when creating a point "manually":
# Just works
my_point = (x, y)
# Causes errors
my_point = itk.Point[itk.D, 2](x, y)
itk.Point[itk.D, 2](x, y)
caused the following errors:
TypeError: new_itkPointD2 expected at most 1 arguments, got 2
Additional information:
Wrong number or type of arguments for overloaded function 'new_itkPointD2'.
Possible C/C++ prototypes are:
itkPointD2::itkPointD2()
itkPointD2::itkPointD2(double const *)
itkPointD2::itkPointD2(double const &)
itkPointD2::itkPointD2(std::array< double,2 > const &)
itkPointD2::itkPointD2(itkPointD2 const &)
An extra pair of parentheses works, but it isn't particularly elegant, right?
# Extra pair of parentheses, Works!
my_point = itk.Point[itk.D, 2]((10.0, 15.0))
Is there a more convenient way to create an itk.Point
? Something like itk.make_point(x, y)
???
@@ -0,0 +1,529 @@ | |||
{ |
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.
Line #60. ax.imshow(cmap="binary_r", origin="lower", X=itk.GetArrayViewFromImage(image))
itk.array_view_from_image is preferred over itk.GetArrayViewFromImage for style.
Reply via ReviewNB
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.
Thanks! Should we eventually deprecate itk.GetArrayViewFromImage in favor of itk.array_view_from_image ?
Anyway, addressed by this force-push, please check!
Very nice, Neils! A few style-related comments inline. |
Demonstrates how to help an image registration by using a fixed and a moving set of corresponding points in memory (without file I/O).
fcf3501
to
78550a1
Compare
0e79940
into
InsightSoftwareConsortium:main
Demonstrates how to help an image registration by using a fixed and a moving set of corresponding points in memory (without file I/O).