dcmjs-org/dcmjs/docs
Claude Code and agent skill by dcmjs-org/dcmjs
- community
Checking that the SKILL.md file is still in the repository.
Install
npx vskill@latest install dcmjs-org/dcmjs/docsSKILL.md
AsyncDicomReader Skill Guide
Overview
The AsyncDicomReader is an asynchronous binary DICOM file reader that provides streaming capabilities for parsing DICOM files. It's designed to handle large DICOM files efficiently by reading and processing data incrementally rather than loading entire files into memory at once.
Key Features
- Asynchronous/Streaming: Reads DICOM files incrementally using async/await patterns
- Memory Efficient: Uses buffer streaming with automatic clearing to reduce memory footprint
- Multiple Transfer Syntaxes: Supports Explicit Little Endian, Explicit Big Endian, and Implicit Little Endian as well as compressed syntaxes.
- Pixel Data Handling: Handles both compressed and uncompressed pixel data
- Sequence Support: Properly parses DICOM sequences with defined and undefined lengths
- Character Set Support: Automatically handles different character encodings, but not multiple character encodings.
- Error Handling: Configurable error handling for malformed files
Current Limitations
- Files must contain the standard DICM preamble
- Interface is preliminary and subject to change
Basic Usage
Reading a Complete DICOM File
Reading with Custom Options
Using Custom Listeners
The reader uses a listener pattern to build the DICOM dataset. You can implement custom listeners to control how data is processed:
Architecture
Core Components
- BufferStream: Manages the underlying data buffer with automatic memory management
- Listener Pattern: Uses listeners to build the dataset incrementally
- Tag Reading: Parses DICOM tags with proper VR (Value Representation) handling
- Transfer Syntax Detection: Automatically detects and adapts to file transfer syntax
Reading Process
The reader follows this sequence:
- Preamble & Marker (128 bytes + "DICM")
- File Meta Information (Group 0x0002)
- Transfer Syntax Detection (from meta info)
- Dataset Reading (main DICOM data)
Advanced Usage
Reading Specific Sections
Reading Only Meta Information
Reading Until Specific Tag
Handling Pixel Data
The reader automatically detects compressed vs uncompressed pixel data:
Uncompressed Pixel Data
Compressed Pixel Data
Working with Sequences
Sequences are automatically parsed with proper nesting:
Performance Considerations
Memory Management
The reader uses automatic buffer clearing to minimize memory usage:
Streaming Large Files
For very large files, the async nature prevents blocking:
Error Handling
Handling Malformed Files
Validation
API Reference
Constructor
Options:
isLittleEndian(boolean): Force specific endiannessclearBuffers(boolean): Enable automatic buffer clearing (default: true)- Additional options passed to
ReadBufferStream
Methods
async readPreamble()
Reads the 128-byte preamble and DICM marker.
Returns: Promise<boolean> - true if DICM marker found
async readFile(options)
Reads the entire DICOM file including meta information and dataset.
Options:
listener(DicomMetadataListener): Custom listener for dataset buildingignoreErrors(boolean): Continue reading despite errorsmaxSizeMeta(number): Maximum bytes to read for meta header
Returns: Promise<AsyncDicomReader> - The reader instance
async readMeta(options)
Reads only the file meta information (Group 0x0002).
Options:
maxSizeMeta(number): Maximum bytes for meta header (default: 10KB)ignoreErrors(boolean): Allow reading files with malformed meta
Returns: Promise<Object> - Meta information dictionary
async read(listener, options)
Reads the dataset portion using the provided listener.
Parameters:
listener(DicomMetadataListener): Listener to build datasetoptions.untilOffset(number): Stop reading at specific byte offset
Returns: Promise<Object> - Parsed dataset
readTagHeader(options)
Reads a single tag header (tag, VR, length).
Options:
untilTag(string): Stop when reaching this tagincludeUntilTagValue(boolean): Include the stop tag's value
Returns: Object - Tag information with structure:
Properties
syntax(string): Current transfer syntax UIDmeta(Object): File meta information dictionarydict(Object): Dataset dictionarystream(ReadBufferStream): Underlying buffer streamlistener(DicomMetadataListener): Current listener instance
Common Patterns
Extract Specific Tags
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingdocs/AsyncDicomReader-skill.md
Popularity
- Repository stars
- 345
- Repository forks
- 131
- Repository npm downloads, 7 days
- 36,133
- 7-day trend score
- 53
Stars and forks are for the whole GitHub repository, not this skill alone. Downloads are for the repository's npm package. Refreshed 19 Mar 2026, 7 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/dcmjs-org/dcmjs/docs)