Workflow to compare two models based on their respective associated scalars

Hi, fantastic work here. Slicer is great.
I have advanced on my own but could do with a kind and helping hand for the last step.

Very quickly :

I have two models. The fist one has been created from a segmented volume and “painted” by probevolumefrommodel. The other model is a polydata model imported from an electro-anatomical CARTO® map. I need to compare the values associated with those two models on a “point by point” basis, to draw some correlation.

What I did :

  1. I created 5000 fiducials points on the first model,

  2. I registered the model to the other one by means of non rigid transformation, and applied this transformation to the fiducials.

  3. I projected the 5000 transformed points to the second model using nearest distance projection. I now have 2 sets of related fiducials, one on each model surface, that i would like to compare in term of the underlying scalar data.

How should I proceed in order to sample each model at each and every fiducial point ?

Alternativly I could use another approach if more practical.

Regards, and again many thanks for this gem of a software.

1 Like

Hi - great that you are finding Slicer useful :+1:

A couple thoughts - if you are trying to find the values you painted onto the module with ProbeVolumeFromModel, you could just look up the points in the volume, like this.

Or if you are going the other way and want to sample on the carto volume, you can use a locator to get the point indices and look up the scalar data.

Thank you, it works like a charm. I did something like that to iterate on the fiducials. Perfect

Blockquote

for i in range(numControlPoints):

ras = vtk.vtkVector3d(0,0,0)
pointListNode.GetNthControlPointPosition(i,ras)
closestPointId = pointsLocator.FindClosestPoint(ras)
ras = modelNode.GetPolyData().GetPoint(closestPointId)
closestPointValue = modelPointValues.GetTuple(closestPointId)
measurements.append(str(closestPointValue[0]))

slicer.app.clipboard().setText("\n".join(measurements))