-
Notifications
You must be signed in to change notification settings - Fork 23
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 ipynb examples Transformix, image, mesh, TranslationTransform #175
ENH: Add ipynb examples Transformix, image, mesh, TranslationTransform #175
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
@@ -0,0 +1,127 @@ | |||
{ |
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 #9. print()
Nice.
A possible shortcut here:
import numpy as npprint(np.asarray(image))
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 @thewtex I just replaced my little hand-written "print_image" helper by your suggested print(np.asarray(image))
. Much better 👍
@@ -0,0 +1,127 @@ | |||
{ |
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 #27. moving_image.SetPixel([column, row], pixel_value)
Possible shortcut (untested), something like:
moving_image[:] = np.arange(len(itk.array_view_from_image(moving_image))
Reply via ReviewNB
Cool @N-Dekker ! |
Thanks for your comments so for @thewtex After the weekend, I think I'll have time to try out your numpy based suggestions. Interesting! I'm not very experienced with Jupyter Notebook, so I'm very interested to hear any more suggestions. Are the two examples I'm proposing here clear enough? |
@N-Dekker looking awesome! The examples are nice and clear. It may help to "tell a story" by breaking up the code into more cells and viewing intermediate output, maybe add some Markdown cells that explain what is going on. |
2aabcf5
to
db606f8
Compare
Thanks @thewtex, I included this suggestion with the latest force-push, please check! |
df7c3e2
to
35165f2
Compare
Added examples on how to use recently added TransformixFilter member functions, `SetTransform`, `SetInputMesh`, and `GetOutputMesh`. With help from Matt McCormick and Konstantinos Ntatsis.
35165f2
to
8353a74
Compare
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.
Looks good to me!
"\n", | ||
"print('Output image:')\n", | ||
"print(np.asarray(output_image))\n", | ||
"print()" |
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.
Where is this print command for?
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.
print()
just prints a line-break. But I guess I could have done print(np.asarray(output_image), "\n")
, instead of line 148-149.
python-build-workflow / build-macos-python-packages says:
|
I restarted the failed jobs. |
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.
@N-Dekker looks great!! 🥇
Added examples on how to use recently added TransformixFilter member functions,
SetTransform
,SetInputMesh
, andGetOutputMesh
.