Dear Matt, thanks for your response, and for the detailed explication: that would probably be enough to keep me busy for the next weeks :)
I'll keep the list updated on the progresses Best, Mario On 6 November 2015 at 08:29, Clarkson, Matt <m.clark...@ucl.ac.uk> wrote: > Hi there, > > we did this by: > a) Derive a mapper class from mitk::VtkMapper > b) Implement a VTK pipeline inside the mapper. We basically created 4 > corner points, with their points, normals and texture coordinates > represented at vtkFloatArray. > c) These points are used to create a vtkCellArray containing 1 > rectangle, and a vtkPolyData with 1 cell. > d) The actor should probably have: SetInterpolationToFlat(), > SetLighting(false), or else the shading changes as the plane becomes more > oblique to the lighting source. > e) Then at each call of the GenerateDataForRenderer you directly update > the 4 points and normals using the geometry of the mitk::Image. > f) You will find a pattern in the MITK codebase whereby an ObjectFactory > registers Mappers to Data. We did not use this, as each new image would get > a new mapper. > g) Instead we have a plugin whereby the user selects an image and a > transform, and the plugin creates the mapper, and associates it with the > image. As soon as the tracking data changes and the RenderingManager is > updating, the image moves. > > This can also be combined with rendering another live video in the > background, all at acceptable (10-20 fps) frame rates. > > I hope that helps. > > Regards, > > Matt > > > > On 5 Nov 2015, at 18:28, Ceresa, Mario <mario.cer...@upf.edu> wrote: > > > > Dear MITK users, > > I would like to show a video on an arbitrary plane (in order to > subsequently move it with NavigationData for a colonoscopy application). > > > > I tried: > > * Using the videoplayer example plugin (BTW it is currently broken on my > local MITK git copy dated Oct 10). It shows the video, but in the > background, so I cannot move it. > > * Using the video source as an image. It does show the video, but when I > move the plane it reslices it as if it were a volume image. That is not > what I want, I'd like to move the plane freely around and have the video > played on that > > * Using a plane with a mapper. I could move the plane freely but I > wasn't able to find a mapper that I can use to change its texture to the > one provided by opencv video source. There is a lot of fragmented > information dating back to 2008 with incomplete solutions on how to go this > way. I've spent a couple of days trying them but they don't work or the > mapper classes they refer to have disappeared. > > > > My next step would be to see how this is done in basic vtk and try to > extend a mapper accordingly, but maybe this is overkill. > > > > Does anybody has any idea on how to go further? > > > > With best regards, > > > > Mario Ceresa > > > > > ------------------------------------------------------------------------------ > > _______________________________________________ > > mitk-users mailing list > > mitk-users@lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/mitk-users > > -- Mario Ceresa, PhD Ing. SIMBioSys group Universidad Pompeu Fabra 55.107 - DTIC Building c/Roc Boronat, 138 08018 Barcelona Web: http://simbiosys.upf.edu/ Ln: <http://es.linkedin.com/in/>http://es.linkedin.com/in/marioceresa Tel.: (+34) 93 542 13 48 Fax: (+34) 93 542 25 17
------------------------------------------------------------------------------
_______________________________________________ mitk-users mailing list mitk-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mitk-users