Hi Nil,

this is definitely a feature request. I have not seen something like this in 
MITK, although it would be nice to have.

As you already found out, the PointSetInteractor does the job for PointSets. In 
my opinion, the only tough part is to implement point picking on a surface. I 
have never done anything with picking before. You could check VTK if there is 
any interaction method to select a point on a vtkPolydata. All you need is the 
Id of the point you want to modify. Then you could use the arrow-keys/mouse to 
move your point according to the users input. Examples should be in the 
PointSetInteractor and the MoveBaseDataInteractor. After the polydata/point is 
modified you can it transfer to our mitkSurface via SetVtkPolyData. Hope that 
helps. Let me know if you manage to implement this and if you would like to 
contribute it to MITK.

Regards,
Thomas

Thomas Kilgus
German Cancer Research Center (DKFZ)
Div. Medical and Biological Informatics
Junior group: Computer-assisted Interventions (E131)
Im Neuenheimer Feld 280
69120 Heidelberg, Germany
Phone: +49(0) 6221-42-3545

From: Nil Goyette [mailto:[email protected]]
Sent: Dienstag, 11. Juni 2013 20:27
To: [email protected]
Subject: Re: [mitk-users] Mesh, moving points and volume

Hi mitk's users,

Nearly two months have past since my last request for help. I know you are all 
busy, but here's an update anyway, in the hope that someone might have a few 
minutes to help me.

I had time in the last days to search further into my "Move some points" 
problem. Here's some details. I build the mesh of a heart and it works quite 
well.  To do so, I use three objects : vtkPolyData mitk::Mesh and 
mitk::Surface. My goal would be to let the user modify the mesh/surface by 
moving points with his mouse. Surprisingly, I can't find anything to do it in 
mitk. I thought it was a frequent job.  As for now, I found:
- nothing with vtkPolyData because there's probably no interactor for vtk stuff 
:)
- mitk::PointSet with a PointSetInteractor using type 
"onlymovepointsetinteractor" works perfectly, but ONLY with a mitk::PointSet. 
Even if mitk::Mesh is a subclass of mitk::PointSet, it doesn't work, probably 
because of the "dynamic_cast<mitk::PointSet*>(m_DataNode->GetData());" in 
PointSetInteractor::CanHandleEvent in mitkPointSetInteractor.cpp.
- mitk::Surface with a SurfaceInteractor using type "AffineInteractor3D" which 
would work like your Clipping Plane plugin. I would probably be able to modify 
my surface with it, but it only works in the 3D view and it's too coarse, I 
can't target a single point. So, it's probably not the good tool for us.

In the end, the only working solution I found is to use a mitk::PointSet, but I 
don't want to copy my points, let the user change some, click update and then 
let the user see the modification on the mesh. I want to let him move points 
(or cells) directly on the mesh/surface.

So, does anyone know how to move points/cells on a mesh/surface? Do I need to 
code my own interactor? Thanks for your time.

Le 2013-04-17 16:52, Nil Goyette a écrit :
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.
[cid:[email protected]]<http://imeka.ca/>

Nil Goyette, M.Sc.
www.imeka.ca<http://imeka.ca/>




<<inline: image001.png>>

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to