필터 지우기
필터 지우기

How to slice volume data recorded in a 1D vector

조회 수: 2 (최근 30일)
Maura Monville
Maura Monville 2016년 3월 30일
편집: per isakson 2016년 3월 30일
The output file of a radiation transport Monte Carlo simulation contains the following 1D vectors:
R = 0,1,2,3,4
Phi = 0,1,2,3,4,5,6,7,8,9,10
Theta = 0,1,2,3,4
which represent indexes of steps in the Radius, azimuthal angle and polar angle
Radius step = 0.2 cm
Phi step = 36 degrees
Theta step = 36 degrees
The 4th column contains the dose deposited in the spherical sector limited by (R_j,R_j+1), (Phi_j,Phi_j+1), (Theta_j, Theta_j+1) With reference to the comprehensive explanation kindly posted by a 3D graphic expert http://www.mathworks.com/matlabcentral/answers/275550-how-to-slice-a-sphere-using-spherical-coordinates#answer_215445
I have got the above mentioned data converted to cartesian coordinates. So I still have 4 1D vectors [x y z v_csv] where v_csv contains the dose values. My goal is to slice the dose along planes passing through the coordinates center (0, ,) and containing the Y_axes and the Z_axes (basically plane X=0) then rotate such a plane about the Z_axis by an increment of the azimuthal angle Phi and slice the dose again.
I tried to use the worked out examples in Matlab documentation of the graphical function 'slice' but I kept getting the same error:
>> h = slice(x,y,z,v_csv,xd,yd,zd);
Error using slice (line 81)
V must be a 3-D array.
>> slice(x,y,z,v_csv,xslice,yslice,zslice)
Error using slice (line 81)
V must be a 3-D array.
I do not know how to convert the 1D vector v_cvs into a 3D volume to be able to mimic MatLab on-line examples. I am leery of using MatLab command 'reshape' because it easily reshuffles the data. I mean every dose value is uniquely referred to a coordinates triplet (x,y,z). If it was referred to another triplet (x1, y1,z1) then the visualization would be misleading.
I would appreciate some hints. Thank you in advance Maura maura.monville@gmail.com

답변 (0개)

카테고리

Help CenterFile Exchange에서 Lighting, Transparency, and Shading에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by