[Insight-developers] Copy input to Output Mesh

Alexandre GOUAILLARD agouaillard at gmail.com
Mon Nov 23 13:01:02 EST 2009


hi michael, michel, luis and eveybody,

michael, welcome to ITK. Do not hesitate to ask questions around,
we're friendly :-) We've all been there.

There is a bug in ITK, or more likely an open issue since 2005
(http://public.kitware.com/pipermail/insight-users/2005-March/012459.html):
even though MeshToMeshFilter takes a different inputMeshTYpe and
OutputMesh types, if the types are different, it just does not work.
Specifically, the point types are very sensitive. Let me give you an
example: say you surcharge the trait to add curvature where it
belongs: gaussian curvature on the point, and the mean curvature on
the edges, you wouldn't be able to make a curvature filter which takes
in input a default mesh and in output that kind of mesh. Jim suggest a
good but difficult solution, unfortunately, I never had time to test
it ... shame on me.

My understanding is that you're working on 2-manifolds only. In which
case you might want to work with QuadEdgeMesh directly. It's not
perfect (construction and copy costs are still high) but it's
dedicated to 2-manifolds, has euler operators and as arnaud told you
we already did some work on it and would be very close to a beltrami
operator. Finally, there is a suitable
itkQuadEdgeMeshToQuadEdgeMeshFIlter, which includes by default a copy
of the input to the output and should be the base of the kind of
filter you are trying to code. In this regard it is better than the
itkMeshToMeshFilter.

Luis, jim, michel, bill, (dan? Arnaud?),
shall we address this type casting problem and fix it, one way or
another in itkMeshToMeshFilter? I think this is required. I will be at
the NAMIC week in SLC in Jan, and that could be my project (my hands
are free so far) but I would need some expertise here. Michel, will
you be there?
I suggest two behaviors:
- the user knows what he is doing, we provide a copy operator that try
to cast inputMeshType into outputMeshType that the user will have to
call first in ExecuteData. We throw an exception if the cast fails. I
remember jim mentioning that there was a mechanism with the images to
handle that in a nicer way, I can only whish I could remember what it
was :-)
- The user create the output in the filter
the question is what is the default behavior of the MeshToMeshFilter
(and of GetOutput() when output does not exists )). Any idea?

cheers,

alex.

On Mon, Nov 23, 2009 at 6:14 PM, Michel Audette
<michel.audette at kitware.com> wrote:
> Hi Michael,
>
> let me know if that works for you. I was aware of prior discussions on how
> to copy components of the mesh, and I was not aware of the history as to why
> there was no single function, so I was not able to make a useful
> contribution.
>
> In general, it's not a bad thing to copy to Insight Developers the way Luis
> has. Others, such as ITK contributors with particular expertise on these
> meshes, like Alexandre Gouillard and his collaborators, can chime in and
> make useful suggestions. I recognize that it's a public exercise in
> humility, and believe me, I empathize with this aspect of the learning
> curve, since I'm a fairly recent convert to ITK.
>
> Best wishes,
>
> Michel
>
> On Sun, Nov 22, 2009 at 2:58 PM, Luis Ibanez <luis.ibanez at kitware.com>
> wrote:
>>
>> Hi Michael,
>>
>> Yes, it will make sense to move (at least part) of the Copy method
>> up to the MeshToMeshFilter class.
>>
>> Note that he basic methods that copy parts of the mesh were already
>> there:
>>
>>  void CopyInputMeshToOutputMeshPoints();
>>  void CopyInputMeshToOutputMeshPointData();
>>  void CopyInputMeshToOutputMeshCellLinks();
>>  void CopyInputMeshToOutputMeshCells();
>>  void CopyInputMeshToOutputMeshCellData();
>>
>>
>> The reason why a full CopyInputMeshToOutputMesh() method
>> can't be added directly up there is that in some cases the types
>> of the InputMesh and OutputMesh are not compatible.
>>
>> In the LaplaceBeltrami filter, you may be in a case where
>> the types are compatible and therefore you can call the
>> methods listed above as building-blocks of what a
>> CopyInputMeshToOutputMesh() method could be.
>>
>>
>> Please give it a try at using the method above
>> and let us know if you find any problem.
>>
>>
>>    Thanks
>>
>>
>>     Luis
>>
>>
>> -----------------------------------------------
>> On Fri, Nov 20, 2009 at 1:54 PM, Michael Bowers <mbowers at cis.jhu.edu>
>> wrote:
>> >
>> >
>> > Luis,
>> >
>> >
>> >
>> > I found CopyInputMeshToOutputMesh in QuadEdgeMeshToQuadEdgeMeshFilter.
>> > The
>> > Laplace Beltrami filter is MeshToMeshFilter, so I don’t think I have the
>> > Copy function.  It seems like a useful thing to have in any mesh-to-mesh
>> > filter.  Is there any possibility for pushing it into the Base Class or
>> > do I
>> > need to implement it for the Laplace Beltrami filter?
>> >
>> >
>> >
>> > Thanks,
>> >
>> >
>> >
>> > Mike B.
>> >
>> >
>> >
>> >
>
>
>
> --
> Michel Audette, Ph.D.
> R & D Engineer,
> Kitware Inc.,
> Chapel Hill, N.C.
>
>
> _______________________________________________
> Powered by 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://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-developers
>
>


More information about the Insight-developers mailing list