Git Product home page Git Product logo

dicom-parser-rs's Introduction

dicom-parser-rs

dicom parser written in Rust

Design Goals

  • Parse all standards compliant DICOM P10 files
  • First class support for WebAssembly builds
  • Streaming compatible API
  • SAX Style callback based parsing
  • Does not utilize a DICOM data dictionary
  • Modular design enabling flexible re-use of the library functionality

Read about the design rationale for this library

Features

  • Callback based parsing
  • Cancel Parsing
  • DICOM P10 Meta Information
  • Explicit Little Endian Transfer Syntax
  • Streaming Parser
  • Implicit Little Endian Transfer Syntax
  • Explicit Big Endian Transfer Syntax
  • Encapsulated Pixel Data
  • Sequences with known lengths
  • Sequences with undefined lengths
  • UN with undefined lengths
  • Deflate Transfer Syntax

Status

Actively being developed (June 20, 2020)

To Do's (before first version release)

  • Add no_std configuration?
  • Add example applications
    • dump to DICOM JSON format
    • dump to text (in DCMTK dcmdump format) - requires data dictionary though
  • Test library with large number of images (GDCM test images, etc)
    • Would be nice to build an automated regression suite

Performance Benchmarking

Add performance benchmark to understand parser performance for various use cases and data variations. Establishing a baseline here will help avoid performance regressions due to future changes and also serve as a useful comparsion agains other parsing implementations.

  • Use Cases
    • SOP Instance Identification - extract Study,Series and SOPInstanceUID Only
    • Basic Image Display - Extract minimum attributes to display image (ImagePixel Module)
    • Basic Encoding Validation - make sure the entire dataset can be parsed (ignore data though)
    • Basic Metadata - extract basic metadata like patietn demographics, study description, etc
    • Metadata ingestion - parse all metadata fields
    • Pixel Ingestion - parse all pixel data
  • Data Variations
    • Transfer Syntaxes (Implicit Little Endian, Explicit Little Endian, Explicit Big Endian)
    • Pixel Data (uncompressed, compressed/encapsulated not fragmented, encapsulated fragmented)
    • Lengths (defined and undefined)
    • Sizes (large multiframe, small single frame)
    • Private Attributes (large, small)
    • Stream Parsing - full dataset, chunked, single bytes

Possible Future Functionality

  • Consider helpers to convert attribute data into rust types (e.g. strings, numbers, etc)
    • Note: meta_information already has functionality to convert to utf8 strings
  • Create handler that produces DICOM JSON?
  • Consider adding FilterHandler that filters out handler calls for specific attributes.
  • Consider adding TagCancelHandler to cancel parsing on specific tag (or tags)
  • Consider making a cancelled parse resumable? Should work given that the parser is streaming capable
  • Add P10StreamParser which provides a simplified interface for stream parsing by buffering data from incomplete parses
  • Consider adding a Handler that aggregates mutliple data callbacks into a single buffer
  • Explore ways to automate mapping from Handler to types in a struct, perhaps using macros?
    • would be nice to be able to do something like: !map(0x0020, 0x000D, &self.study_instance_uid);
    • could use this for creating the MetaInformation struct rather than a custom Handler

Refactorings

  • Separate undefined length logic from known length logic
    • SequenceItemDataParser->SequenceItemDataUndefinedLengthParser
    • SequenceParser -> SequenceUndefinedLengthParser
  • Refactor parse_tag_and_length() so we don't have two of them - perhaps replace with parse_attribute()?
  • replace unit test dependencies on actual P10 files with synthetic data

dicom-parser-rs's People

Contributors

chafey 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.