定制 mmerlijn/dicom 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mmerlijn/dicom

最新稳定版本:v0.6

Composer 安装命令:

composer require mmerlijn/dicom

包简介

PHP DICOM

关键字:

README 文档

README

composer require mmerlijn/dicom

Usage

$filename = '_.dcm';
$dicom = \mmerlijn\dicom\Nanodicom::factory($filename);

$dicom->parse(array(array(0x0010, 0x0010)));
// Only a small subset of the dictionary entries were loaded
echo $dicom->profiler_diff('parse')."<br>";

echo 'Patient name if exists: '.$dicom->value(0x0010, 0x0010)."<br>"; // Patient Name if exists

// This will return nothing because dictionaries were not loaded
echo 'Patient name should be empty here: '.$dicom->PatientName."<br>";

Store jpg file

use mmerlijn\dicom\Nanodicom;

$filename = '_.dcm';

$dicom  = Nanodicom::factory($filename, 'Pixeler');
if ( ! file_exists($filename.'.0.jpg'))
{
try {

        $images = $dicom->get_images();
    }catch (Exception $e) {
        echo "Error: ".$e->getMessage()."\n";
        exit;
    }

    // If using another library, for example, imagemagick, the following should be done:
    // $images = $dicom->set_driver('imagick')->get_images();

    if ($images !== FALSE)
    {
        foreach ($images as $index => $image)
        {
            // Defaults to jpg
            $dicom->write_image($image, 'dump.0.jpg');
            // To write another format, pass the format in second parameter.
            // This will write a png image instead
            // $test->write_image($image, $dir.$file.'.'.$index, 'png');
        }
    }
    else
    {
        echo "There are no DICOM images or transfer syntax not supported yet.\n";
    }
    $images = NULL;
}
else
{
echo "Image already exists\n";
}
unset($dicom);

统计信息

  • 总下载量: 29
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-05-14