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
rendering volumes of some resolutions crashes when using itkwidgets.view after using shapeworks in a notebook #1168
Comments
Yup, I'm trying to run it now and hitting the same crash, right here:
|
After testing with this, something may be wrong with Image::resample wrt itkwidgets.view. Here's a simple notebook if you want to experiment. ...and what it looks like empty when you load it: ...and what it looks like when you run it. Change the 05 to 00 and run it again to crash when itkw tries to render. |
Transpose or... The Array That Could Be Rendered I tried both this morning and unfortunately it doesn't make a difference. Transposed or not, numpy or vtk arrays, it all crashes when trying to rendering using itkwidgets after Image.resample. |
Copy or... Am I Repeating Myself? This suggested the size of the array itself might be a problem. One way to confirm this was to call resample with the same spacing ( array = np.ndarray([109, 77, 204])
itkw.view(image = array) So go put that in your notebook and smoke* it. *smoke implying crash, not advocating for actual inhalation of anything, note this is a non-smoking facility, not valid with any other offer, ...anyway, I hope someone is smiling, 'cuz this ain't our problem! Except that it is. 😞 |
All these examples render the itk viewer when shapeworks isn't imported. |
Hmm, do we have some conda itk/vtk vs shapeworks itk/vtk library interaction going on? |
I guess itkwidgets is using another version of itk |
Order of import is not important, but order of usage is. This means if you import everything, but use itkwidgets before shapeworks, it crashes when you use shapeworks, and vice versa. |
Since the solution to #1179 was simply "don't use itk," I propose we resolve this issue the same. Unless there is a better option at this time, let's remove itkwidgets from our notebooks. |
That sounds like a good plan for now. Is it reasonable to remove itkwidgets from the notebooks? What are we using it for? |
We are using it to view the segmentations. I think we can use pyvista instead |
Note that pyvista (as far as I know) does not respect image meta-information (origin, voxel spacing, axes direction), yet itkwidget does. |
We'll dig into this, but there must be some respect for origin since multiple volumes can be simultaneously plotted with different locations, and this image shows that spacing is used for plotting. Our sw2vtkImage function(s) simply didn't keep it (I know I changed this in some, but maybe those are in the new pybind branch). |
I want to suggest we release and push this to the next release since that one has many other python and notebook improvements, and essentially we'll be forced to rewrite them. Maybe we just let them be broken. It's a known issue in a public repository and we have a workaround in case any users run into it. (We will still need to modify the getting-started-with-segmentations notebook so it completes without crashing, which simply means picking a different arbitrary image to demonstrate rendering.) |
I agree. Let's push this to 6.1 release and I will update the release notes and the graphical abstract to de-emphasize python stuff. |
After using an arbitrary image that doesn't crash the viewer, it still crashes at 3 more places that use the mean shape image. |
I propose we exclude this notebook from the release except in the documentation. |
Works for me. @sheryjoe ? |
pyvista showing logical coordinates versus itkwidgets showing physical coordinate |
Given issue #900, it's hard to imagine itk having ever showed physical coordinates. For this image (with z-spacing = 2):
The itk viewer can only show the unscaled version since otherwise it crashes. Here's a single pyvista volume showing both the unscaled ellipsoid and the scaled version. I don't really like the way the pyvista viewer shows bounds compared to the itk viewer. |
Closing since issues will go away for us when #1186 is complete. |
This used to be "getting-started-with-grooming-segmentations notebook crashes on MacOS," but lots of investigation has uncovered the actual issue, possibly due to incompatible shared libraries.
Clean system, clean conda.
This is the cell that crashes:
The text was updated successfully, but these errors were encountered: