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

Arnaud GELAS arnaud_gelas at hms.harvard.edu
Mon Dec 13 11:04:39 EST 2010


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>  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>  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
>>>
>>> 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
>>>
>
>



More information about the Insight-users mailing list