Technical Information

From NAMIC Wiki
Jump to: navigation, search
Home < Technical Information

Technical information of 4D Ultrasound

<= Back to project page

Requirement

In this section you will find requirements to run the software

Software

  • Compiled version of Slicer 3 (You must compile Slicer on your own. Follow the build instructions here )
  • Compiled version of VTK (Provided by Slicer 3 in the "Slicer-lib/VTK-build" directory)
  • Source Code of OpenIGTLink (Provided by Slicer 3 in the "Slicer-lib/OpenIGTLink" directory)
  • Compiled version of OpenIGTLink (Provided by Slicer 3 in "Slicer-lib/OpenIGTLink-build")

Hardware

  • NDI Aurora Tracker [1]
    • 2 * 6 DOF Sensors
      • 1 Sensor attached to the ultrasound probe
      • 1 Sensor can be used to simulate a tracked surgical instrument
  • Ultrasound machine with Analog video output
  • Frame Grabber Card

    The System has successfully been test with the following 2 frame grabber cards:
    • Hauppauge Impact VCB Model 558
    • Kuroutoshikou KRDM-CX23883
  • Optional: nVidia Cuda compatible graphics card

Build Instructions

Modifications:

  • OpenIGTLink Slicer Module:
  1. Open the file vtkIGTLToMRMLImage.cxx in the source directory of the OpenIGTLinkIF module
  2. Search for "crc" in this file -> You hit find the following lines

    // If you want to skip CRC check, call Unpack() without argument.
    int c = imgMsg->Unpack(1);

  3. Change the last line to: int c = imgMsg->Unpack();
  4. Recompile the OpenIGTLink Module
  • OpenIGTLink:
  1. Open the file igtlMessageBase.cxx in the "Source" directory of OpenIGTLink
  2. Search for "crc" -> You will hit the following line igtl_uint64 crc = crc64(0, 0, 0LL); // initial crc
  3. Comment out this line -> // igtl_uint64 crc = crc64(0, 0, 0LL); // initial crc
  4. Search for the next "crc" -> You will hit this line: h->crc = crc64((unsigned char*)m_Body, GetBodyPackSize(), crc);
  5. Comment out this line -> // h->crc = crc64((unsigned char*)m_Body, GetBodyPackSize(), crc);
  6. Recompile OpenIGTLink


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

  1. Check out 4D Ultrasound from http://svn.na-mic.org/NAMICSandBox/trunk/4DUltrasound

  2. Configure via ccmake (version > 2.6) in your build directory

    You need a compiled version of VTK + OpenIGTLink as well as the source code of OpentIGTLink

    If you know how to do this, skip the next steps and procede with Compile

    1. Make a new directory in with the name "Build" in the 4DUltrasound dir:

      .../4DUltrasound$ mkdir Build

    2. Change into the Build directory

      .../4DUltrasound$ cd Build

    3. Execute ccmake in this directory with the parent directory as parameter

      .../4DUltrasound/Build$ ccmake ../

      If ccmake (version > 2.6) is not installed in your system: the executable can as well be found in: .../Slicer3-lib/CMAKE-build/bin/ccmake

    4. Type "c" to start the configuration -> You will receive an error message that VTK was not found -> Type "e" to exit the help message

    5. Change the cursor to the variable with the name "VTK_DIR" and hit ENTER

    6. Fill in your VTK-Build directory and hit ENTER (if you have a compiled version of Slicer you can use: .../Slicer3-lib/VTK-build )

      (In Ubuntu you must provide the absolute path no relative path will work)

    7. Hit "c" to start the configuration

      -> If you receive a warning, ignore it an hit "e" -> hit "c" again -> hit "e" to ignore the next warning -> Fill in the VTK-Build directory again -> hit "c" again -> Ignore the Integer-Type Error hit "e" again

    8. Hit "c"

    9. Enter the path to the directory of the compiled version of OpenIGTLink at the OpenIGTLink variable

    10. Enter the path to the directory of the OpenIGTLink source code at the OPENIGTLINKSOURCE variable

    11. Hit "c"

    12. Hit "g" to generate the Make files

  3. Compile 4D Ultrasound: Type $ make in your build directory

    .../4DUltrasound/Build$ make

Running 4D Ultrasound

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/4DUltrasound -c CalibrationFile.txt

Commandline Options

Command Alternative Description
--calibration-file xxx -c xxx Specify the calibration file (mandatory)
--reconstruct-volume -rv Enable volume reconstruction
--track-ultrasound -tu Enable ultrasound tracking
--track-instrument -ti Enable instrument tracking
--simulate-instrument -si Simulate instrument
--grab-one-frame XXX -gof XXX Grab one frame and store as the specified bitmap file
--verbose -v Print more information

TO DO

Priority MUST
Priority SHOULD
Clean up Code and Make files (Remove unnecessary Koeniginen parts)
Automatically copy Calibration file into binary directory
Fix compiler checking in cmake
Enable differnet video modes and channels in vtkVideo4Linux2
DONE Outsource OpenIGTLink library
Priority COULD
DONE Replace SonixGrabber with Ultrasound in source code
OpenIGTLink test feature
Tracker test feature
Ultrasound test feature

Ultrasound device

The ultrasound images are received via a video capture card. Linux uses V4L2 to support the card.

Capture Card - Hauppauge WIN-TV PCI Board ImpactVCB Model 558

Linux (Ubuntu 8.10 , Fedora 5)
  • The card is automatically correct detected. No further configuration needed.
  • 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.6.xxx and newer).
  • Hauppage Linux Information
  • Linux installation hints [2]
  • Modprobe option # for specific drivers: http://tldp.org/HOWTO/BTTV/cards.html
    • The Impact VCB has # 10
    • enable kernel module via: "$ modprobe bttv card=10" or add to /etc/modprobe.conf the following line "options bttv card=10 "
    • to switch to another card first remove the module via: "$ modprobe -r bttv"
  • The card uses NTSC video interlacing per default
Hardware Information
  • 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"); 

  • Specific Hardware information: [3] !!be carefull huge page, takes a long time to load!!

Video4Linux2

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

  • V4L2 wiki [4]
  • API Specificattion: [5]
  • xawtv software for video preview from the guy who wrote the bt8xx driver
Old links may soon be dead

Contacts

Tracking device

We are using a NDI Aurora tracker. Synchrograb includes an NDI tracker class which works out of the box with the Aurora NDI tracker.

Contacts
  • Haiying Liu

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

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

Python Synchrograb Module

I implemented a Pyhton module for Slicer to start Synchrograb. The module can be found in this svn repository. Basically it starts a new shell and calls the Synchrograb binary within this shell. All Synchrograb commandline options are available in the module. So fare it is not part of the Slicer repository.

3D CUDA

I might not use Cuda acceleration 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


Infos on loadable Modules

HowTo Loadable Module

HowToLoadable Module GUI

Infos about Executable Modules inSlicer


Subscribe to different meetings

  • Journal Club
  • 1st Monday Seminar
  • Office OPRC
  • Radiology Grand Rounds
  • Cimit Forum

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 +x BINARY-NAME

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

  • Now start the installation with:
 ./BINARY-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).