How to: Make a volume using OsgVolume
Create a script as below substituting .tif for the image type you are using ie: .jpg .png etc. Currently there is a maximum of 256 images/slices supported.
To create the script open a new document in BBedit and paste the following text into it
#!/bin/sh
osgvolume --images *.tif --num-components 1 --r_maxTextureSize 512 -n --zMultiplier -1.0 -o volume.ive
echo make volume complete
exit 0
and save it into the directory where your image files are, with a name like:
make_volume
then change permissions of the file - use terminal and go to the directory and do:
Now if you type :
this will create a file called volume.ive
You can also do part volumes by using the following and changing the **** part:
Other options
for help :
osgvolume --help
Usage: osgvolume [options] filename ...
Options:
-h or --help Display this information
-s <numSlices> Number of slices to create.
-n Create normal map for per voxel lighting.
--clip <ratio> clip volume as a ratio, 0.0 clip all, 1.0 clip none.
--compressed Enable the usage of compressed textures.
--compressed-arb Enable the usage of OpenGL ARB compressed textures.
--compressed-dxt1 Enable the usage of S3TC DXT1 compressed textures.
--compressed-dxt3 Enable the usage of S3TC DXT3 compressed textures.
--compressed-dxt5 Enable the usage of S3TC DXT5 compressed textures.
--images [filenames] Specify a stack of 2d images to build the 3d volume from.
--maxTextureSize <size> Set the texture maximum resolution in the s,t,r (x,y,z) dimensions.
--num-components <num> Set the number of components to in he target image.
--r_maxTextureSize <size> Set the texture maximum resolution in the r (z) dimension.
--s_maxTextureSize <size> Set the texture maximum resolution in the s (x) dimension.
--t_maxTextureSize <size> Set the texture maximum resolution in the t (y) dimension.
--modulate-alpha-by-luminance For each pixel multiply the alpha value by the luminance.
--replace-alpha-with-luminance For each pixel m Set the alpha value to the luminance.
--shader Use OpenGL Shading Language.
--xMultiplier <multiplier> Tex coord x mulitplier.
--yMultiplier <multiplier> Tex coord y mulitplier.
--zMultiplier <multiplier> Tex coord z mulitplier.
--xSize <size> Relative width of rendered brick.
--ySize <size> Relative length of rendered brick.
--zSize <size> Relative height of rendered brick.
____
Using in Present3D
You can load and view the resulting volume either by creating a P3D xml file with your volume and other data or just by using present3D on the command line, so type :
and this will load your volume. You can now use the the u, i and k keys along with mouse movement, to interact with the volume, try it :-)
Comments (0)
You don't have permission to comment on this page.