Download the PHP package rbraunm/class_dicom without Composer

On this page you can find all versions of the php package rbraunm/class_dicom. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package class_dicom

class_dicom.php

A PHP library for working with DICOM medical images. Handles tag reading and writing, JPEG conversion, compression, and DICOM networking (C-ECHO, C-STORE send and receive) by wrapping the DCMTK command-line toolkit.

Originally created by Dean Vaughan (deanvaughan.org).

Requirements

By default the library looks for DCMTK binaries in /usr/local/bin. If your installation is elsewhere, edit the TOOLKIT_DIR constant at the top of class_dicom.php.

On Debian/Ubuntu:

Installation

Composer

Manual

Copy class_dicom.php into your project and require it directly:

Usage

Reading DICOM tags

The constructor calls load_tags() automatically if the file exists and passes the is_dcm() check. Tags can also be loaded manually:

Writing DICOM tags

This modifies the file in place using dcmodify.

Converting DICOM to JPEG

Compression and decompression

Converting JPEG to DICOM

Known issue: jpg_to_dcm() treats any output from xml2dcm as a fatal error. The bundled XML template (examples/jpg_to_dcm.xml) produces a SOPInstanceUID mismatch warning on current DCMTK versions, which causes the function to return early without embedding pixel data. The resulting file is a valid DICOM header but contains no image. This will be fixed in v2.0.0.

The intended usage (once fixed) follows the pattern in examples/jpg_to_dcm.php:

The tag keys must match the (group,element) placeholders in the XML template. See examples/jpg_to_dcm.php for the full tag mapping.

Multiframe DICOM to video

Requires ffmpeg on the system.

DICOM networking

See examples/store_server.php, examples/store_server_handler.php, and examples/store_server_config.cfg for a working receive setup.

Utility functions

Testing

The test suite uses PHP + DCMTK for the code under test and Python for independent validation. This ensures DICOM files produced by the library are verified by a completely separate implementation, not just read back by the same tools that wrote them.

Test dependencies

Running tests

The test runner exercises every public method against real DICOM files:

API reference

Classes

Class Purpose
dicom_tag Read and write DICOM tags via dcmdump/dcmodify
dicom_convert Image format conversion, compression, thumbnails
dicom_net DICOM networking: C-ECHO, C-STORE SCU/SCP

Standalone functions

Function Purpose
is_dcm($file) Returns 1 if the file is valid DICOM, 0 otherwise
Execute($command) Shell execution wrapper (captures stdout + stderr)

Examples

The examples/ directory contains working scripts for common operations:

File Description
get_tags.php Read and display tags from a DICOM file
get_tags_webbased.php Same, formatted for browser output
write_tags.php Modify tags in a DICOM file
dcm_to_jpg.php Convert DICOM to JPEG
jpg_to_dcm.php Convert JPEG to DICOM with custom tags
jpg_to_dcm.xml XML template for JPEG-to-DICOM conversion
compress.php JPEG lossless compress a DICOM file
uncompress.php Decompress a DICOM file
send_dcm.php Send a DICOM file to a remote host
send_directory.php Send all files in a directory
store_server.php Start a DICOM receive server
store_server_handler.php Handler script called after each received file
store_server_config.cfg Configuration for the receive server

License

MIT


All versions of class_dicom with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package rbraunm/class_dicom contains the following files

Loading the files please wait ...