Giter Club home page Giter Club logo

mctools's Introduction

MCtools

Python scripts for generation of .egsinp and .egsphant files for BEAM/DOSXYZnrc from DICOM data.

NOTE: These scripts have only been used with a Varian 21iX beam model and are provided with no support or guarantee that they will work out of the box. Tests should be run to verify the geometry of the resulting .egsinp files with your beam model.

Installation

The tools are not currently packaged for proper python installation. The tools can be imported in a python shell in the directory they are located by

import dicomparse
import ctcreate

Templates

Example templates for BEAM/DOSXYZnrc input files are provided in the /templates folder. The BEAMnrc model is only an example that resembles the basic layout of a Varian 21iX linear accelerator, and does not represent the actual specifications of a clinical linear accelerator.

The template examples show where certain variables (preceeded by !!, e.g. !!X representing the position of the X jaw) need to be placed in the template files.

Templates should be installed in a folder at EGS_HOME/templates

BEAM/DOSXYZnrc Input File Generation

.egsinp files for BEAMnrc and DOSXYZnrc can be generated using the function

dicomparse.egsinpGenerate(plandir, EGS_HOME, beamind)

where plandir is the directory containing the DICOM RP file, EGS_HOME is the location of the EGS_HOME directory on the disk, and beamind is a list of beam indexes to generate files for (not providing beamind results in input files being generated for all beams).

Resulting .egsinp files are found in the plandir directory.

Wedges

Testing has only been performed on wedges using Varian Enhanced Dynamic Wedges (EDWs). EDW.py is a script used for generating dynamic jaw input files using Varian Golden Segmented Treatment Tables.

.egsphant Generation

.egsphant files can be generated using the function:

ctcreate.ctcreate(EGS_HOME, ctdir, structs={})

where EGS_HOME is as explained previously, ctdir is the directory containing the DICOM CT, dose (RD) and structure set (RS) files, and structs is a dictionary containing the names and corresponding physical density of any structures to override.

The function uses CT number to physical density information read from text files located in EGS_HOME/templates. Text files should be named as the serial number of the CT scanner to which the conversion table corresponds. An example is provided.

mctools's People

Contributors

livingag avatar

Stargazers

 avatar  avatar  avatar  avatar

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.