Skip to content

Latest commit

 

History

History
43 lines (29 loc) · 1.61 KB

readme.md

File metadata and controls

43 lines (29 loc) · 1.61 KB

3d Slicer Draft USD Support

Intro

USD support is the fundamental prerequisite for having a direct connection between 3d Slicer and Omniverse.

3d slicer and omniverse

Note

The code here is a rough proof of concept for DataHack Hackathon by lablab.me

How to use this draft:

  1. Copy utils folder to your project folder (next to .mrml file)

    copy utils folder

  2. Install dependencies inside 3d slicer, by the following code.

    this is done once..

    import sys; import subprocess; subprocess.run([sys.executable, '-m', 'pip', 'install', 'usd-core']); subprocess.run([sys.executable, '-m', 'pip', 'install', 'unicodedata'])
  3. Export and convert model, by Running the following code in 3d slicer's python shell.

    USD file name is the same as the project folder name.

    import sys; sys.path.append("{}/utils".format(slicer.mrmlScene.GetRootDirectory().strip("/")))
    
    from export_usd import export_usd
    export_usd()

    run code in slicer

Example Project

Here, it's Lungs

Watch a Demo

Here's me running the code

3d slicer draft usd support

Appreciation

Code credits gltf2usd by kcoley, I only made it work in 3d slicer.