Coder Social home page Coder Social logo

tpor's Introduction

TPOR: Treatment Planning Optimization Routines

TPOR Dependency Build Instructions

Prepare builds

  1. Download the following libraries: HDF5: www.hdf5group.org/ftp/HDF5/current/src/hdf5-1.8.12.tar.gz h5py: www.h5py.org/dl/h5py-2.2.1.tar.gz moab-4.6.2: ftp.mcs.anl.gov/pub/fathom/moab-4.6.2.tar.gz boost-1.55.0: http://sourceforge.net/projects/boost/files/boost/1.55.0/boost_1_55_0.tar.gz/download

  2. Create a directory for building software libraries (e.g. /home/user/software)

  3. Move the tarballs you just downloaded into the software directory

  4. create a directory called hdf5, h5py, moab, boost and archive in the software directory (mkdir dirname)

Build HDF5

  1. mv the hdf5-1.8.12.tar.gz tarball to the hdf5 directory

  2. enter the hdf5 directory

  3. run the command tar -xf hdf5-1.8.12.tar.gz to unpack the tarball

  4. mv the hdf5-1.8.12.tar.gz to the archive directory so that you don't have to download it again if something goes wrong (mv hdf5-1.8.12.tar.gz ../archive/.)

  5. create a soft link to the hdf5-1.8.12 directory called src (ln -s hdf5-1.8.12 src)

  6. create a directory called build (mkdir build)

  7. enter the build directory

  8. execute the following command: cmake -DCMAKE_INSTALL_PREFIX:PATH=/home/user/software/hdf5 -DCMAKE_BUILD_TYPE:STRING=RELEASE -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=OFF -DHDF5_ENABLE_USING_MEMCHECKER:BOOL=ON -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_EXECS:BOOL=OFF -DBUILD_TESTING:BOOL=ON -DHDF5_BUILD_EXAMPLES:BOOL=ON -DHDF5_BUILD_CPP_LIB:BOOL=ON -DHDF5_BUILD_TOOLS:BOOL=ON -DHDF5_BUILD_HL_LIB:BOOL=ON ../src/

Note: /home/user/software is the absolute path to the software directory that you created Note: this command configures the build system to build shared libraries.

  1. execute the following commands if no errors occurred: make, make test, make install

Note: Do not proceed unless all of these steps are successful!

  1. open ~/.bashrc using a text editor (e.g. emacs ~/.bashrc)

  2. at the end of the file add the following lines: export LD_LIBRARY_PATH=/home/user/software/hdf5/lib:$LD_LIBRARY_PATH

Note: Shared libraries aren't loaded until a program executes (dynamic loading). The program needs to know where to look when loading shared libraries. There are several defaults that are checked first. The LD_LIBRARY_PATH environment variable allows you to append the locations that are checked for shared libraries.

  1. execute the following command: exec bash

Note: This command loads in your new environment variables from .bashrc

Build h5py

  1. mv the h5py-2.2.1.tar.gz to the h5py directory

  2. enter the h5py directory

  3. run the command tar -xf h5py-2.2.1.tar.gz to unpack the tarball

  4. enter the h5py-2.2.1 directory

  5. execute the following command: ./setup.py build --hdf5=/home/user/software/hdf5

  6. execute the following command: ./setup.py install --prefix=/home/user/software/h5py

  7. open ~/.bashrc using a text editor (e.g. emacs ~/.bashrc)

  8. at the end of the file add the following lines: export PYTHONPATH=/home/user/software/h5py/lib/python2.7/site-packages:$PYTHONPATH

Note: Python has several default paths that it checks when loading modules. the PYTHONPATH environment variables allows you to append the paths where it looks.

  1. execute the following command: export bash

Build MOAB

  1. mv the moab-4.6.2.tar.gz tarball to the moab directory

  2. enter the moab directory

  3. run the command tar -xf moab-4.6.2.tar.gz to unpack the tarball

  4. create a soft link to the moab-4.6.2 directory called src (ln -s moab-4.6.2 src)

  5. create a directory called build

  6. enter the build directory

  7. execute the following command: ../src/configure --prefix=/home/user/software/moab --enable-optimize --with-hdf5=/home/user/software/hdf5 --enable-64bit"

Note: MOAB currently uses a different build system called autotools

  1. execute the following commands if no errors occurred: make, make install

