How to extract a 1D dose at certain depth in x,y or z-direction from a 3D array?
6 views (last 30 days)
Show older comments
Hi everyone,
I first confess that am very begginer in coding which I find to be very useful in my academic area.
Currently, I have a 3D dose array calculated by Monte Carlo in a phantom as a function of xyz direction. The z-direction also represent depths of the phantom in which the dose was calculated. I want to extract and analyze this 3D dose data in individual directions, say in x or y (profiles) at different depths and in z-direction (pdds).
Thank you.
4 Comments
Answers (1)
KSSV
on 29 Jul 2020
I feel slice is your function....
load("xdim.mat") ;
load("ydim.mat") ;
load("zdim.mat") ;
load("3d_dose data.mat") ;
[X,Y,Z] = ndgrid(x,y,z) ;
D = permute(dose_3d,[2 1 3]) ;
% extract data
[xslice,yslice] = meshgrid(x) ;
yslice = 3*ones(size(xslice)) ;
zslice = zeros(size(xslice)) ;
slice(X,Y,Z,D,xslice,yslice,zslice)
Play around with that.
0 Comments
See Also
Categories
Find more on 2-D and 3-D Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!