BiAPoL/Bio-image_Analysis_with_Python

Error with nppas.to_napari_surface_data

Closed this issue · 2 comments

Hi,

in /05_feature_extraction/02_sphericity_and_solidity we have the followng code block:

mesh_gastruloid = vedo.load('data/gastruloid.ply')

napari_mesh_gastruloid = nppas.to_napari_surface_data(mesh_gastruloid)
napari_mesh_gastruloid

When running this, I get the following Error:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
File ~/anaconda3/envs/biapol2/lib/python3.9/site-packages/IPython/core/formatters.py:344, in BaseFormatter.__call__(self, obj)
    342     method = get_real_method(obj, self.print_method)
    343     if method is not None:
--> 344         return method()
    345     return None
    346 else:

File ~/anaconda3/envs/biapol2/lib/python3.9/site-packages/napari_process_points_and_surfaces/_vedo.py:70, in SurfaceTuple._repr_html_(self)
     68 bounds = "<br/>".join(["{min_x:.3f}...{max_x:.3f}".format(min_x=min_x, max_x=max_x) for min_x, max_x in zip(mesh.bounds()[::2], mesh.bounds()[1::2])])
     69 average_size = "{size:.3f}".format(size=mesh.average_size())
---> 70 center_of_mass = ",".join(["{size:.3f}".format(size=x) for x in mesh.centerOfMass()])
     71 scale = ",".join(["{size:.3f}".format(size=x) for x in mesh.scale()])
     72 histogram = ""

AttributeError: 'Mesh' object has no attribute 'centerOfMass'

I am using nppas ==0.5.0. and Python==3.9.18
I suspect that in 'centerOfMass'` We have a ZERO instead of a "O".

Thanks for any help!

Hi @LokasInStrings ,

it seems vedo is breaking backwards compatibility often, causing errors like this one. Would you mind trying an older version of vedo?

mamba install vedo=2022.4.1

Let us know if this works!

Best,
Robert

Hi @haesleinhuepf ,
This worked, thanks a lot!

Best,
Lukas