Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't use the editUserdata function: editUserdata(userdata) - Unrecognized function or variable 'tr2' #66

Open
Jsalas424 opened this issue Jul 22, 2022 · 3 comments

Comments

@Jsalas424
Copy link

Jsalas424 commented Jul 22, 2022

Hello,

I am trying to use the editUserdata function, but keep getting the following error on both the openep_demo data as well as my own CARTO-exported data.

>> openep_demo
Loading OpenEP Dataset 1 ...
Create a figure ...
Conduction velocity mapping ...
RBF Check
max|y - yi| = 2.683009e-11 

Length of cMap is: 256
Finding anatomical structures ...
Perimeter is: 120.371 | Area is: 1076.7977
Perimeter is: 68.4187 | Area is: 360.6815
Perimeter is: 60.7448 | Area is: 261.257
Perimeter is: 60.7833 | Area is: 276.9662
Perimeter is: 80.5349 | Area is: 439.2574
Perimeter is: 49.2943 | Area is: 186.3216
Show a voltage map ...
Warning: Integer operands are required for colon operator when used as index. 
> In colorShell/adjustSlider (line 248)
In colorShell (line 177)
In drawMap (line 140)
In openep_demo (line 31) 
Length of cMap is: 231
Voltage histogram analsysis
Warning: Some input points are not referenced by the triangulation. 
> In getLowVoltageArea/local_calculateArea (line 87)
In getLowVoltageArea (line 78)
In voltageHistogramAnalysis (line 65)
In openep_demo (line 36) 
Warning: Some input points are not referenced by the triangulation. 
> In getLowVoltageArea/local_calculateArea (line 87)
In getLowVoltageArea (line 78)
In voltageHistogramAnalysis (line 65)
In openep_demo (line 36) 
Warning: Some input points are not referenced by the triangulation. 
> In getLowVoltageArea/local_calculateArea (line 87)
In getLowVoltageArea (line 78)
In voltageHistogramAnalysis (line 65)
In openep_demo (line 36) 
Warning: Some input points are not referenced by the triangulation. 
> In getLowVoltageArea/local_calculateArea (line 87)
In getLowVoltageArea (line 78)
In voltageHistogramAnalysis (line 65)
In openep_demo (line 36) 
Warning: Some input points are not referenced by the triangulation. 
> In getLowVoltageArea/local_calculateArea (line 87)
In getLowVoltageArea (line 78)
In voltageHistogramAnalysis (line 65)
In openep_demo (line 36) 
Warning: Some input points are not referenced by the triangulation. 
> In getLowVoltageArea/local_calculateArea (line 87)
In getLowVoltageArea (line 78)
In voltageHistogramAnalysis (line 92)
In openep_demo (line 36) 
Warning: Some input points are not referenced by the triangulation. 
> In getLowVoltageArea/local_calculateArea (line 87)
In getLowVoltageArea (line 78)
In voltageHistogramAnalysis (line 92)
In openep_demo (line 36) 
Warning: Some input points are not referenced by the triangulation. 
> In getLowVoltageArea/local_calculateArea (line 87)
In getLowVoltageArea (line 78)
In voltageHistogramAnalysis (line 92)
In openep_demo (line 36) 
Warning: Some input points are not referenced by the triangulation. 
> In getLowVoltageArea/local_calculateArea (line 87)
In getLowVoltageArea (line 78)
In voltageHistogramAnalysis (line 92)
In openep_demo (line 36) 
Warning: Some input points are not referenced by the triangulation. 
> In getLowVoltageArea/local_calculateArea (line 87)
In getLowVoltageArea (line 78)
In voltageHistogramAnalysis (line 92)
In openep_demo (line 36) 
Warning: Some input points are not referenced by the triangulation. 
> In getLowVoltageArea/local_calculateArea (line 87)
In getLowVoltageArea (line 78)
In voltageHistogramAnalysis (line 92)
In openep_demo (line 36) 
Warning: Some input points are not referenced by the triangulation. 
> In getLowVoltageArea/local_calculateArea (line 87)
In getLowVoltageArea (line 78)
In voltageHistogramAnalysis (line 92)
In openep_demo (line 36) 
Warning: Some input points are not referenced by the triangulation. 
> In getLowVoltageArea/local_calculateArea (line 87)
In getLowVoltageArea (line 78)
In voltageHistogramAnalysis (line 92)
In openep_demo (line 36) 
Warning: Some input points are not referenced by the triangulation. 
> In getLowVoltageArea/local_calculateArea (line 87)
In getLowVoltageArea (line 78)
In voltageHistogramAnalysis (line 92)
In openep_demo (line 36) 
Warning: Some input points are not referenced by the triangulation. 
> In getLowVoltageArea/local_calculateArea (line 87)
In getLowVoltageArea (line 78)
In voltageHistogramAnalysis (line 92)
In openep_demo (line 36) 
Warning: Some input points are not referenced by the triangulation. 
> In getLowVoltageArea/local_calculateArea (line 87)
In getLowVoltageArea (line 78)
In voltageHistogramAnalysis (line 92)
In openep_demo (line 36) 
Warning: Some input points are not referenced by the triangulation. 
> In getLowVoltageArea/local_calculateArea (line 87)
In getLowVoltageArea (line 78)
In voltageHistogramAnalysis (line 92)
In openep_demo (line 36) 
Warning: Some input points are not referenced by the triangulation. 
> In getLowVoltageArea/local_calculateArea (line 87)
In getLowVoltageArea (line 78)
In voltageHistogramAnalysis (line 92)
In openep_demo (line 36) 
Warning: Some input points are not referenced by the triangulation. 
> In getLowVoltageArea/local_calculateArea (line 87)
In getLowVoltageArea (line 78)
In voltageHistogramAnalysis (line 92)
In openep_demo (line 36) 
Warning: Some input points are not referenced by the triangulation. 
> In getLowVoltageArea/local_calculateArea (line 87)
In getLowVoltageArea (line 78)
In voltageHistogramAnalysis (line 92)
In openep_demo (line 36) 


