The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

DicomReader - A module to read Dicom Files

SYNOPSIS

    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();

DESCRIPTION

This module reads a Dicom file.

Methods

new

Returns a new DicomReader object.

Input Parameter:
  1. A path to a dicom file.

getValue

Get the value of a specified dicom field.

Input Parameters:
  1. Dicom tag path. Format: "TagID or TagName/SequenceNumber/TagID or TagName/SequenceNumber", e.g.,"300a,0230/0/300a,0280/2/1001,01ff/0/MaterialID".

  2. 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').

Return Value:

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.

Return Value:

A hash ref pointing to the root structure of the dicom fields.

showDicomField

Display the structure of a dicom field structure.

Input Parameter(s):
  1. Verbose level. Available values: 0, 1, 2. Default value: 0.

  2. 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.

Input Parameter(s):
  1. A string containing a dicom field.

Return Value:

A Dicom field structure.

isLittleEndian

Check the endianness of the current Dicom field structure.

Return Value:

When true, little endianness; otherwise, big endianness.

isImplicitVR

Check if the current Dicom field structure is implicitly VRed.

Return Value:

When true, implicit VR; otherwise, explicit VR.

AUTHOR

Baoshe Zhang, MCV Medical School, Virginia Commonwealth University