finite element method for medical images

20 vues (au cours des 30 derniers jours)
image-pro
image-pro le 30 Mai 2023
Commenté : image-pro le 9 Avr 2024 à 20:53
I am trying to create fem mesh for MRI brain tumor image after labeling but shows error below.
Error using checkMeshIncompatible
Invalid input mesh. Neighboring mesh elements or mesh elements in one or more regions are not properly
connected.
Error in checkMeshValidity (line 49)
checkMeshIncompatible(elements(1:3,:)');
Error in pde.EquationModel/geometryFromMesh (line 126)
checkMeshValidity(nodes,elements,regions);
Error in untitled (line 17)
geometryFromMesh(model,verticesPatientMeters',faces');
The script is given below:
filepath = ("C:\Users\DELL\OneDrive\Documents\MATLAB\");
dataFolder = fullfile(filepath,"MedicalVolumeDICOMData","LabelData");
labelVol = medicalVolume("C:\Users\DELL\OneDrive\Documents\MATLAB\MedicalLabelingSession6\LabelData\8_19_2021_11_41_40_AM.nii");
R = labelVol.VolumeGeometry;
isovalue = 1;
[faces,vertices] = extractIsosurface(labelVol.Voxels,isovalue);
I = vertices(:,1);
J = vertices(:,2);
K = vertices(:,3);
[X,Y,Z] = intrinsicToWorld(R,I,J,K);
verticesPatient = [X Y Z];
verticesPatientMeters = verticesPatient.*10^-3;
triangul = triangulation(double(faces),double(verticesPatientMeters));
viewer = viewer3d;
surface = images.ui.graphics3d.Surface(viewer,data=triangul,Color=[1 0 0],Alpha=1);
model = createpde(3);
geometryFromMesh(model,verticesPatientMeters',faces');
pdegplot(model,FaceLabels="on")
  2 commentaires
Brian McDonnell
Brian McDonnell le 9 Avr 2024 à 17:23
Hi did you find a solution for this? I'm also getting some similar errors with a mesh generated in tetGen. I'm confident after some extensive checking that the mesh is fine. I've been using checkMeshIncompatible to try and troubleshoot the issue but no luck.
image-pro
image-pro le 9 Avr 2024 à 20:53
I have changed isovalue=0.12 then this error removed. But when running this code of line geometryFromMesh(model,verticesPatientMeters',faces') Then get another error. And when replace verticesPatientMeters to vertices then work fine but results are not accurate. If you have any solution plz reply as soon s possible thank in advance.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur MRI dans Help Center et File Exchange

Produits


Version

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by