Skip to content

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

License

Notifications You must be signed in to change notification settings

MustafaJafar/3d-slicer-draft-usd-support

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

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

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages