Unknown Error

63 views
Skip to first unread message

Liam Martin

unread,
Jan 24, 2020, 10:55:01 AM1/24/20
to Deformetrica
Below is the error that I am getting when I try to run a registration shape analysis. This error is new and I have run a registration before with these same settings and I don't think I've changed anything in the process. I was hoping that someone here would have an idea to try. Below is a copy/paste of the error. Thanks for the help!

which: no nvcc in (/ihome/crc/install/gcc/8.2.0/bin:/ihome/crc/install/python/anaconda3.7-2019.03_deformetrica/bin:/ihome/crc/install/openmpi/3.1.1/gcc-8.2.0/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/ihome/crc/wrappers:/ihome/sabramowitch/lcm50/.local/bin:/ihome/sabramowitch/lcm50/bin)
Logger has been set to: WARNING
Traceback (most recent call last):
  File "/ihome/crc/install/python/anaconda3.7-2019.03_deformetrica/bin/deformetrica", line 10, in <module>
    sys.exit(main())
  File "/ihome/crc/install/python/anaconda3.7-2019.03_deformetrica/lib/python3.7/site-packages/deformetrica.py", line 117, in main
    model_options=get_model_options(xml_parameters))
  File "/ihome/crc/install/python/anaconda3.7-2019.03_deformetrica/lib/python3.7/site-packages/api/deformetrica.py", line 140, in estimate_registration
    dimension=model_options['dimension'], **dataset_specifications)
  File "/ihome/crc/install/python/anaconda3.7-2019.03_deformetrica/lib/python3.7/site-packages/in_out/dataset_functions.py", line 39, in create_dataset
    dimension))
  File "/ihome/crc/install/python/anaconda3.7-2019.03_deformetrica/lib/python3.7/site-packages/in_out/deformable_object_reader.py", line 41, in create_object
    object_filename, dimension, extract_connectivity=True)
  File "/ihome/crc/install/python/anaconda3.7-2019.03_deformetrica/lib/python3.7/site-packages/in_out/deformable_object_reader.py", line 143, in read_vtk_file
    polygons = nps.vtk_to_numpy(poly_data.GetPolys().GetData()).reshape((-1, 4))[:, 1:]
ValueError: cannot reshape array of size 180821 into shape (4)

Alexandre Bône

unread,
Jan 27, 2020, 8:17:41 AM1/27/20
to Deformetrica
Hello Liam, 

Thank you for your interest in Deformetrica. 

This error seems rather strange. Could you try to execute the following Python code?  
from vtk import vtkPolyDataReader
from vtk.util import numpy_support as nps
poly_data_reader = vtkPolyDataReader()
poly_data_reader.SetFileName(PATH_TO_YOUR_INPUT_FILE)
poly_data_reader.Update()
poly_data = poly_data_reader.GetOutput()
polygons = nps.vtk_to_numpy(poly_data.GetPolys().GetData()).reshape((-1, 4))[:, 1:]

I would assume that the last line will fail. 
If it does, I would diagnose a weird vtk format and try to "repair" it with Paraview, with a filter like this one: https://www.paraview.org/Wiki/ParaView/Users_Guide/List_of_filters#Clean

Hoping this will help you, 
Best, 

Alex 


Reply all
Reply to author
Forward
0 new messages