[Insight-users] Copy Mesh Points and Cells to QuadEdgeMesh using MeshToMeshFilter

Arnaud GELAS arnaud_gelas at hms.harvard.edu
Mon Dec 13 11:21:43 EST 2010


Hi Stefan,

You can have a look at the test for Normal Filter located in 
Testing/Code/Review/itkQuadEdgeMeshNormalFilterTest.cxx (if you use ITK 
3.20)
or Testing/Code/Algorithm/itkQuadEdgeMeshNormalFilterTest.cxx (if you 
use the git version).

I think it would be useful to make an example on the wiki (similar to 
the link I sent you before). It would benefit to everyone!

HTH,
Arnaud

On 12/13/2010 11:19 AM, Stefan Dänzer wrote:
> Hi Arnaud,
>
> thanks for your reply. I used the QuadEdgeMeshNormalFilter to generate 
> the input mesh. Maybe I'm misinterpreting the documentation of the 
> normal filter, but doesn't this filter need a vector type as template 
> parameter? See (in the description, section "todo: 
> http://www.itk.org/Doxygen/html/classitk_1_1QuadEdgeMeshNormalFilter.html
>
> stefan
>
> On Mon, Dec 13, 2010 at 5:04 PM, Arnaud GELAS 
> <arnaud_gelas at hms.harvard.edu <mailto:arnaud_gelas at hms.harvard.edu>> 
> wrote:
> > Hi Stefan,
> >
> > The first template argument is used to define the type of the point's
> > coordinate (a concept checking may be missing here?).
> > In your case, I guess it would be double instead of itk::Vector< 
> double, 3
> >>.
> >
> > Here, you can find an example of one special
> > QuadEdgeMeshToQuadEdgeMeshFilter (for decimation purpose),
> >
> > http://www.itk.org/Wiki/ITK/Examples/Meshes/Decimation
> >
> > Best,
> > Arnaud
> >
> > On 12/13/2010 10:40 AM, Stefan Dänzer wrote:
> >>
> >> Hi Luis,
> >>
> >> thanks for your reply. I have tried to use the
> >> itkQuadEdgeMeshToQuadEdgeMeshFilter already. The output is a a
> >> QuadEdgeMesh with no points and no faces. I'm working on itk 3.20 at
> >> the moment. This is how I use the filter in my code right now:
> >>
> >> typedef itk::QuadEdgeMesh<itk::Vector<double,3>, 3>
> >>  meshType;
> >>
> >> typedef itk::QuadEdgeMeshToQuadEdgeMeshFilter<meshType, meshType>
> >> qeToQeFilterType;
> >>
> >> qeToQeFilterType::Pointer qeToQeFilter = qeToQeFilterType::New();
> >>
> >> qeToQeFilter->SetInput(meanShapeQe);
> >> qeToQeFilter->Update();
> >>
> >> meshType::Pointer currentShape = qeToQeFilter->GetOutput();
> >>
> >> Might the problem be that I use a non scalar PointType
> >> (itk::Vector<double,3>) ?
> >>
> >> stefan
> >>
> >> On Fri, Dec 10, 2010 at 1:56 PM, Luis 
> Ibanez<luis.ibanez at kitware.com <mailto:luis.ibanez at kitware.com>>
> >>  wrote:
> >>>
> >>> Hi Stefan,
> >>>
> >>> the itkMeshToMeshFilter is an abstract class
> >>> that only serves as base class for other filters.
> >>>
> >>> See the inheritance diagram in:
> >>> http://www.itk.org/Doxygen/html/classitk_1_1MeshToMeshFilter.html
> >>>
> >>> You may want to try
> >>>
> >>> itkQuadEdgeMeshToQuadEdgeMeshFilter.txx
> >>>
> >>> 
> http://www.itk.org/Doxygen/html/classitk_1_1QuadEdgeMeshToQuadEdgeMeshFilter.html
> >>>
> >>> and to use an itkQuadEdgeMesh type for the
> >>> reader that gets the input mesh from the .meta
> >>> file.
> >>>
> >>>
> >>>     Regards,
> >>>
> >>>
> >>>        Luis
> >>>
> >>>
> >>> ----------------------------------------------------------------
> >>> On Thu, Dec 2, 2010 at 9:36 PM, Stefan 
> Dänzer<stefan.daenzer at gmail.com <mailto:stefan.daenzer at gmail.com>>
> >>>  wrote:
> >>>>
> >>>> Hi,
> >>>> I'm trying to read an itk::Mesh from a .meta file and copy the points
> >>>> and cells of this itk::Mesh to a itk::QuadEdgeMesh. My first approach
> >>>> was to use itk::MeshToMeshFilter to achive this. The problem is that
> >>>> the output mesh is empty after running the filter. Here is a part of
> >>>> my code:
> >>>>
> >>>> itk::MetaMeshConverter<3,double>* metaConv = new
> >>>> itk::MetaMeshConverter<3,double>;
> >>>> itk::MetaMeshConverter<3,double>::SpatialObjectPointer meshSO =
> >>>> metaConv->ReadMeta(inFilename.c_str());
> >>>>
> >>>> // get the itk::mesh
> >>>> typedef itk::QuadEdgeMesh<double, 3>  qeMeshType;
> >>>> typedef itk::MeshToMeshFilter<MeshType, qeMeshType>  qeFilterType;
> >>>>
> >>>> qeMeshType::Pointer qeMesh;
> >>>> qeFilterType::Pointer qeFilter = qeFilterType::New();
> >>>> qeFilter->SetInput(mesh);
> >>>> qeFilter->Update();
> >>>> qeMesh = qeFilter->GetOutput();
> >>>>
> >>>> Am I missing something? Thanks for any advice.
> >>>>
> >>>> Stefan
> >>>> _____________________________________
> >>>> Powered by www.kitware.com <http://www.kitware.com>
> >>>>
> >>>> Visit other Kitware open-source projects at
> >>>> http://www.kitware.com/opensource/opensource.html
> >>>>
> >>>> Kitware offers ITK Training Courses, for more information visit:
> >>>> http://www.kitware.com/products/protraining.html
> >>>>
> >>>> Please keep messages on-topic and check the ITK FAQ at:
> >>>> http://www.itk.org/Wiki/ITK_FAQ
> >>>>
> >>>> Follow this link to subscribe/unsubscribe:
> >>>> http://www.itk.org/mailman/listinfo/insight-users
> >>>>
> >>
> >>
> >
> >
>
>
>
> -- 
> --
> Stefan Daenzer
> Körnerplatz 8
> 04107 Leipzig
>
> Tel.: +49-157-84993879
>
> "Work like you don't need the money, love like you've never been hurt 
> and dance like no one is watching." - Randall G Leighton
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20101213/d83a488f/attachment.htm>


More information about the Insight-users mailing list