Skip to content

Instantly share code, notes, and snippets.

@nanodocumet
Created May 31, 2014 04:01
Show Gist options
  • Save nanodocumet/20024eee1321c3571c0c to your computer and use it in GitHub Desktop.
Save nanodocumet/20024eee1321c3571c0c to your computer and use it in GitHub Desktop.
<?php
ini_set('display_errors', 'On');
error_reporting(E_ALL | E_STRICT);
require 'nanodicom.php';
// test file is relative to current directory
$filename = '1.2.826.0.1.3680043.2.1227.180222088.13140515165842.0.dcm';
$dicom = Nanodicom::factory($filename);
$dicom->parse();
$GAseq = $dicom->value(0x0070, 0x0001);
$GAitems = $dicom->read_sequence_items( $GAseq );
foreach( $GAitems as $gaitem )
{
$GraphicLayer = $dicom->dataset_value( $gaitem, 0x0070, 0x0002);
$TOSeq = $dicom->dataset_value( $gaitem, 0x0070, 0x0008);
if ($TOSeq)
{
$TOitems = $dicom->read_sequence_items($TOSeq);
foreach( $TOitems as $toitem )
{
echo "Yes!!";
}
}
}
unset($dicom);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment