# [Urgent] Import 3D model and do 4d plotting [Urgent]

5 views (last 30 days)
Sohaib ulhaq on 11 May 2021
Answered: Jaimin on 8 Aug 2024 at 9:21
So have a model of a leg and I want to colormap the hard and soft tissue on it.
So if there is hard tissue (Bone) I need to Show red at that spot and if there is Softtissue (musscle) I need to show A yellow color at tht spot.
I have read that it can be done through 4D plotting but I cant seem to understand the process. can Someone help me with the process of importing and plotting?
Is there a easier altranative for the task?

Jaimin on 8 Aug 2024 at 9:21
It seems you want to display a 3D model of a leg with a colormap to differentiate between soft tissue and hard tissue.
You can utilize the “volshow” function of MATLAB for visualizing 3D volume data with color mapping. By using this function, you can distinguish between different types of tissues effectively by highlighting hard tissue in red and soft tissue in yellow.
Refer to the following MATLAB code that demonstrates how to use volshow” for your specific needs. This should help you get started with visualizing your 3D leg model.
V = randi([0, 1], [10, 10, 10]); %Demo Data
%Colormap Configuration
intensity = [0 1];
alpha = [1 1];
color = [255 0 0; 255 255 0;]/255;
queryPoints = linspace(min(intensity),max(intensity),2);
alphamap = interp1(intensity,alpha,queryPoints)';
colormap = interp1(intensity,color,queryPoints);
%Scale of a model
sx = 1;
sy= 1;
sz = 1;
A = [sx 0 0 0; 0 sy 0 0; 0 0 sz 0; 0 0 0 1];
tform = affinetform3d(A);
vol = volshow(V,Colormap=colormap,Alphamap=alphamap,Transformation=tform);
I hope this is helpful to you.