Giter VIP home page Giter VIP logo

pydicom_split's Introduction

pydicom_split

1. Description

pydicom_split is a simple script than splits the DICOM into a specified number of volumes along the specified axis into equal sized volumes without resampling. The series and SOP instance UIDs are updated with an appended period and integer for the split number. The image position (patient) is updated as necessary. Each split volume is saved in the same parent directory as the parent volume, in a directory with an appended period and integer for the split number. The script currently works for DICOM directories only.

2. Usage:

pydicom_split.py [-h] [-o] [-a AXIS]
                        [-d [DESCRIPTIONS [DESCRIPTIONS ...]]]
                        (-n N | -u [UIDS [UIDS ...]])
                        DICOM_DIRECTORY

positional arguments:
  DICOM_DIRECTORY

optional arguments:
  -h, --help            show this help message and exit
  -o, --origin          origin position from offset from original volume,
                        default no
  -a AXIS, --axis AXIS  axis (0 for rows, 1 for columns), default columns
  -d [DESCRIPTIONS [DESCRIPTIONS ...]], --descriptions [DESCRIPTIONS [DESCRIPTIONS ...]]
                        set the series descriptions
  -u [UIDS [UIDS ...]], --uids [UIDS [UIDS ...]]
                        split into a volume for each forward slashseparated
                        SOP/series instance UID pair
  -Outdir output, --output_dir 
                        Output directory to save split result
For single column or single row dataset
  -n N                  split into N volumes
  -order order          if there is an empty volumn in dataset,
                        specify volume(s) need to be split (1,1,1 means split 
                        all three columns mice, 1,0,1 means middle volumn is empty)
For multiple column and double row dataset
  -nTB N1,N2            split top row into N1 volumes, and bottom row into N2 
                        volumes
  -orderT orderT        if there is an empty volumn in the top row of dataset,
                        specify volume(s) need to be split (1,1 means split 
                        top row into two columns mice, 1,0 means skip the right mice of top row)
  -orderB orderB        if there is an empty volumn in the bottom row of  dataset,
                        specify volume(s) need to be split (1,1 means split 
                        bottom row into two columns mice, 1,0 means skip the right mice of bottom row)
  -offset offset        Offset from center, default 5 percent from center, only
                        apply to double row dataset

3. Run

There are some testing examples under the test directory which can give you better understanding.

If you want split all three column volume.

  python pydicom_split.py test/SingleRow/ -n 3 -order 1,1,1 -Outdir ./output

If you want remove right column empty volume.

  python pydicom_split.py test/SingRowLastOneEmpty/ -n 3 -order 1,1,0 -Outdir ./output

If you want split two rows volume.

  python pydicom_split.py test/TwoRows/ -nTB 1,2 -orderT 1 -orderB 1,1 -Outdir ./output

Hint: For two rows volume, make sure patient name contains special characters (Rp for bottom right)(L for bottom left)(T for top) to make a correct split. e.g. Patient_name: Session1_716(T)_719(Rp)_730(L)

4. Web interface

NCI ABCS IVG provides girder based dicom split workflow interface for user to quick and easy visualize and utilize this script, contact IVG group for more informations. (Two rows volume split has not been implemented in web interface yet.)

pydicom_split's People

Contributors

cj-abcs avatar tymiao1220 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.