>> editUserdata(userdata)
Unrecognized function or variable 'tr2'.

Error in editUserdata (line 32)
[tr2, isVertUsed] = editTriangulation(tr2);

Thanks in advance for the support!

@Jsalas424 Jsalas424 changed the title Can't use the editUserdata fucntion: editUserdata(userdata) - Unrecognized function or variable 'tr2' Can't use the editUserdata function: editUserdata(userdata) - Unrecognized function or variable 'tr2' Jul 22, 2022
@p-j-smith
Copy link

There seems to be a couple of issues with editUserdata. One is that:

[tr2, isVertUsed] = editTriangulation(tr2);

should be:

[tr2, isVertUsed] = editTriangulation(tr);

Another is that editUserdata calls editTriangulation, which in turn tries to call get3dfaces. However, get3dfaces doesn't exist. I'm not too sure what this function should be doing, but perhaps @drsewilliams know more about this function?

@drsewilliams
Copy link
Member

Good spot, yes, get3dfaces.m was missing; added now.

Note that editUserdata only changes the geometry, and not the contents of userdata.surface.act_bip or userdata.surface.uni_imp_frc

Therefore, if you try for example to run drawMap(userdata, 'type', 'bit') after editing the userdata using editUserdata then you will find that it crashes, as it is access surface data values which have not been edited.

Instead if you try drawMap(userdata, 'type', 'none') then this will draw a shell without mapping data.

Workarounds are to

  • manually reinterpolate the surface values using the new mesh and OpenEpDataInterpolator.m
  • use cutMesh.m instead which provides a geodesic hole cutter.

Note however that cutMesh.m requires that the surface mesh is well formed - which is not always the case. Any floating islands, or non manifold triangles will actually result in Matlab to crash ... but that is on to remeshing which is probably another topic.

@Jsalas424
Copy link
Author

Thanks for the input @drsewilliams and @p-j-smith! To contextualize this ticket, I was interested in removing valve areas etc. as a data cleaning step before comparing CVs in the ventricle. I ended up with a work-around, but am curious if this was an intended (or unintended) usecase for the editUserdata function?

Do you think adjusting the geometry would significantly change the CVs if we reinterpolated the surface values from the new mesh? From what I've understood of this method, CVs are locally accurate, so removing mesh vertices associated with non-physiologic CVs/tissue shouldn't appreciably affect the CV's calculated in well sampled areas.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants