File_DICOM::getValue

File_DICOM::getValue() – Gets the value for a DICOM element.

Synopsis

require_once 'File/DICOM.php';

mixed File_DICOM::getValue ( mixed $group_or_name , integer $element = null )

Description

Gets the value for a DICOM element of a given group from the parsed DICOM file

Parameter

mixed $group_or_name

The group the DICOM element belongs to (integer), or its name (string)

integer $element

The identifier for the DICOM element (unique inside a group). Optional

Return value

returns The value for the DICOM element on success, PEAR_Error on failure

Note

This function can not be called statically.

Example

Using getValue()

<?php
require_once('File/DICOM.php');

$dicom_file = new File_DICOM();
$res $dicom_file->parse('test.dcm');

// check for errors
if (PEAR::isError($res)) {
    die(
$res->getMessage());
}

echo 
'this value: '.$dicom_file->getValue('PatientName')."\n";
echo 
'Should be the same as this value: '.$dicom_file->getValue(0x00100x0010)."\n";
?>
Write current contents to a DICOM file. (Previous) Sets the value for a DICOM element. (Next)
Last updated: Sat, 16 Feb 2019 — Download Documentation
Do you think that something on this page is wrong? Please file a bug report.
View this page in:
  • English

User Notes:

There are no user contributed notes for this page.