|
The mesh and polydata work now. Here's
an explanation for the next readers who might have the same
problem. I thought that the parameter onlyTriangles
of MeshUtil<MeshType>::MeshToPolyData
would transform my polygon mesh into a triangle-only polydata, but
it appears that it always returns an empty polydata. The polydata
is not empty when onlyTriangles
is set to false.
However, it's still not enough to use with vtkSmoothPolyDataFilter or vtkMassProperties
because some (or all) cells are of type VTK_TRIANGLE_STRIPS
and they need to be of type VTK_TRIANGLE.
Using the vtkTriangleFilter class
solves this problem.
However, it's still not enough to use with vtkMassProperties. The order in which the line are
added in the mesh is important and since I don't really know the
good order (is it explained somewhere?), I used the vtkPolyDataNormals class with AutoOrientNormals on.
So, this leaves the two same questions, as in the
last message.
- I still have the "Move some points" problem, which you can read
below in the older message.
Can I have a working example of a cast from polyData ->
mitk::Mesh using MeshUtil<MeshType>::MeshFromPolyData?
Again, thanks for your time.
Le 2013-04-16 09:31, Nil Goyette a écrit :
Just an update so nobody answer parts
of my questions for nothing. I found a vtk class called
vtkMassProperties which can calculate the volume, but I can't
get to use it.
I built a 1x1x1 cube mitk::Mesh just to test. I can see it on
the screen, it seems perfect. I used
MeshUtil<MeshType>::MeshToPolyData to cast my mitk::Mesh
to a vtkPolyData and it runs without any error message. When I
try to use vtkSmoothPolyDataFilter or vtkMassProperties though,
it prints "No data to smooth!" and "No data to measure...!".
Moreover, I also have a problem to cast from vtkPolyData to
mitk::Mesh. I opened a bug in this http://bugs.mitk.org/show_bug.cgi?id=14956
on this subject because I can't get any MeshType to work and
there's no example anywhere.
So, here's a tl;dr :)
- I still have the "Move some points" problem, which you can
read below in the older message.
- Can I have a working example of a mitk::Mesh -> polyData
-> mitk::Mesh?
Thanks for your time!
Le 2013-04-12 11:10, Nil Goyette a écrit :
Hi, I answered the first question
myself. I thought that "m_Mesh->GetNewCellId();" was
creating the cell, but it appears that we must also use a
OpNEWCELL operation to actually create a cell. I now have a
wireframe, as I wanted. My second question is still valid
though.
Move some points
Looking at the code and documentation, I found
MouseMovePointSetInteractor which probably do what I want to
do. However, when I try to use it, it prints these errors:
8.00 core.ia.statemachineFac ERROR: Error in
StateMachineFactory: StartState for pattern
"MouseMovePointSetInteractor"not found! StateMachine might not
work!
8.01 core.ia.statemachine FATAL: [type:
MouseMovePointSetInteractor] Fatal Error in
mitkStateMachine.cpp: Initialization of statemachine
unsuccessfull! Initialize GlobalInteraction!
So I add
mitk::GlobalInteraction::GetInstance()->Initialize("wathever");
and it prints "7.99 core.ia.globalinteraction WARNING: Global
Interaction has already been initialized."
How am I supposed to use this interactor?
Calculate the volume.
No news on that. I'm still unsure about what class to use. Can
you please tell me what would be the mitk way to calculate the
volume of a mesh?
Le 2013-04-09 18:10, Nil Goyette a écrit :
Hi, I've been playing with mitk::Mesh after collecting a set
of points near the pericardium (still need to work on that!).
You can see the results here : http://i.imgur.com/Wrusa3b.jpg.
I think I got it right (setting points to positions, asking
for a new cell, adding lines using positions, repeat.), but
I'm not sure about some things :
- Is there a way to see the mesh in a practical manner?
Like a "3d mesh" on google image. I tried changing the
properties using the Property List, but only "visible" and
"name" actually change something. A good visualization
will help me ensure that the mesh is well built.
- It will be important for us to a) move some points
using the viewer and b) calculate the volume of
the heart. Will it be possible with mitk::Mesh? If not,
can you please recommend other classes which would help
us?
Thanks
|
------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users