Git Product home page Git Product logo

image-x-institute / ctheaddeformation Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 3.0 44.48 MB

The CTHeadDeformation module is an open-sourced library for taking CT and cone-beam CT (CBCT) scans and deforming these scans in a way that simulates realistic head motion. Further information can be found in the repo wiki (https://github.com/ACRF-Image-X-Institute/CTHeadDeformation/wiki)

License: MIT License

Python 85.20% Makefile 0.90% Batchfile 1.24% Jupyter Notebook 12.66%
deep-learning medical-imaging python

ctheaddeformation's People

Contributors

bwheelz36 avatar markgardnerusyd avatar

ctheaddeformation's Issues

remove unused files/folders

  • .coverage (should be added to gitignore too)
  • docs
  • docsrc
  • dist (this is uploaded to pypi, but doesn't need to live in the repo)

CI with elastix

ok this is certainly a slightly annoying problem!

1. installation

the commands to install on linux are below.

wget -P ~/ElastixDownload "https://github.com/SuperElastix/elastix/releases/download/5.0.1/elastix-5.0.1-linux.tar.bz2"
tar -xvf elastix-5.0.1-linux.tar.bz2

to actually use these in a shell, you have to update the path (and the exact installation directory may differ slightly on github:

export Path=$Path:~/ElastixDownload/elastix-5.0.1-linux/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:~/ElastixDownload/elastix-5.0.1-linux/lib/

Note that this updates the path ONCE in the terminal it is entered, not forever.
if you want to always have this path update, you could edit your bashrc file which contains a list of things that happen every time a terminal is open

nano ~/.bashrc
# then copy this somewhere in the file:
export Path=$Path:~/ElastixDownload/elastix-5.0.1-linux/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:~/ElastixDownload/elastix-5.0.1-linux/lib/

this you already pretty much figure out, albeit some of the steps were commented out (but I assume this was just debugging)
the issue as it turns out is setting the environment for a command to be executed in linux:

2. calling from inside python

When you start a new process inside python, it launches in a fresh terminal.
so if you have done the .bashrc step, I think the python commands should work (haven't checked this).
If you have not edited the bashrc file, then you can also change the environment a process launches in. so you can replace the test_ElastixInstalled test with something like the following and it should run:

def test_ElastixInstalled():
    
    home_dir = Path(os.path.expanduser('~'))  # may have to update for github system
    elastix_dir = home_dir / 'ElastixDownload' / 'elastix-5.0.1-linux' / 'bin'
    elastix_lib_dir = home_dir / 'ElastixDownload' / 'elastix-5.0.1-linux' / 'lib'
    my_env = os.environ.copy()
    my_env["PATH"] = my_env["PATH"] + ':' + str(elastix_dir)
    my_env["LD_LIBRARY_PATH"] = my_env["LD_LIBRARY_PATH"] + ':' + str(elastix_lib_dir)
    bashCommand = "/home/brendan/ElastixDownload/elastix-5.0.1-linux/bin/elastix -h"
    subprocess.Popen(bashCommand.split(), env=my_env)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.