-
-
Notifications
You must be signed in to change notification settings - Fork 686
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
Image Writing from Python and C++ give different results #2703
Comments
@dzenanz I spent all day trying to debug this very weird python problem. I'm hoping you can help shed some light on this failure. The tarball should be self-contained, and should build and demonstrate the failure by running the do_test.sh script. |
I can reproduce this on Windows, too, with my existing build of ITK. |
Good news! At least it is reproducible. I was struggling to determine where execution diverges. I could not figure out how to debug the c++ code called from python. |
The way which worked for me before was to use Visual Studio, enable "Enable native code debugging" in Python project and then step into (F11) interesting code. However, this time VS doesn't step into |
Some related forum discussion can be found here. |
This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions. |
Description
Identical code (written in python & C++) results in different images being written to disk.
The python code writes an image to disk with Identity direction cosine, even though the image supplied to the write function has non-identity cosines. The change occurs somewhere in itk::ImageBase::UpdateOutputInformation().
Steps to Reproduce
A self-contained environment creates a new virtual environment, builds ITK with python and C++ and runs both the C++ and python test cases from the same source builds is available in the tarball file.
TARBALL: https://github.com/BRAINSia/ITK/raw/debug-python-diffs/failure_case.tar.gz
Download the tarball and run the "do_test.sh" to build (on unix) a clean version of ITK that is instrumented to show the problem.
Expected behavior
Both the C++ and the python variations should produce identical images on disk.
Actual behavior
The python generated image has an identity direction cosine.
Reproducibility
Two different computers (both release and debug mode tested) for two different uses produced the same failures.
Versions
Latest ITK master branch
Environment
Ubuntu 20.04 linux.
Additional Information
Using the "ResampleInPlaceImageFilter".
The text was updated successfully, but these errors were encountered: