openep / openep-core

Core OpenEP code - Matlab implementation
Apache License 2.0
9 stars 6 forks source link

Is it possible to retrieve conduction velocity vectors? #80

Closed Jsalas424 closed 1 year ago

Jsalas424 commented 1 year ago

Hello OpenEP team,

How can I retrieve wavefront directionality? From the looks of your matlab script, it's one of the outputs of the RBF method you're implementing (out3?): https://github.com/openep/openep-core/blob/master/private/RBFConductionVelocity.m

Jsalas424 commented 1 year ago

I'm attempting to manually implement your RBFConductionVelocity.m script, but can't seem to get the rbfinterp function to work as expected.

From what I've gathered between getConductionVelocity.m and RBFConductionVelocity.m, the rbfcreate function depends on the lat coordinates and their timing, and then rbfinterp function extrapolates the results to the full mesh, assigning a derived LAT timing to each vertex.

The code suggests that rbfinterp is expected to output more than the 1 x N that it does and the notes state that we should expect 'out1: interpolated scalar field (1,N) - out2: gradient of interpolated scalar field (d,N)'. I'm still ultimately trying to retrieve 'out4: wave direction (d,N)'

Here's the wall I'm hitting:

lat = userdata.electric.annotations.mapAnnot(getMappingPointsWithinWoI(userdata))';
lat_coord = userdata.electric.egmX(getMappingPointsWithinWoI(userdata),:)';
mesh_coord = userdata.surface.triRep.X';

op = rbfcreate(lat_coord,lat, 'RBFFunction','multiquadric','RBFConstant', 1, 'Stats','on');
rbfcheck(op); %if this returns anything >10^-9 then modify 'const'

[interpLATs, d_interpLATs]= rbfinterp(mesh_coord, op);

Error using rbfinterp
Too many output arguments.

Here's what the output of rbfinterp(mesh_coord, op); looks like:

1984.46235601945    1982.63612263441    1984.37599129610    1983.92318688117    1982.89472259185    1985.75506520951    1984.93454225583 ...
Jsalas424 commented 1 year ago

This is resolved. I was using the rbfcreate.m script that didn't include the RBF derivatives.