Here is an example of how to do this using that cartesian coordinate equation juggled around and then modifying the example for a sphere in 3dcalc's help.
c = z-radius of the spindle-shaped ellipsoid/symmetrical egg
a = xy-radius of the egg
let a=10, c=20
a^2=100, c^2=400, a^2c^2=40000
# make prolate spheroid with 3dcalc
set dset = MP3d_anat+orig
# note xyz defined by RAI coordinates
# xy radius
set a = 10
# z radius
set c = 20
# set the center
set xc = 10
set yc = 20
set zc = -30
# these lines make it a bit easier to read below and faster
# if you have to do lots of these
set a2 = `ccalc -expr "$a^2"`
set c2 = `ccalc -expr "$c^2"`
set a2c2 = `ccalc -expr "$a2*$c2"`
# generate 3D volume
3dcalc -a $dset -RAI -expr "step($a2c2-$c2*((x-$xc)^2+(y-$yc)^2)-$a2*(z-$zc)^2)" -prefix prolate1 -overwrite
Then you can render this
suma -vol prolate1+orig.
Edited 1 time(s). Last edit at 01/10/2019 08:33PM by Daniel Glen.
Attachments:
open |
download -
prolate_spheroid.png
(31.2 KB)