Build boost

  1. mv the boost_1_55_0.tar.gz tarball to the boost directory

  2. enter the boost directory

  3. run the command tar -xf boost_1_55_0.tar.gz to unpack the tarball

  4. enter the boost_1_55_0 directory

  5. execute the following command: ./bootstrap.sh --prefix=/home/user/software/boost

  6. execute the following command: ./b2 install

TPOR Build Instructions

  1. in the /home/user/software directory, create a new directory called tpor

  2. enter the tpor directory

  3. execute the following command: git clone https://github.com/aprobinson/TPOR.git

  4. create a directory called build

  5. enter the build directory

  6. copy the example configuration file from the TPOR repo (cp ../TPOR/scripts/configure.sh .)

  7. open the configure.sh file with a text editor (e.g. emacs configure.sh)

  8. set the MOAB_PREFIX_PATH variable equal to /home/user/software/moab, HDF5_PREFIX_PATH variable equal to /home/user/software/hdf5, BOOST_PREFIX_PATH variable equal to /home/user/software/boost, TPOR_PATH variable equal to /home/user/software/tpor/TPOR, CMAKE_INSTALL_PREFIX:PATH to /home/user/software/tpor/

  9. close the configure.sh file

  10. run the configure.sh file (./configure.sh)

Note: every time you run this fill it will pull down commits to the TPOR repo

  1. run the following commands: make, make test, make install

Configure system to find tpor execs and pytpor python module 12. open ~/.bashrc using a text editor

  1. In the PYTHONPATH variable, add the following after the ":" /home/user/software/tpor:

Note: the variable should look like export PYTHONPATH=/home/user/software/h5py/lib/python2.7/site-packages:/home/user/software/tpor:$PYTHONPATH

  1. at the end of the file add the following line export PATH=/home/user/software/tpor/bin:$PATH

Note: when running commands in the terminal there are several default locations that are searched for the executables. The PATH environment variable allows you to add to that paths that are searched. Now, the tpor executables can be run from any directory without creating soft links, aliases or relative paths.

  1. run exec bash.

tpor's People

Contributors

aprobinson avatar lkersting avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar  avatar Eli Moll avatar Philip Britt avatar

tpor's Issues

Modify the seedmeshgenerator.cpp main routine so that directional seed mesh data is created and stored.

The seedmeshgenerator.cpp main routine needs to be modified so that directional seed data meshes are generated and stored in the BrachytherapySeeds.h5 hdf5 file. I have some ideas about how this should be done but I think we need to discuss things a bit further before moving past this point. My original idea was to generate the directional seed meshes for a very large number of orientation angles. Each directional seed data mesh would get a unique name and therefore a unique "directory" in the BrachytherapySeeds.h5 file. This method makes changing the step size of the orientation angles much more challenging due to the naming convention. My new idea is to have a single directory for the directional seed data. All directional seed data meshes will then be stored in this directory of the hdf5 file. A user can then specify the orientation angle step size as a command line argument of the seedmeshgenerator. When a user then requests directional seeds in the treatment planner, all directional meshes will automatically be loaded an used in the optimization process (instead of specifying the orientation angle step size in the treatment planner).

Create the directional seed class

All seed classes derive from the BrachytherapySeed abstract base class. A new Directional Seed class needs to be written (named PrototypeDirectionalSeed perhaps?) that implements the abstract interface (see "= 0" Brachytherapy seed member functions). Also note that all of the isotropic seed constructors take a single variable - the air kerma strength. The directional seed class will have to take this variable and a second variable indicating the orientation of the directional seed. In my design of the seed classes I assume that the axis of the seeds is aligned with the z-axis. For consistency, this must also be the assumption for the directional seed. A second assumption must also be made for the directional seed regarding its orientation, namely that an orientation angle of 0.0 radians corresponds to the direction of peak dose being aligned with the positive x-axis. Regardless of how the directional seed dose distribution data is given, I envision having this dose distribution data hard coded in the directional seed class for one specific orientation angle (ideally an angle of 0.0 for simplicity). Then, when one requests the dose at a point, the function must simply transform the coordinates to the default coordinate system that the hard coded data assumes (using a simple rotation matrix).

A new seed type needs to be added to the BrachytherapySeedType enumeration. This will be used by the BrachytherapySeedFactory to construct directional seeds.

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.