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
sw2vtkImage doesn't include spacing or origin (fixed in pymodule_conv) #899
Milestone
Comments
related to #825 |
It might help to show the function here. This is from the "getting-started-with-exploring-segmentations" notebook, and the function will soon be included directly in the shapeworks module. # a helper function that converts shapeworks Image object to vtk image
def sw2vtkImage(swImg, verbose = False):
# get the numpy array of the shapeworks image
array = swImg.toArray()
# the numpy array needs to be permuted to match the shapeworks image dimensions
array = np.transpose(array,(2,1,0))
# converting a numpy array to a vtk image using pyvista's wrap function
vtkImg = pv.wrap(array)
if verbose:
print('shapeworks image header information: ')
print(swImg)
print('\nvtk image header information: ')
print(vtkImg)
return vtkImg |
Add this to the function and it works (it'll be added to helper function in pymodule branch):
|
cchriste
changed the title
sw2vtkImage doesn't include spacing
sw2vtkImage doesn't include spacing or origin (fixed in pymodule)
Jan 21, 2021
archanasri
changed the title
sw2vtkImage doesn't include spacing or origin (fixed in pymodule)
sw2vtkImage doesn't include spacing or origin
Mar 24, 2021
Done in pymodule_conv |
archanasri
changed the title
sw2vtkImage doesn't include spacing or origin
sw2vtkImage doesn't include spacing or origin (fixed in pymodule_conv)
Apr 5, 2021
@archanasri can we close this? |
@archanasri is this still an issue? |
Done. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
vtkImg.spacing = swImg.spacing()
needs to be added to this functionMight also be able to maintain origin and other parts of the Image.
The text was updated successfully, but these errors were encountered: