フィルターのクリア

Loop through 3D bins to count numbers of points of each color within each separate bin

5 ビュー (過去 30 日間)
AN
AN 2023 年 4 月 10 日
コメント済み: Matt J 2023 年 4 月 11 日
Hi all,
I apologize if this is a trivial question; I have mostly only worked with 2D data sets before. I have a large data set consisting of xyz coordinates (locations of electrode readings on a heart), each of which has a 4th-dimensional value assigned to it (representing an activation time reading). I have assigned different time intervals to different colors, resulting in the creation of a color map of activation time. I now want to divide the xyz coordinates in space into a 3D grid, and then analyze each grid section/cube separately to determine how many different colors it contains. I have written some code that uses the 'discretize' function to create bins out of the separate x,y, and z vectors. I am now attempting to analyze through each interval/cube using for loops. For some reason, however, my code is not working the way that I want. Does anyone have any idea how I can define each cube/voxel created by the discretize functions separately, as well as how I can determine the numbers of colors (rgb_time contains the values of the colors assigned to each xyz coordinate) within each cube? Thank you very much!

採用された回答

Matt J
Matt J 2023 年 4 月 11 日
編集済み: Matt J 2023 年 4 月 11 日
If you have followed the advice in your previous thread,
then you should now have a list of voxel IDs for every rgb time. So, you could now do,
counts = splitapply(@(z) height(unique(z,'rows')), RGB, ID(:))
Here, I assume RGB is an Nx3 array of color data.
  7 件のコメント
AN
AN 2023 年 4 月 11 日
Amazing! Thank you, you have made my life so much easier. I am working on getting a software upgrade approved currently.
Matt J
Matt J 2023 年 4 月 11 日
You are quite welcome, but if your problem is now resolved please Accept-click the answer.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGraphics Performance についてさらに検索

製品


リリース

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by