Code Monkey home page Code Monkey logo

dxaconv's Introduction

dxaconv

Convert DICOM files from DXA scans to other image formats, and parse the corresponding metadata files

Originally intended for DXA scans, but can also be used on any other DICOM formatted image as well (i.e. MRI).

Convert .dcm files to .jpg (or .png), preview images via matplotlib, and convert each file's corresponding metadata to a .txt file. Organize the output by anatomy (built in extensions compatible with dicom files from the United Kingdom National Health Service). Example dicom files used in this repo can be found here as "eg_20158_dxa.zip".

This code builds upon the pydicom library and OpenCV libraries. Please refer here and here for additional information on dependencies, the pydicom and opencv documentation.

Command line examples

Convert DICOM files to JPG format

# while in a directory that contains all dicom images, use this command to convert them to JPGs in a new directory

python dxaconv.py dicom_directory jpg_directory

If one of the files could not be converted for some reason, the following message will be displayed 'An exception occurred and a dcm file of this directory did not successfully convert:' preceding the error message.

Organize by files of a particular anatomy

# specify the path to a directory with dicom images, and the anatomy to filter by
 
python organizer.py dicom_directory spine

# it will output a text file containing all filenames for images of the spine

Anatomy arguments for organizer.py

hip1, hip2, knee1, knee2, spine, thoracic, full_body_opaque, full_body_transparent

TODO

  • Add DICOM to NIFTI conversion tool

dxaconv's People

Contributors

briannaflynn avatar

Stargazers

 avatar  avatar

Watchers

 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.