Giter Club home page Giter Club logo

rtkit's Introduction

RTKIT

##The Radiotherapy DICOM toolkit

RTKIT is a toolkit for processing information from the various DICOM modalities encountered in radiotherapy. It contains a number of classes and convenience methods designed to make it easy to extract and manipulate radiotherapy information of interest, like e.g. segmentation, plan, image and dose data.

Note that the toolkit is in an early state of release, and as such, may be a bit rough in the edges. If you are interested in using RTKIT, please feel free to send me an email with a brief explanation of what you would like to do, and I'll be happy to assist you in getting started with Ruby and RTKIT.

Supported DICOM Modalities

  • CT
  • MR
  • RTSTRUCT
  • RTPLAN
  • RTDOSE
  • RTIMAGE

INSTALLATION

gem install rtkit

REQUIREMENTS

  • Ruby 1.9.3 (or higher)
  • ruby-dicom
  • NArray

BASIC USAGE

Load & Include

require 'rtkit'
include RTKIT

Load a set of DICOM files from a folder

# Load files:
ds = RTKIT::DataSet.read("C:/phantom_study/")

Example: Merge two structure sets

# Locate the structure set objects:
structs = ds.patient.study.iseries.structs
# Extract the two structure sets:
s1 = structs.first
s2 = structs.last
# Transfer all ROIs except the external contour:
s2.rois.each do |roi|
  s1.add_roi(roi) unless roi.name.downcase.include?('external')
end
# Ensure unique ROI Numbers:
s1.set_numbers
# Write the composed structure set object to file:
s1.write("fusion_struct.dcm")

IRB Tip

When working with RTKIT in irb, you may be annoyed with all the information that is printed to screen. This is because in irb every variable loaded in the program is automatically printed to the screen. A useful hack to avoid this effect is to append ";0" after a command. Example:

ds = RTKIT::DataSet.read(folder) ;0

RESOURCES

COPYRIGHT

Copyright 2012-2016 Christoffer Lervåg

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/ .

ABOUT THE AUTHOR

  • Name: Christoffer Lervåg
  • Location: Norway
  • Email: chris.lervag [@nospam.com] @gmail.com

Please don't hesitate to email me if you have any feedback related to this project!

rtkit's People

Contributors

dicom avatar

Stargazers

zssure avatar  avatar

Watchers

James Cloos avatar zssure 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.