[ITK-dev] Create PolygonToMeshFilter

Matt McCormick matt.mccormick at kitware.com
Thu Aug 28 22:35:03 EDT 2014


Hi Ignacio,

The default implementation of GenerateOutputInformation() in
itk::ProcessObject is to call ::CopyInformation() on all the pipeline
objects from the input to the output DataObjects.  The information
that is copied for itk::PointSet / itk::Mesh is related to Region's
(see their implementations of ::CopyInformation()).  You may write a
GenerateOutputInformation() that sets these regions, or you could
leave the default values given in the constructors, which is what the
SpatialObjectToPointSetFilter does.

Hope this helps,
Matt

On Tue, Aug 26, 2014 at 11:56 AM, Jose Ignacio Prieto
<joseignacio.prieto at gmail.com> wrote:
> I solved it partially but don't know why it works. I just set
> GenerateOutputInformation(){} on my .h file as it is done on
> itkSpatialObjecToPointSetFilter so it goes straight to
> GenerateInputRequestedRegion.
>
>
>
> On Tue, Aug 26, 2014 at 11:35 AM, Jose Ignacio Prieto
> <joseignacio.prieto at gmail.com> wrote:
>>
>> Hi all,
>> I am trying to create a filter that receives many 2D polygons in the form
>> of PolyLineParametricPath (which in turn has an itkImage as input) and
>> returns an itkMesh for later visualization. I have completed the
>> GenerateData() method by calling internally to
>> itkAutomaticTopologyMeshSource. The problem seems to be that before
>> GenerateData, the filter fails in itkPointSet::CopyInformation (because it
>> tries to cast the polygon as a mesh). I discovered that the call stack comes
>> from UpdateOutputInformation on my PolygonToMeshFilter and then
>> GenerateOutputInformation, then itkMesh::CopyInformation and
>> itkPointset::CopyInformation.
>> I think I should edit my PolygonToMesh::GenerateOutputInformation() but I
>> don't know how. Inside it I just called
>> Superclass::GenerateOutputInformation.
>> My filter PolygonToMeshFilter is a copy of MeshToMesh filter and inherits
>> from MeshSource. Maybe I should inherit from anothe filter.
>> Thank you very much
>>
>> Ignacio Prieto
>>
>> --
>> Ignacio Prieto
>> Research Assistant
>> Biomedical Imaging Center
>> Pontificia Universidad Catolica de Chile
>
>
>
>
> --
> José Ignacio Prieto
> celular(nuevo): 94348182
>
> _______________________________________________
> 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.php
>
> 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://public.kitware.com/mailman/listinfo/insight-developers
>


More information about the Insight-developers mailing list