Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] CGALimageIO supports more formats to load origin information

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] CGALimageIO supports more formats to load origin information


Chronological Thread 
  • From: Laurent Rineau <>
  • To:
  • Subject: Re: [cgal-discuss] CGALimageIO supports more formats to load origin information
  • Date: Wed, 7 May 2008 11:20:22 +0200
  • Organization: Inria, Sophia Antipolis, FRANCE

On Wednesday 07 May 2008 10:51:49 Mengda Wu wrote:
> Hi all,
>
> I have been using Analyze format of CGALimageIO to generate surface
> mesh from. But I found the Analyze format
> does not support origin information. So CGALimageIO seems to assume the
> origin is located [0,0,0], which is incorrect
> for most cases because the coordinates for all vertices are shifted.

You are right. CGALimageIO has no real support for offsets. If you look in
the
src/CGALimageIO/imageio/ImageIO.h file, you can see that the "point_image"
struct has three fields tx, ty, tz for that use, but almost no CGALimageIO
functions ever use them.

> I am wondering if CGAL can support more image formats, such as MetaImage
> format (http://www.itk.org/Wiki/MetaIO) which
> has origin information. BTW, ITK (http://www.itk.org) has readers for
> nearly all ordinary formats.

I plan to allow the use of ITK instead of CGALimageIO, in the future. It is
quite easy to load an image with ITK classes, retrieve the void* pointer in
the ITK objects, use it as the "data" field of a point_image struct, and fill
the other fields of the point_image struct. That allows to use classes of
ITK, and use the result with the Surface_mesher package without changing its
code.

Actually, the surface mesh generator in CGAL do not really depend on
CGALimageIO. Only the class template CGAL::Gray_level_image_3<FT,Point> does
depend on it. If you want to use ITK classes to read image files, you can
implement a new model of the concept ImplicitFunction that directly uses the
ITK classes. ITK even has images filters, and interpolations methods.

--
Laurent Rineau
INRIA - Sophia Antipolis
BP 93, 2004 Route des Lucioles
06902 Sophia Antipolis Cedex FRANCE
Tel: +33 4 92 38 78 62 (Fax: +33.4.97.15.53.95)




Archive powered by MHonArc 2.6.16.

Top of Page