Trying to divide a 3D Scatter plot into grid to count number of colored points in each grid cell

3 views (last 30 days)
Hi all,
I was tasked with recreating a 3D color map of activation time points from an electroanatomic map of the heart (taken from discrete electrode readings in 3 dimensional space), and then dividing the map into a grid to find the area of the heart with the most isochronal crowding (defined as the region where there are the most colors). The data points are exported from the mapping software in a .mat data file as attached. I have managed to recreate an image as shown using an arbitrary color map decided on by myself and my team. It is a scatterplot of values that do not fit any equation, but are rather just time/voltage readings corresponding to 3D points (x,y,z).
I am a bit stuck on how to loop through every grid cell in 3D space; to be more specific, I am not really sure how to divide the scatterplot into a grid. meshgrid does not seem to work, as the z values returned are NaN. Is it possible to create some sort of loop to section the scatterplot 3 dimensionally so that each section can be analyzed separately? I apologize if this question is simplistic, thank you!
  1 Comment
Cris LaPierre
Cris LaPierre on 31 Mar 2023
Just adding code to visualize the activation voltage in case others find it helpful
load map6_LV_Sinus.mat
scatter3(data.anatomy.vertices_mm(1,:),data.anatomy.vertices_mm(2,:),data.anatomy.vertices_mm(3,:),...
[],data.maps.activation.bipolar_ms,'.')

Sign in to comment.

Answers (1)

Nayan
Nayan on 5 Apr 2023
Edited: Nayan on 5 Apr 2023
Hi,
As, I understand, you are required to find the area of the heart with the most isochronal crowding (defined as the region where there are most colors). I would suggest you to use the discretize(___,'IncludedEdge',side), that allows to segment your data point into cubical bins.
Refer the following link for better understanding and use cases.
Once you have all the datapoint-bin mapping you can easily iterate over each bin IDs to further draw interpretations on the data.
  1 Comment
AN
AN on 7 Apr 2023
Thank you very much! I have managed to create bins of my data. What do you think would be the best way to analyze the data within every single bin? I am thinking of creating a loop to loop through every x,y, and z interval separately. Is there a way to define cubes in space using indexes? The bin ID's seem to only assign every value of each separate dimensional vector to a bin.

Sign in to comment.

Products

Community Treasure Hunt

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

Start Hunting!