Created
May 9, 2011 18:15
Loading values of Nanodicom by array
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 | |
try | |
{ | |
// Load and parse the file | |
$dicom = Nanodicom::factory($filename); | |
$dicom->parse(); | |
$mode = 'LO'; | |
// Do the Query | |
$sql = "SELECT * FROM premier_forms.dicom WHERE RV = '$mode' "; | |
$rs = mysql_query($sql); | |
// Browse result | |
while($row = mysql_fetch_array($rs)) | |
{ | |
// Get element and group from column | |
list($element, $group) = sscanf($row['Tag'], "(%X,%X)"); | |
// Print the value | |
echo $row['Attribute_Name'].': '.$dicom->value($element, $group).'<br>'; | |
} | |
// Release memory | |
unset($dicom); | |
} | |
catch (Nanodicom_Exception $e) | |
{ | |
// Catach exception | |
echo 'File failed. '.$e->getMessage()."\n"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment