Giter Site home page Giter Site logo

scaramallion / django-rt-pdb Goto Github PK

View Code? Open in Web Editor NEW
4.0 5.0 2.0 357 KB

Nice tabular interface for radiotherapy planning data

License: Other

Python 35.44% HTML 4.97% CSS 12.31% JavaScript 47.29%
radiotherapy radiation-oncology medical-physics tables django

django-rt-pdb's Introduction

pdbook

pdbook is a Django app to display radiotherapy planning data in an easily accessible tabular form. It should only be used for internal sites and is not recommended for use on anything public facing.

Screenshots

Quick Start

  1. Add pdbook to your INSTALLED_APPS setting:
    INSTALLED_APPS = [
        ...
        'pdbook',
    ]
  1. Include the pdbook URL configuration in your project's urls.py:
from django.conf.urls import include
from django.urls import path

urlpatterns = [
    ...
    path(r'pdb/', include('pdbook.urls')),
]
  1. Add the templates and static files as required by your project.
  2. Run python manage.py migrate to create the pdbook models in the database.
  3. Start the development server and visit http://127.0.0.1:8000/admin/ to add your Machines, Beams and Data (you'll need the Admin app enabled).
  4. Visit http://127.0.0.1:8000/pdb/ to view the planning data.

Adding Machines

  • Login to the admin site and under the Planning Data Book section, click on 'Machines' then 'Add Machine'.

  • Fill out the fields for:

    • Machine Type: Required, one of 'Linear Accelerator', 'Orthovoltage Unit' or 'Radiation Source'.
    • Manufacturer: Optional, the manufacturer of the machine.
    • Model: Optional, the model of the machine.
    • Serial Number: Optional, the machine's serial number.
    • Name: Required, the name to use for the machine. Must be unique.
    • Visible name: Required, the displayed name of the machine.
    • Description: Optional, the machine's description.
  • Once all the required fields are filled out, click 'Save'.

Adding Beams

  • Login to the admin site and under the Planning Data Book section, click on 'Machines' then click on the name of the machine you wish to add beams to.

  • Under the 'Beams' section, click on 'Add another Beam'.

  • Fill out the fields for:

    • Machine: Required, the machine this beam belongs to.
    • Modality: Required, the modality of the beam. One of 'MV Photons', 'MeV Electrons', 'kV Photons' or 'Radioisotope'.
    • Energy: Required, the nominal energy of the beam.
    • Name: Required, the name to use for the beam. Must be unique.
    • Visible name: Required, the displayed name of the beam.
    • Description: Optional, a description of the beam.
  • Once all the required fields are filled out, click 'Save'.

Adding Data

  • Login to the admin site and under the Planning Data Book section, click on 'Beams' then click on the name of the beam you wish to add data to.

  • Under the 'Data' section, click on 'Add another Beam'.

  • Fill out the fields for:

    • Beam: Required, the beam this data belongs to.
    • Data: Required, upload the CSV file containing the data.
    • Interpolation type: Required, the type of interpolation available for the data, one of 'No interpolation', '1D interpolation', '2D interpolation'.
    • Show Y Values: Optional, set to true to display both Y row labels and Y parameter values.
    • Name: Required, the name to use for the data. Must be unique.
    • Visible Name: Required, the displayed name for the data.
    • Description: Optional, a description of the data.
    • Data Source: Optional, a description of the source used for the data.
  • Once all the required fields are filled out, click 'Save'

Tabular Data CSV File Format

Tabular data should stored in CSV files (with comma ',' as the delimiter character, caret '^' as an escape character and hash '#' as a comment character). See the samples directory for example CSV files (all sample data is for illustrative purposes only and should not be used clinically, obviously).

CSV File Keywords

DESCRIPTION=
Optional. The description of the data. Supports HTML tags and unicode characters. Will override the Data model's description field. Any commas in the value will be automatically escaped.
DESCRIPTION=Some sort of data taken from somewhere
SOURCE=
Optional. The source of the data. Supports HTML tags and unicode characters. Will override the Data model's data_source field. Any commas in the value will be automatically escaped.
SOURCE=Ata et al, <i>"Interesting data"</i>, Journal of Data, <b>8</b>, pp 2901-3 (1999)
X_TITLE=
Optional. This is the displayed title for the X parameter. Supports HTML tags and unicode characters.
X_TITLE=Field Size
X_HEADERS=
Required, this is the displayed column labels. Supports HTML tags and unicode characters.
X_HEADERS=Depth<br/>(cm), 2 x 2, 3 x 3, 4 x 4, 5 x 5, 6 x 6, 7 x 7, 8 x 8, 9 x 9, 10 x 10
X_FORMAT=
Optional, must be a valid python new style formatting string. Used to control the formatting of the X_VALUES values.
X_FORMAT={:.1f}
X_VALUES=
Required if 2D data. For f(x, y) these are the X parameter values. If using interpolation then values should be ordered so they are increasing (and the tabular data ordered to match).
X_VALUES=2, 3, 4, 5, 6, 7, 8, 9, 10
Y_TITLE=
Optional. This is the displayed title for the Y parameter. Supports HTML tags and unicode characters.
Y_TITLE=Depth in water<br/>(cm)
Y_HEADERS=
Required, these are the displayed row labels. Supports HTML tags and unicode characters.
Y_HEADERS=2 x 2, 3 x 3, 4 x 4, 5 x 5, 6 x 6, 7 x 7, 8 x 8, 9 x 9, 10 x 10
Y_FORMAT=
Optional, must be a valid python new style formatting string. Used to control the formatting of the Y_VALUES values.
Y_FORMAT={:.1f}
Y_VALUES=
Required if interpolation is supported if or Y_HEADERS is missing. For 2D data f(x, y) or 1D data f(y), these are the Y parameter values. If using interpolation then values should be ordered so they are increasing (and the tabular data ordered to match).
Y_VALUES=2, 3, 4, 5, 6, 7, 8, 9, 10
XY_FORMAT=
Optional, must be a valid python new style formatting string. Used to control the formatting of the tabular data values.
XY_FORMAT={:.3f}
XY_TYPE=
Optional, must be either 'NUMERIC' or 'VERBATIM', defaults to 'NUMERIC'. If the table data is to be displayed exactly as entered or contains non-numeric data then use 'VERBATIM'. Interpolation is only supported with NUMERIC type data.
XY_TYPE=VERBATIM

All lines that don't start with a keyword will be considered to be part of the tabular data as f(x, y) or f(y).

Bugs and Issues

While I welcome PRs, I won't be supporting this project beyond fixing major bugs.

Dependencies

django-rt-pdb's People

Contributors

scaramallion avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

zoulianmp rnd4rt

django-rt-pdb's Issues

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.