Volumetric Interpolation using Slice function, how to obtain colour values from the image of the plane

조회 수: 5 (최근 30일)
Hi guys,
I have been playing around with the flow example provided on this link http://www.mathworks.com/help/techdoc/visualize/f5-3558.html and at the part where we take a slice of the 3d data set using
rotate(hslice,[-1,0,0],-45)
xd = get(hslice,'XData');
yd = get(hslice,'YData');
zd = get(hslice,'ZData');
h = slice(x,y,z,v,xd,yd,zd);
I was wondering if it is possible to get the V values of the function at the points of xd,yd and zd or atleast get the colour values at these points that are generated in the image. Since MatLAB documentation says the slice function uses 3d interpolation to colour the image I was wondering if there is a way to extract the interpolated values that it gets for the function V (the values at the points xd,yd,zd) before it does the colouration.

채택된 답변

Patrick Kalita
Patrick Kalita 2011년 9월 19일
You can extract the CData property of the slice surface h:
get(h, 'CData')
That should get you the values you're looking for.
However, if you only want those values and you aren't interested in the visualization at all, you can just use interp3.
  댓글 수: 2
Rafay
Rafay 2011년 9월 19일
I dont understand the data outputted by CData it gives me a 2 dimensional set from with many NaN followed by some numbers, surprisingly when i run vi = interp3(x,y,z,v,xd,yd,zd); i get the exact same output. what do these outputs represent?
Patrick Kalita
Patrick Kalita 2011년 9월 20일
Those are the values found by interpolating your original data ( v = f(x,y,z) ) at the points defined by the mesh (xd, yd, zd).

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

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by