Difference between revisions of "Technical Information"

From NAMIC Wiki
Jump to: navigation, search
Line 94: Line 94:
 
==== Video4Linux ====
 
==== Video4Linux ====
 
Video4Linux is part of the Linux kernel since version 2.6.xx
 
Video4Linux is part of the Linux kernel since version 2.6.xx
* [http://linuxtv.org/v4lwiki/index.php/Main_Page V4L Wiki]
+
* [http://www.linuxtv.org/wiki/index.php/Main_Page]
 +
* [http://linuxtv.org/v4lwiki/index.php/Main_Page V4L Wiki Old wiki]
 
** [http://linuxtv.org/v4lwiki/index.php/Bttv_devices_%28bt848%2C_bt878%29 Driver for our Video Card]
 
** [http://linuxtv.org/v4lwiki/index.php/Bttv_devices_%28bt848%2C_bt878%29 Driver for our Video Card]
 
* Link collection for V4L: [http://www.exploits.org/v4l]
 
* Link collection for V4L: [http://www.exploits.org/v4l]

Revision as of 13:46, 17 December 2008

Home < Technical Information

Technical information about the Connection of Synchrograb to Slicer

<= Back to project page

SynchroGrab

SynchroGrab was developed at Queen's University Kingston, Canada. I generates 3D ultrasound volumes. In order create to create the 3D image it collects image data from an ultra sound device and combines them with the position data of a tracking device. With the combination of images and positions Synchrograb generates a 3D volume. At the end this 3D image is send to Slicer via OpenIGTLink.

In summary SynchroGrab does:

  • Continuous acquisition of ultrasound images using an open-interface ultrasound system
  • Continuous acquisition of tracking information using a pose measurement system
  • Explicit synchronization of the two acquisition threads
  • Reconstruction of 3D ultrasound volumes using the synchronized data
  • Transfer of the raw ultrasound images, the 3D volumes and the probe tracking information to an OpenIGTLink-compliant system

Build Instructions

It is highly recommended to have a compiled version of Slicer and to have good knowledge about cmake.

  1. Check out version 3282 from http://svn.na-mic.org/NAMICSandBox/trunk/SynchroGrabJGumprecht

    This version works without an ultrasound device and without a tracking device

  2. Configure via ccmake (version > 2.6)

    You need a compiled version of VTK

  3. Compile Synchrograb

    The first time you compile Synchrograb in Linux you may get the following error message

    /usr/bin/ld: cannot find -lws2_32
    collect2: ld returned 1 exit status
    make[2]: *** [bin/SynchroGrab] Error 1
    make[1]: *** [Applications/CMakeFiles/SynchroGrab.dir/all] Error 2
    make: *** [all] Error 2

    to resolve this error you have to delete

    -lws2_32 -lwsock32

    in the following file

    $YOUR_BUILD_DIR/Applications/CMakeFiles/SynchroGrab.dir/link.txt

    Now you should be able to compile the code without any errors

Running Synchrograb

You need a working version of Slicer with OpenIGTLink

  1. Copy "CalibrationFile.txt" from YOUR_SOURCE_DIR to YOUR_BUILD_DIR/bin
  2. Run Slicer
  3. Add an "activer Server Connector" in the OpenIGTLink module which is waiting for data at port 18944
  4. Run Synchrograb on the same machine you run Slicer
 $YOUR_BUILD_DIR/bin/SynchroGrab -c CalibrationFile.txt --reconstruct-volume

TO DO

Priority MUST
Update vtkTrackerSimulator
DONE Complete vtkVideoSourceSimulator
DONE Use CaptureCard to acquire images
Priority SHOULD
Use splitted up vtkSynchroGrabPipeline
Clean up start parameters (Add new ones etc.)
Priority COULD


  • Replace image acquistion part. We have to use a frame grabber card instead of reading the images directly from memory
  • Crate and use a tracking device simulator
  • Create and use a ultrasound simulator
  • Find out what is already coverd by Synchrograb
  • Compile Synchrograb and see if everthing is working

Check the following

  • greyscale YUV
  • RGB grab
  • xawtv
  • change memory copy
  • implement my own deinterlacing

Contacts

  • Jonathan Boisver
    • Post Doc from Canada who implemented most of Synchrograb
    • E-Mail: boisvert ( a t ) cs.queensu.ca

Ultrasound device

I will receive the ultrasound images via a video capture card. I am going to use V4L as the card driver.

Capture Card - Hauppauge WIN-TV PCI Board ImpactVCB

  • Existing Videocard: Hauppauge WIN-TV PCI Board ImpactVCB Model 558 [1]
  • Linux Driver: Video4Linux2 bt878
    • "bt" stands for Brooktree the original Manufacturer. Now bought by Conexant
  • The Linux driver (bttv) for the WinTV card is now part of the Linux kernel (version 2.2 and newer).
  • Hauppage Linux Information
  • Linux installation hints [2]
  • Specific Hardware information: [3] !!be carefull huge page, takes a long time to load!!
  • Modprobe option # for specific drivers: http://tldp.org/HOWTO/BTTV/cards.html
    • The Impact VCB has # 10
    • enable driver via: "$ modprobe bttv card=10" or add to /etc/modprobe.conf the following line "options bttv card=10 "
  • Channel: 3 delivers the s-video signal
    • To set the channel add the following at the end of void vtkV4L2VideoSource::InitDevice(void):

 int channel = 3;
 if (-1 == xioctl (fd,VIDIOC_S_INPUT , &channel))
   errno_exit ("VIDIOC_S_INPUT"); 

  • Incoming images are digitized using high quality 4:2:2 video sampling

Video4Linux

Video4Linux is part of the Linux kernel since version 2.6.xx

Contacts

Tracking device

Track data via vtk not itk

Contacts
  • Haiying Liu
    • He knows how to do this part, so there should be no big issues

Calibration

Description: To get the correct information from the ultrasound device it has to be calibrated

Contacts
  • Raul San Jose

Information:

  • I have serval links and information from Raul on which I have to go through

Slicer

So far there is nothing to do in Slicer, since I am just sending the complete 3D Volume via OpenIGTLink. The only work that has to be done by Slicer is to render and visualize the data.

I am using the trunk version of Slicer (3.3) since this has the OpenIGTLink module and the CUDA module.

3D CUDA

I might not use Cuda accerlation since there is no real performance advantage at this point

TO DO

  • Nothing

Contacts

Documentation: VolumeRenderingCuda Module

  • Adjust the threshold (scroll bar below 'Component Weights Scrollbars') to correct values. Especially the lower value. Normally > 0
  • Scalar Opacity Mapping: Shows a histogram of the used values an their transparence. Low transparent, high solid
  • Scalar Color Mapping: You can click into and than in the color circle above and select certain colors for a specific value
  • Composite: Here you can select different rendering modes
  • Volume: You can also select just to display a slice instead of the whole volume. You can transform the slice in the Transforms Module and than select the transformation matrix in Slice Matrix
  • Plus/Minus: Select if you want to see everything or just the volume on one side of the slice and on the other

Links

  • Sandbox page [8]

How to "Enable CUDA 2.0 in Fedora 8 for use with Slicer 3.3 Alpha"

Date: Sept. 26th 2008

Fedora 8 is the newest Fedora version for which CUDA is available. The available CUDA Version is 2.0.
To enable CUDA 2.0 in Fedora 8 for Slicer 3.3 Alpha follow the steps below:

Installation of Drivers

  • Download the CUDA installation files (Driver, Toolkit, SDK) here [9] and remember the directory in which you downloaded them. I used

for the driver installation binary

 ~/Download/CUDA/Driver/ 

for the tool kit installation binary

 ~/Download/CUDA/Toolkit/

and for the SDK installation binary

 ~/Download/CUDA/SDK/
  • For the installation there must not run a X-Server. Therefore we have to restart the computer. When you see the GRUB Bootscreen after the reboot press any key to enter the GRUB menu. Highlight the Fedora Version you want to boot and press
 a

Then type

 Type 3

and hit the 'Enter' key. Fedora will boot up without X Server and drop you at Command Line Login prompt.

  • Login and change into root mode via:
 su
  • Then switch to the directory where you downloaded the driver. For me this means:
 cd ~/Download/CUDA/Driver/
  • Now we have to change the permissions for the driver-binary and make it executable. This works with
 chmod +a BINARY-NAME

(Replace 'BINARY-NAME' with the name of the driver binary)

  • Now start the installation with:
 ./BINARU-NAME

I changed none of the default values during the installation

  • For the sdk compilation follow this reference guide: [10]
    If you get the error message: "ld: cannot find -lglut", like I did, have a look at the reference under 'IV. Known Issues'
  • In the next step we do the same for the toolkit and for the sdk, e.g chance to the according directory, change the permissions and run the installation with the default values

Enable CUDA in Slicer 3.3 Alpha

  • Start with the installation manual of Ben Grauer. You find it here [11]
    Below you find corrections to certains points that did not work for me the way it was explained in the manual
  • In 1.1.2 Check out the following slicer branch instead and build it:
 svn co http://svn.slicer.org/Slicer3/trunk Slicer3
 ./Slicer3/Scripts/getbuildtest.tcl
  • Before you can go on with step 1.2.2 you have to Uncomment:
    • CudaSupport in Slicer3/Libs/CMakeLists.txt
    • VolumeRenderingCuda in Slicer3/Modules/CMakeLists.txt
  • In step 1.2.2
    • you have to use your build directory (Slicer-build) as parameter for ccmake
    • for CUDA_INSTALL_PREFIX use /usr/local/cuda
    • for FOUND_CUT use $HOME/NVIDIA_CUDA_SDK/common/lib/linux/libcudpp.a
    • for FOUND_CUT_INCLUDE use $HOME/NVIDIA_CUDA_SDK/common/inc
  • Step 1.2.3 was not necessary for me
  • Just do a rebuild (run Slicer3/Scripts/getbuildtest.tcl) and the VolumeRenderingCUDA module is available

This installation worked for me on a DELL machine with XEON Dual Core and a Nvidia G8800. For fast rendering make sure not enable compiz(Desktop Effects).