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

NAME

DicomWriter - A module to create a dicom file from dicom fields

SYNOPSIS

    use DicomPack::IO::DicomWriter;

    my $dicomFields = ...;  # dicomFields is the output of DicomReader->getDicomField().

    my $writer = DicomPack::IO::DicomWeader->new($dicomFields); # dicomFields can be undefined.

    # set PatientName to a new value
    $writer->setValue("PatientName", "DicomTest");

    # assign a value to "300a,0230/x/300b,100". 'x' used to add a new sequence item
    $writer->setValue("300a,0230/x/300b,100", "aValue");

    # use the current Dicom field structure to create a Dicom file.
    $writer->flush($dicomFile);

DESCRIPTION

This module creates a Dicom file.

Methods

new

Returns a new DicomWriter object.

Input Parameter(s):
  1. A template Dicom field structure (optional). If there is a template Dicom file, use DicomReader to read a template Dicom file and getDicomField() to get the template Dicom field structure as the input of new().

setValue

Set or change the value of a specified Dicom field, or create a dicom field. If sequence number is 'x', add a new sequence item.

Input parameter(s):
  1. Dicom tag path. See the doc of getValue of DicomReader for details about format.

  2. An array reference pointing to the values, or a scalar value.

  3. The name of VR (optional). For explicit VR, if missing, default VR will be used.

flush

Use the current Dicom field structure to create a new Dicom file.

Input parameter(s):
  1. A path to an output dicom file.

showDicomField

Display the structure of a dicom field structure.

Input parameter(s):
  1. Verbose level. Available values: 0, 1, 2. By default, 0.

  2. A dicom field structure (optional). If no dicom field structure is specified, use the root dicom field structure.

AUTHOR

Baoshe Zhang, MCV Medical School, Virginia Commonwealth University