Regarding your code, there are few things you need to change.
-
You need to install the
pandasPython library or module. To do this, execute the following line in the Python Interactor:slicer.util.pip_install('pandas')[1] -
Then Import the
pandasmodule by executingimport pandasalso in the Python Interactor
Now you can enter the code above but, keep in mind that some variables may not be the same as you expect. For instance;
-
modelNode = slicer.util.getNode("VTK Output File")you may have named the output file to something other than VTK Output File -
slicer.util.arrayFromModelPointData(modelNode,"Absolute_to_BBCJG_vtkMRMLModelNodeF")I am not sure whatAbsolute_to_BBCJG_vtkMRMLModelNodeFis but you may need to change this to one of the variables in the VTK structure, such as:PointToPointVectororPointToPointAlongXand so on… -
Finally, make sure you have the correct path here
pandas.DataFrame(distances).to_csv(r"~/Desktop/Model/data.csv", index=False)
Also, I had to change all of the single quotations ' to double ", I think this is a Windows/Linux thing. I am using a Windows!
Another trick that may work for you is to inspect the VTK Output File manually. You can always save the file as a ASCii or decompressed version of the file and open it with a text reader.
