[Insight-users] MeshToImageFilter ???

Julien Jomier jjomier at cs.unc.edu
Fri Jun 11 09:31:09 EDT 2004


Hi Jean-Baptiste,

I've implemented the IsInside() function for the itkMeshSpatialObject but
only for TetrahedronCell. You can update the code via cvs. What type of cell
are you using?

Now, you can do something like this:

  typedef itk::MeshSpatialObject<MeshType>  MeshSpatialObjectType;
  MeshSpatialObjectType::Pointer myMeshSpatialObject=
MeshSpatialObjectType::New();
  myMeshSpatialObject->SetMesh(myMesh);

  typedef itk::Image<float,3> ImageType;
  typedef itk::ImageFileWriter<ImageType> WriterType;
  typedef itk::SpatialObjectToImageFilter<MeshSpatialObjectType,ImageType>
FilterType;

  FilterType::Pointer filter = FilterType::New();
  filter->SetInput(myMeshSpatialObject);
  filter->Update();
  
  WriterType::Pointer writer = WriterType::New();
  writer->SetInput(filter->GetOutput());
  writer->SetFileName("e:/mymesh.mha");
  writer->Update();

Let me know if you have any problem.

best regards,

Julien

> -----Original Message-----
> From: insight-users-bounces at itk.org 
> [mailto:insight-users-bounces at itk.org] On Behalf Of Julien Jomier
> Sent: Wednesday, June 09, 2004 3:22 PM
> To: 'Jean-Baptiste Fasquel'; insight-users at itk.org
> Subject: RE: [Insight-users] MeshToImageFilter ???
> 
> 
> Hi Jean-Baptiste,
> 
> It should be possible to use the itkMeshSpatialObject 
> combined with the
> SpatialObjectToImageFilter.
> However, this is not working with the current implementation of the
> itkMeshSpatialObject class and need some work.
> 
> I've just added this as a bug in the bug tracker (www.itk.org/Bug):
> Bug #919 - itkMeshSpatialObject : IsInside() not implemented 
> 
> I'll take a look as soon as I can and let you know,
> 
> Julien
> 
> > -----Original Message-----
> > From: insight-users-bounces at itk.org 
> > [mailto:insight-users-bounces at itk.org] On Behalf Of 
> > Jean-Baptiste Fasquel
> > Sent: Wednesday, June 09, 2004 11:06 AM
> > To: insight-users at itk.org
> > Subject: [Insight-users] MeshToImageFilter ???
> > 
> > 
> > Hi,
> > I am trying to use deformable models : this involves the use of a
> > mesh...
> > there is a "ImageToMeshFilter" enabling to create a mesh from
> > a binary image but there is no filter such "MeshToImageFilter" for
> > getting back an image from a mesh (corresponding to the output
> > of the deformable models based segmentation algorithm in my case)...
> > 
> > Is there a way to achieve that with current ITK filters ?
> > Does anybody have a already implemented such "converter" ?
> > I thank anybody who could help me...
> > 
> > Best regards,
> > Jean-Baptiste Fasquel
> > 
> > -- 
> > 
> ----------------------------------------------------------------------
> >  Dr. Jean-Baptiste Fasquel    || 
> > Jean-Baptiste.Fasquel at ircad.u-strasbg.fr 
> >  Image Processing Researcher  || http://www.virtual-surg.com/
> >  IRCAD/EITS/VIRTUALS          || http://www.ircad.com/
> >  1, Place de l'Hôpital        || Phone : +33 (0)3.88.11.90.79
> >  F67091 Strasbourg            || Fax   : +33 (0)3.88.11.90.99
> > 
> ----------------------------------------------------------------------
> > 
> > _______________________________________________
> > Insight-users mailing list
> > Insight-users at itk.org
> > http://www.itk.org/mailman/listinfo/insight-users
> > 
> 
> _______________________________________________
> 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