[Insight-users] creating a 3D image using ITK
Xavier Mellado Esteban
xme at unizar.es
Fri May 23 06:01:19 EDT 2008
Hello,
What kind of image? I mean, do you want to create a 3D image with
intensity (integer) values, or with the objects represented as
implicit surfaces (float values)?
The second case it sounds strange to me. The first one can be done
more or less like this:
1) Define the image size, spacing and origin. Allocate it. Use
FillBuffer to set every pixel to zero.
2) Define the spheres center (in world coordinates, or image coordinates).
3) Iterate over the voxels. For each voxel:
3.1) Get the voxel center (if the spheres center is defined in
world coordinates, transform voxel center image coordinates in world
coordinates).
3.2) Compute the distance to the spheres center. If:
3.2.1) It is within the first sphere set it to 1.
3.2.2) It is outside the first sphere, but within the
second set it to 2.
3.2.3) It is outside both spheres, nothing done.
I hope this helps you. Use the ITK user's guide pdf to locate some
helpful examples about how to create an image and work with coordinates.
Regards:
Xavi
shaza zaghlool <babygirl_25 at hotmail.com> ha escrito:
>
>
> I want to create a 3D image composed of 2 spheres (one inside the
> other) that can be displayed with SNAP in ITK. Can someone help?
>
>
>
>
>
>
> _________________________________________________________________
> Explore the seven wonders of the world
> http://search.msn.com/results.aspx?q=7+wonders+world&mkt=en-US&form=QBRE
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>
More information about the Insight-users
mailing list