Skip to content

Instantly share code, notes, and snippets.

@nanodocumet
Created May 9, 2011 18:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nanodocumet/963030 to your computer and use it in GitHub Desktop.
Save nanodocumet/963030 to your computer and use it in GitHub Desktop.
Loading values of Nanodicom by array
<?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