Page MenuHomePhabricator

Can't use MeshUtil<MeshType>::MeshFromPolyData
Closed, WontfixPublic


Ok, this is possibly not a bug, maybe I just don't know how to use it. Sorry if it's the case.

I want to use some vtk tools on a mitk::Mesh, so I call MeshToPolyData on my mesh to get a vtkPolyData. This works (or at least compiles). When I try to cast it back to mitk::Mesh with MeshFromPolyData, it doesn't compile. I tried searching for examples in your code base, but you don't use this class and there's no test.

Here's the minimal code:

typedef mitk::PointSet::MeshType MeshType;
vtkPolyData *polyData = MeshUtil<MeshType>::MeshToPolyData(
// Do stuff with polydata
MeshType::Pointer mesh = MeshUtil<MeshType>::MeshFromPolyData(polyData);

The error are on lines 804-805 in "mitkMeshUtil.h", something about

  • Can't cast 'TriCellPointer' to 'itk::AutoPointer<TObjectType> &'
  • Can't cast 'int' to 'mitk::PointSet::PointDataType'

Event Timeline

kislinsk updated the task description. (Show Details)

You can delete this task of you want. We don't need it anymore, I don't even know why we needed it and maybe it has been randomly fixed in the last 5 years.

kislinsk added a project: Auto-closed.
kislinsk added a subscriber: kislinsk.

Hi there! ๐Ÿ™‚

This task was auto-closed according to our Task Lifecycle Management.
Please follow this link for more information and don't forget that you are encouraged to reasonable re-open tasks to revive them. ๐Ÿš‘

Best wishes,
The MITK devs