Open Jsalas424 opened 2 years ago
I have seemingly come up with a side answer, but would still be interested to know what the endorsed method is using the openep toolkit and your thoughts on this method. I still have to experiment with the data output to make sure it's consistent as I move between Matlab-OpenEP and 3D Slicer v5.0.3
The following solution will be how to generate VTK’s from OpenEP using vtkwrite in Matlab
x = userdata.surface.triRep.X(1:end,1);
y = userdata.surface.triRep.X(1:end,2);
z = userdata.surface.triRep.X(1:end,3);
vtkwrite('mesh.vtk','polydata','triangle',x,y,z,userdata.surface.triRep.Triangulation);
Edit: It should be noted that this method has "precision" issues - i.e., it rounds the decimals and the option to change the precision of the output files doesn't work. I have since moved to the trimesh python library which works very well.
Sorry, didn't meant to close the issue. Still open.
Hello, are you using the cartoMesh2VTK
function or 'openEP2VTK'? If it's openEP2VTK
, does it work if you set a different datatype (one that is present), e.g.
openEP2VTK('datatype', 'uni')
Or set no datatype:
openEP2VTK('datatype', 'none')
HI @p-j-smith thanks for responding!
None work sadly:
>> openEP2VTK('datatype', 'none')
Dot indexing is not supported for variables of this type.
Error in openEP2VTK (line 97)
pointdata = userdata.surface.act_bip(:,1);
>> openEP2VTK('datatype', 'uni')
Dot indexing is not supported for variables of this type.
Error in openEP2VTK (line 97)
pointdata = userdata.surface.act_bip(:,1);
>> openEP2VTK('datatype', 'bip')
Dot indexing is not supported for variables of this type.
Error in openEP2VTK (line 97)
pointdata = userdata.surface.act_bip(:,1);
>> openEP2VTK('datatype', 'lat')
Dot indexing is not supported for variables of this type.
Error in openEP2VTK (line 97)
pointdata = userdata.surface.act_bip(:,1);
This is a paced map and there's definitely LAT data in there as evidenced by my ability to calculate conduction velocities and make those maps:
Hmm, that's strange, is there any chance you could share this openep dataset too?
Absolutely! We tend to to run into issues because we generally run the latest/development version of CARTO in our lab, BWI tends to change up the text file organization every couple of iterations.
Hi, sorry for not getting back to you sooner. I just had a look at your dataset and in doing so realised that the way you were calling the function was not quite right. The first argument should be the userdata
you would like to export:
tr = openEP2VTK(userdata, 'datatype', 'none')
Hopefully that works for you!
Hi Paul,
I tried this on 2 datasets (including the one I sent you) but still no luck:
>> tr = openEP2VTK(userdata, 'datatype', 'none')
Unrecognized function or variable 'pointdata'.
Error in openEP2VTK (line 104)
writeTriRep2VTK(getMesh(userdata), pointdata, 'outputfile', path2VTKfile);
>>
Hello Dr. Williams,
I've been putting in some questions so I figured I'd explain that I'm with the University of Pennsylvania's translational EP research group and we're trying to get some CARTO data processed using your platform. We are very impressed and excited about this tool!
I'm now trying to export the CARTO mesh to a VTK file for some post-processing in 3d Slicer but am struggling with the correct method. I've attempted to use the cartoMesh2VTK api with no luck.
This is attempted with an imported RV Paced LAT map. The userdata.surface.act_bip() array is indeed empty. Can you please advise the correct way to get a VTK file out?
I do have userdata.triRep.X and userdata.triRep.triangulation data available as well.