# Using open3d within Slicer

**URL:** https://discourse.slicer.org/t/using-open3d-within-slicer/11475
**Category:** Support
**Created:** [May 9, 2020, 7:41am UTC](https://discourse.slicer.org/t/using-open3d-within-slicer/11475 "2020-05-09T07:41:57Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![agporto](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/agporto/32/8319_2.png) [@agporto](https://discourse.slicer.org/u/agporto)
#### Post date: [May 9, 2020, 7:41am UTC](https://discourse.slicer.org/t/using-open3d-within-slicer/11475/1 "2020-05-09T07:41:57Z")

</div>

I recently joined the SlicerMorph team and I have been developing an algorithm that makes heavy use of the open3d library ([https://github.com/intel-isl/Open3D](https://github.com/intel-isl/Open3D)). I was able to install it within Slicer using pip, but when importing it into Slicer, I get the following error (ImportError: /usr/lib/x86\_64-linux-gnu/libstdc++.so.6: version `GLIBCXX\_3.4.22’ not found ). It seems to be related to the GNU C Library, I was wondering if there is any hope that this problem could be solved, as it would be great to be able to use open3d within Slicer. Any ideas or directions? Thanks in advance.

---

<div class="post-metadata">

### Author: ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)
#### Post date: [May 9, 2020, 7:38pm UTC](https://discourse.slicer.org/t/using-open3d-within-slicer/11475/2 "2020-05-09T19:38:13Z")

</div>

Hi -

The error you are seeing should be fixable at the os level - you can google around for GLIBCXX and libstdc++ and you should find the right instructions for your particular OS version.

On the plus side, I can report that I was able to run `pip_install('open3d')` and `import open3d` on both windows and mac and it appears that it will nicely interoperate with Slicer via numpy arrays.

Thanks for pointing out the library - looks super useful. Let us know if you get it working on your machine and how it works. I’ll definitely be looking into it too and maybe we can work up some demo code.

---

<div class="post-metadata">

### Author: ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)
#### Post date: [May 10, 2020, 12:59am UTC](https://discourse.slicer.org/t/using-open3d-within-slicer/11475/3 "2020-05-10T00:59:52Z")

</div>

I had a look and Open3D and I’m not impressed at all. It is a small library containing of a handful of random algorithms that are mostly already available in other widely used libraries (OpenCV, PCL, VTK, etc). What feature of Open3D do you use?

---

<div class="post-metadata">

### Author: ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)
#### Post date: [May 10, 2020, 1:04am UTC](https://discourse.slicer.org/t/using-open3d-within-slicer/11475/4 "2020-05-10T01:04:40Z")

</div>

Don’t know if it’ll be useful but it does work.

```auto
m = getNode("Segment_1")
p = arrayFromModelPoints(m)
cloud = o3d.geometry.PointCloud()
cloud.points = o3d.utility.Vector3dVector(p)
o3d.visualization.draw_geometries(cloud)

```

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/0/b/0b506778b15ffeb9d56e0fd331f00ca708027bf6.jpeg)

---

<div class="post-metadata">

### Author: ![agporto](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/agporto/32/8319_2.png) [@agporto](https://discourse.slicer.org/u/agporto)
#### Post date: [May 10, 2020, 2:35am UTC](https://discourse.slicer.org/t/using-open3d-within-slicer/11475/5 "2020-05-10T02:35:34Z")

</div>

Dear Steve and Andras.  
Thanks so much for the quick responses and thanks Steve to point us in the right direction to get it working. I agree with Andras that it is a small and targeted library. To answer the usage question, this library contains most of what we need for registration and some functions that I couldn’t find in other more comprehensive libraries. For example, the feature -based RANSAC registration ([http://www.open3d.org/docs/release/tutorial/Advanced/global\_registration.html#feature-matching](http://www.open3d.org/docs/release/tutorial/Advanced/global_registration.html#feature-matching)) method is quite useful and I haven’t found a good implementation elsewhere. Similarly, the pose graph functionality is another one that I could not find in other libraries ([http://www.open3d.org/docs/release/tutorial/ReconstructionSystem/register\_fragments.html](http://www.open3d.org/docs/release/tutorial/ReconstructionSystem/register_fragments.html)) that deal with point clouds. All in all, I would also say that this library is quite lightweights (seems to use the memory efficiently), it has very readable syntax and it contains useful callback functions for the visualization. I don’t necessarily expect that it would be useful for the Slicer community at large, but, for our purposes, it seems to work well. I am open to the possibility that other libraries might do a better job at it. I just don’t know another library that contains everything that I would need at this point.  
Thanks again,  
Arthur
