color 3d plot by depth

조회 수: 4 (최근 30일)
Emily Pendleton
Emily Pendleton 2019년 1월 22일
댓글: Emily Pendleton 2019년 1월 23일
Hello,
I am trying to take this binary 3D plot and color code the layers by depth. For example if z =1, all pixels are red; if z = 25, all pixels are orange, etc...I would like the color scale to be continuous. Any help on this would be appreciated. This is what I have thus far:
stack = tiff(:,:,:);
T = adaptthresh(stack, 0.57,'neigh', [99 99 99], 'ForegroundPolarity', 'dark');
bw = imbinarize(stack,T); %applies adaptive threshold to image
x = 1:size(stack,2);
y = 1:size(stack,1);
z = 1:size(stack,3);
figure(1),isosurface(x,y,z,stack,0.5)
pores.png
  댓글 수: 1
Brian Hart
Brian Hart 2019년 1월 22일
You can probably do this by changing the figure color map. It would help to have the input TIFF file to play with.

댓글을 달려면 로그인하십시오.

채택된 답변

Walter Roberson
Walter Roberson 2019년 1월 22일
See https://www.mathworks.com/help/matlab/ref/isosurface.html#bq349vy-1 for an example of coloring by x. In the isosurface() call in that example, you would replace the final x by z to color by z.
  댓글 수: 5
Walter Roberson
Walter Roberson 2019년 1월 22일
Then the two lines I suggested should probably work.
Emily Pendleton
Emily Pendleton 2019년 1월 23일
It does, thank you!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Polygons에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by