Matlab 3D dose array visualization
matlab, matlab-figure
Solution
you can set the zeros to `nan` so that they are not plotted
diff = double(squeeze(diff));
diff(diff==0)=nan; % added line
h = slice(diff, [], [], 1:size(diff,3));
set(h, 'EdgeColor','none', 'FaceColor','interp')
alpha(.1)
Example
using the MRI data form the previous question
load mri
D = double(squeeze(D));
D(D==0)=nan;
h = slice(D, [], [], 1:size(D,3));
set(h, 'EdgeColor','none', 'FaceColor','interp')
alpha(.1)
output
with replacing zeros with nan without replacing zeros with nan
Problem
I have a 3D matrix in Matlab which corresponds to an energy dose delivered matrix. I am trying to visualize and represent the matrix. At the moment I am doing the following (thanks to another post). ``` diff = double(squeeze(diff)); h = slice(diff, [], [], 1:size(diff,3)); set(h, 'EdgeColor','none', 'FaceColor','interp') alpha(.1) ``` That gives me a good 3D plot, however it is still difficult to see it properly and I have to keep rotating the figure to be able to visualize it properly. I have also used : ``` isosurface(diff,'isovalue') ``` but again it is hard to see anything. I was wondering if there is a way of getting rid of the blue area around the actual dose representation since the blue area corresponds to `0` values. Perhaps getting rid of that could help me to see a much more clear picture.