1. Go to this page and download the library: Download rbraunm/class_dicom library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
rbraunm / class_dicom example snippets
$d = new dicom_tag('/path/to/image.dcm');
$patient_name = $d->get_tag('0010', '0010');
$modality = $d->get_tag('0008', '0060');
// All loaded tags are available in $d->tags as an associative array
// keyed by "group,element" (e.g. "0010,0010")
$d = new dicom_tag;
$d->file = '/path/to/image.dcm';
$d->load_tags();
$c = new dicom_convert('/path/to/image.dcm');
// Decompress to a new file (or omit the argument to overwrite)
$c->uncompress('/path/to/output.dcm');
// JPEG lossless compress
$c->compress('/path/to/compressed.dcm');