Last active
December 25, 2015 20:19
-
-
Save nanodocumet/7034466 to your computer and use it in GitHub Desktop.
Sample code to read values from sequences. Should be incorporated into core to handle it natively.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require 'Nanodicom/nanodicom.php'; | |
$filename = 'test.DCM'; | |
$dicom = Nanodicom::factory($filename); | |
$dicom->parse(array(array(0x0010, 0x0010), array(0x0054, 0x0016))); | |
// Get the sequence | |
$seq = $dicom->value(0x0054, 0x0016); | |
// Get the items (sequences are grouped in items) | |
$items = $dicom->dataset_value($seq, 0xFFFE, 0xE000); | |
// Get the value wanted | |
$val = $dicom->dataset_value($items, 0x0018, 0x0031); | |
var_dump($val); | |
unset($dicom); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment