DicomReader - A module to read Dicom Files
use DicomPack::IO::DicomReader; my $dicomFile = "your dicom file"; # get a DicomReader object my $reader = DicomPack::IO::DicomReader->new($dicomFile); # show the content of the Dicom file to std. $reader->showDicomField(2); # get patient name my $patientName = $reader->getValue("PatientName"); # get the value of a complex structure. Return value is a sub Dicom field. my $aDicomField = $reader->getValue("300a,0230/0/300a,0280/2/1001,01ff"); # show the above dicom structure to std. $reader->showDicomField(2, $aDicomField); # get the root Dicom field structure. my $rootDicomField = $reader->getDicomField();
This module reads a Dicom file.
new
Returns a new DicomReader object.
A path to a dicom file.
getValue
Get the value of a specified dicom field.
Dicom tag path. Format: "TagID or TagName/SequenceNumber/TagID or TagName/SequenceNumber", e.g.,"300a,0230/0/300a,0280/2/1001,01ff/0/MaterialID".
mode (optional). When mode is 'native', the return value is in the native binary format prefixed 'vr:' (where vr is the VR value, e.g., 'UI').
The value of the specified dicom field or a hash ref or an array ref.
getDicomField
Get a hash ref pointing to the root structure of the dicom fields.
A hash ref pointing to the root structure of the dicom fields.
showDicomField
Display the structure of a dicom field structure.
Verbose level. Available values: 0, 1, 2. Default value: 0.
A dicom field structure (optional). If no dicom field structure is specified, use the root dicom field structure.
parseDicomString
Parse a string containing a Dicom binary field. The whole content of a Dicom file can be used as an input string.
A string containing a dicom field.
A Dicom field structure.
isLittleEndian
Check the endianness of the current Dicom field structure.
When true, little endianness; otherwise, big endianness.
isImplicitVR
Check if the current Dicom field structure is implicitly VRed.
When true, implicit VR; otherwise, explicit VR.
Baoshe Zhang, MCV Medical School, Virginia Commonwealth University
To install DicomPack::IO::CommonUtil, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DicomPack::IO::CommonUtil
CPAN shell
perl -MCPAN -e shell install DicomPack::IO::CommonUtil
For more information on module installation, please visit the detailed CPAN module installation guide.