Colour coding of potential values

We have some potential values stored in a 2- d matrix of size 123*1095. we are supposed to map these potential values to 3-D geometry of heart. for this, we need to assign colours to a range of potentials and this colour which is mapped to the heart geometry must change according to the variation in potentials, continuously. can somebody please help? thank you in advance.

 Accepted Answer

Walter Roberson
Walter Roberson on 29 May 2021
If you have an array of values that needs to be "wrapped" around a 3D object, then I recommend using warp() -- though you could also use surf() if you get the parameters right.

3 Comments

First of all thank you.
we have certain data points (potentials) stored in a matrix. we want this potential values to be related to certain colour. Example, 0 we want red, 2 as yellow; 1 any colour between red and yellow etc how can we relate this different potential values with the colour
Walter Roberson
Walter Roberson on 31 May 2021
Edited: Walter Roberson on 31 May 2021
Decide on a range of values to be handled.
Take your control points with that range and rescale() them to the range 0 to 1. Those scaled values become the control levels for the purposes of the custom colormap File Exchange contribution.
When you go to display the data, you can either use caxis() and let MATLAB scale it itself, your you can rescale() into [0 1] and so be sure you are matching the colormap. Using caxis() has the advantage of making it easier to get the labels right for colorbar() purposes, and makes data cursor easier to reflect the original values.
Thank you sir. Actually, We are doing a project on mapping epicardial potentials to a 3-D heart geometry. recently we had asked a query on mathworks regarding the mapping scenario. the problem we encountered while doing so is that we want certain potentials to be mapped to particular locations of the heart geometry. this, potentials must be mapped as different colours to the geometry and the colours must vary as the potentials changes to obtain a video in the end showing potential variation.
we used caxis to scale the potential values and mapp using colormap and use movie funtion to obtain video after applying a loop but the color doesnt vary neither does the potential appear to be at required locations the geometry.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!