Skip to content
Simon Leonard edited this page Mar 29, 2019 · 19 revisions

Installing 3D Slicer and Extensions

In this tutorial, we will use 3D Slicer version 4.8.1 Binaries are available from the following links:

Note for Mac users: If the system pops up a window warning that "Slicer.app can't be opened because it is from an unidentified developer" when 3D Slicer is launched for the first time, please start the Slicer application by clicking the icon with right mouse button (or click with a Ctrl key) and select "Open" from the pull down menu. Then you will be prompted to confirm that you are opening the application. Slicer will be launched once "Open" button is clicked.

We will not use the latest version of 3D Slicer (4.10.1 as of March 2019) in this tutorial, as it still has a few issues with transferring points and polydata to and from ROS-IGTL-Bridge.

After installing and launching 3D Slicer, open the Extension Manager ("View" -> "Extension Manager"), and install the following extension:

  • SlicerIGT

After restarting the 3D Slicer, you should see plug-in modules included in the extension under "IGT" section of the modules menu.

Testing Communication with ROS using ROS-IGTL-Bridge

First, we launch a roscore from a terminal on the Linux (with ROS):

roscore

Then we launch the ROS-IGTL-Bridge. Open another terminal, and run the following commands:

cd ~/catkin_ws
source devel/setup.bash
roslaunch ros_igtl_bridge bridge.launch
..
[ROS-IGTL-Bridge] Please type <1> or <2> to run node as OpenIGTLink client or server
1 : Server
2 : Client

The terminal will prompt to choose the type (Server or Client) followed by the host information (the port number for both cases, and IP if the bridge is launched as a server). In this tutorial, we will run the bridge as a server and use port 18944. It is also possible to edit the launch files and set your IP & Port in the file. Run the node as server or client by adjusting the parameter RIB_type. Open the file and uncomment the lines:

$ <!--param name="RIB_server_ip" value="111.111.111.111" type="str"/-->
$ <!--param name="RIB_port" value="18944" type="int"/-->
$ <!--param name="RIB_type" value="client" type="str"/-->

Once the bridge becomes ready, open 3D Slicer (if has not been opened yet), and open the OpenIGTLinkIF module (Modules menu-> "IGT" -> "OpenIGTLinkIF"). Then create a new node by clicking the "+" button under the "Connectors" list, and configure it from the "Properties" section as follows:

  • Name: "IGTLConnector" (default)
  • Type: "Client" (default)
  • Status: Leave unchecked (default)
  • MRMLNodeAlgorithm: Leave unchecked
  • Hostname: localhost (if Docker is used) or the IP of the ROS machine (for non-Docker environment)
  • Port: 28944 (if Docker is used with "-p 28944:18944" option) or 18944 (default for non-Docker environment

After configuring the connector, click the "Active" checkbox. If the 3D Slicer is successfully connected to ROS-IGTL-Bridge, the status field on the connector list of the OpenIGTLinkIF will show "ON."

Open a new terminal on the Linux (with ROS), and run the following commands:

cd ~/catkin_ws
source devel/setup.bash
roslaunch ros_igtl_bridge test.launch  

The test node sends a "ROS_IGTL_Test_Transform" with random translation, a random "ROS_IGTL_Test_Point", a random "ROS_IGTL_Test_Pointcloud" including 20 points, a "ROS_IGTL_Test_String" and a "ROS_IGTL_Test_PolyData". You can confirm them from "I/O Configuration" in the OpenIGTLinkIF module. (Make sure to unfold "Scene"->"IGTLConnector1"->"IN").

Those data will show up on 3D Slicer. It may take several seconds to a minute before 3D Slicer shows the surface model of the patient.

After confirming that the bridge is working, disconnect 3D Slicer by unchecking the "Active" checkbox. Once the connection status becomes "OFF" on 3D Slicer, stop the bridge and test nodes by pressing Ctrl-C on the terminals. Close the scene on 3D Slicer ("File"->"Close Scene") or close the 3D Slicer application.