[IGSTK-Users] Display the video signal from MicronTracker

"Özgür Güler" ozgur_guler at gmx.at
Tue Mar 24 18:52:06 EDT 2009


Hi folks,

regarding the "VideoComponent" try following steps to display video with IGSTK. I have written example apps (VideoFrameGrabberAndViewer,..) for devices using Compressed DV like conventional camcorders or Endoscopes/Bronchoscopes. I will also commit the same application for raw video data with the ImagingSource FrameGrabber. 
Below you will find two approaches to experiment with the VideoComponent. 
If you know how to get RGB frames from your specific device then go to "The fastest way" and try it out. After that you can go to "The reasonable way" and implement step by step your own device specific classes (derived from Imager and ImagerTool).

Let me know about your problems doing this (if any :-))


The fastest way:
-----------------
-----------------
Use the example VideoFrameGrabberAndViewer in IGSTKSandbox examples
(rename nothing)

Make only changes here:
/Source/igstkCompressedDVImager.h (if necessary for new variables and functions for video device specific implementation)

In "/Source/igstkCompressedDVImager.cxx" the most important line is this 

memcpy(frame.GetImagePtr(),(unsigned char*)CompressedDVImager::frameBuffer,720 * 576 * 3);

in the function "InternalThreadedUpdateStatus( void )"
This function communicates continuously with the video device in a seperate thread.
What you have to do is, get a RGB image from your device (device specific) and copy it with memcpy into frame.GetImagePtr() as above.

You can use these functions  
InternalOpen()
Initialize()
InternalClose()
InternalStart()
InternalStop()
InternalReset()
to open,init,close,start,stop and reset your specific video device

Then you are done. 

Run the application "VideoFrameGrabberAndViewer"
After enable and run video you should see your video stream in IGSTK



The reasonable way:
-------------------
-------------------
Build your own specific classes for your video device deriving from igstk::Imager and igstk::ImagerTool

If you use the device FOO then you can name the classes like this 
/Source/igstkFOOImager.cxx
/Source/igstkFOOImager.h
/Source/igstkFOOImagerTool.cxx
/Source/igstkFOOImagerTool.h

You will see that you don't have to change much. The most important changes are in igstkFOOImager.h/cxx.

Look here for example implementations:
/** These device specific implementations work with compressed DV [Camcorder,Endoscope] in Linux */
/Source/igstkCompressedDVImager.cxx
/Source/igstkCompressedDVImager.h
/Source/igstkCompressedDVImagerTool.cxx
/Source/igstkCompressedDVImagerTool.h

/** These device specific implementations work with an converter from the vendor ImagingSource in Linux */
/Source/igstkImagingSourceImager.cxx
/Source/igstkImagingSourceImager.h
/Source/igstkImagingSourceImagerTool.cxx
/Source/igstkImagingSourceImagerTool.h

Actually you can work with this derived classes.
If you want to use the ImagerController as I used them for the example 
applications then you need also the classes below

Add your device specific changes into 
/Examples/ApplicationsCommon/ImagerConfiguration/igstkImagerController.h/cxx
search for CompressedDV and add your classes there also

/Examples/ApplicationsCommon/ImagerConfiguration/igstkFOOImagerConfiguration.cxx
/Examples/ApplicationsCommon/ImagerConfiguration/igstkFOOImagerConfiguration.h

Look here for example implementations:
/Examples/ApplicationsCommon/ImagerConfiguration/igstkCompressedDVImagerConfiguration.cxx
/Examples/ApplicationsCommon/ImagerConfiguration/igstkCompressedDVImagerConfiguration.h

/Examples/ApplicationsCommon/ImagerConfiguration/igstkImagingSourceImagerConfiguration.cxx
/Examples/ApplicationsCommon/ImagerConfiguration/igstkImagingSourceImagerConfiguration.h

At this point you have to modify your CMakeLists.txt files in order to compile the application
Look for e.g. CompressedDV classes and add your new paths 
IGSTKSandbox/Examples/CMakeLists.txt
IGSTKSandbox/Examples/VideoFrameGrabberAndViewer/CMakeLists.txt
IGSTKSandbox/Source/CMakeLists.txt


Modifications in the VideoFrameGrabberAndViewer example
--------------------------------------------------------

VideoFrameGrabberAndViewer.h
----
/** imager object and imager tool*/
  igstk::Imager::Pointer                    m_Imager;
  igstk::ImagerTool::Pointer                m_FOOImagerTool;
----

VideoFrameGrabberAndViewer.cxx
----
in Function:
VideoFrameGrabberAndViewer::InitializeImagerProcessing()

these:
m_ImagerConfiguration = new igstk::FOOImagerConfiguration();

//set the tool parameters
igstk::FOOToolConfiguration toolconfig;

 m_FOOImagerTool->SetInternalFrame(frame);

  m_VideoFrame->SetImagerTool(m_FOOImagerTool);

in Function:
void
VideoFrameGrabberAndViewer::ImagerControllerObserver::Execute( itk::Object *caller,
                                     const itk::EventObject & event )
this:
m_Parent->m_FOOImagerTool = tools[0];
----

CMakeLists.txt
----
${IGSTKSandbox_SOURCE_DIR}/Examples/ApplicationsCommon/ImagerConfiguration/igstkFOOImagerConfiguration.cxx
${IGSTKSandbox_SOURCE_DIR}/Examples/ApplicationsCommon/ImagerConfiguration/igstkFOOImagerConfiguration.h

compile IGSTKSandbox and run VideoFrameGrabberAndViewer






regards
ozgur



-------- Original-Nachricht --------
> Datum: Tue, 24 Mar 2009 15:32:17 +0100
> Von: Vincent Gratsac <vincent.gratsac at irisa.fr>
> An: Andinet Enquobahrie <andinet.enqu at kitware.com>
> CC: igstk-users at public.kitware.com
> Betreff: Re: [IGSTK-Users] Display the video signal from MicronTracker

> Hi all,
> 
> I'm currently working on getting the video signal from the MicronTracker 
> and display it.
> I know that IGSTK developers worked on a VideoGrabber component a few 
> months ago, but I don't know if it can be used to display 
> MicronTracker's video images.
> 
> What is the current state of this work ?
> Could someone help me or give me some pointers on how I can use the 
> video grabber component to capture video images from the MicronTracker 
> camera ?
> If this work is not completed, how can I help you ?
> 
> Best regards,
> 
> Vincent
> 
> Vincent Gratsac wrote:
> > Hi all,
> >
> > This sounds very interesting for me !
> > I would also like to get the video signal from the MicronTracker and 
> > display it.
> > Peter, did you succeed in finding a way to do such a thing ? I would 
> > be very happy to work with you on this point...
> >
> > Regards,
> >
> > Vincent
> >
> > Andinet Enquobahrie a écrit :
> >> Peter-
> >>  
> >> Great to hear that you you are able to communicate and gather pose 
> >> information from your MicronTracker using IGSTK.
> >>  
> >> We are currently working on a grabbber component to capture video 
> >> images from sources such as MicronTracker camera. This is part of the 
> >> current effort and the implementation is in the Sandbox not in the 
> >> main CVS.
> >>  
> >>  
> >> High level description fo the component
> >>  
> >> http://public.kitware.com/IGSTKWIKI/index.php/VideoGrabberComp
> >>  
> >> API
> >>  
> >> http://public.kitware.com/IGSTKWIKI/index.php/VideoGrabberAPIs
> >>  
> >> vtk video-grabber-source based on the ImagingSource control (based on 
> >> DirectShow for win) last week:
> >> http://public.kitware.com/IGSTKWIKI/index.php/VideoGrabberAPIs
> >>  
> >>  
> >> Janne Beate and Frank-
> >>  
> >> Can you please give Peter some pointers how he can use the video 
> >> grabber component to capture video images from the MicronTracker 
> >> camera and display it?
> >>  
> >> Thanks,
> >>  
> >> -Andinet
> >>  
> >>
> >>
> >>  
> >> On Fri, Jul 4, 2008 at 5:37 AM, Boettcher, Dr. Peter 
> >> <Boettcher at kleintierklinik.uni-leipzig.de 
> >> <mailto:Boettcher at kleintierklinik.uni-leipzig.de>> wrote:
> >>
> >>     One of the advantages of the MicronTracker is the possibility to
> >>     online see what the camera sees. But running the ClaronDemo and
> >>     igstk at the same time does not work. Is there a way to get the
> >>     video signal from the ClaronTracker into igstk for display - for
> >>     better control?
> >>          Regards, Peter.
> >>          PS: I managed to thet the MicronTracker to work properly - my
> >>     fault - igstk works fine ;-)
> >>          ------------------------------------
> >>     Peter Böttcher, Dr med vet, DipECVS
> >>     European Veterinary Specialist in Surgery
> >>     Fachtierarzt für Kleintierchirurgie
> >>     Klinik für Kleintiere
> >>     Universität Leipzig
> >>     An den Tierkliniken 23
> >>     D-04103 Leipzig (Germany)
> >>     Tel: +49-341-9738700
> >>     Fax: +49-341-9738799
> >>     email: boettcher at kleintierklinik.uni-leipzig.de
> >>     <mailto:boettcher at kleintierklinik.uni-leipzig.de>
> >>
> >>     _______________________________________________
> >>     IGSTK-Users mailing list
> >>     IGSTK-Users at public.kitware.com 
> >> <mailto:IGSTK-Users at public.kitware.com>
> >>     http://public.kitware.com/cgi-bin/mailman/listinfo/igstk-users
> >>
> >>
> >>
> ------------------------------------------------------------------------
> >>
> >> _______________________________________________
> >> IGSTK-Users mailing list
> >> IGSTK-Users at public.kitware.com
> >> http://public.kitware.com/cgi-bin/mailman/listinfo/igstk-users
> > _______________________________________________
> > IGSTK-Users mailing list
> > IGSTK-Users at public.kitware.com
> > http://public.kitware.com/cgi-bin/mailman/listinfo/igstk-users
> _______________________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> 
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/cgi-bin/mailman/listinfo/igstk-users

-- 
Psssst! Schon vom neuen GMX MultiMessenger gehört? Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger01



More information about the IGSTK-Users mailing list