Remove points in a 3D matrix that lie inside a 2D polygon on each layer
Mostrar comentarios más antiguos
I'm visualizing an MRI but am trying to remove a lot of artifacts that usually come in these images. I've implemented two solutions:
- use knnsearch to remove points too far away from their neighbors (i.e. floating out in the middle of nowhere) - works very well
- Have a user draw a polygon around remaining points from a topdown view (view 2) to remove the clusters of bad points from each layer.
The issue I'm running into is this: I can have a user create a polygon and get the points of the polygon with something like roi.Position, however I'm having trouble figuring out how to efficiently come through each Z layer of the matrix to remove the points within the polygon. Any ideas?
plot3(target_cluster(:,1,:),target_cluster(:,2,:))
roi = drawpolygon('Color','r');
My instinct is to run a for loop through each layer, but this seems inefficient. TIA
2 comentarios
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Biomedical Imaging en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
