You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# a helper function that converts shapeworks Image object to vtk imagedefsw2vtkImage(swImg, verbose=False):
# get the numpy array of the shapeworks imagearray=swImg.toArray()
# the numpy array needs to be permuted to match the shapeworks image dimensionsarray=np.transpose(array,(2,1,0))
# converting a numpy array to a vtk image using pyvista's wrap functionvtkImg=pv.wrap(array)
ifverbose:
print('shapeworks image header information: ')
print(swImg)
print('\nvtk image header information: ')
print(vtkImg)
returnvtkImgimg=sw.Image('./../../Data/ellipsoid-v2/segmentations/ellipsoid_07.nrrd')
img.setSpacing([0.2,0.2,1])
vtkimg=sw2vtkImage(img,True)
# set spacing ***vtkImg.spacing=img.spacing()
# Spacing: 2.000e-01, 2.000e-01, 1.000e+00# this crashes when spacing is changedview(vtkimg)
itkwidgets.view crashes when spacing is changed, but works fine if not.
pyvista works and displays spacing correctly.
Use pyvista.Plotter instead.
The text was updated successfully, but these errors were encountered: