LDicomDS::AnnSave

#include "ltdic.h"

L_UINT16 LDicomDS::AnnSave(hAnnContainer, uFormat, bSelected, pSaveOption, nIndex, pnPrivateCreatorTag)

Saves annotations as private data in a DICOM data set.

Parameters

HANNOBJECT hAnnContainer

Handle to the root annotation object that includes all objects to save in the file. This typically is a container object.

L_UINT uFormat

Format for saving annotation data. Possible values are:

Value Meaning
ANNFMT_NATIVE This format is no longer supported.
ANNFMT_ENCODED This format is no longer supported.
ANNFMT_XML [0x0005] Save as an XML text format. This is currently the only supported format.

L_BOOL bSelected

Flag that indicates which objects to save. Possible values are:

Value Meaning
TRUE Save all objects that have the selected property set to TRUE. For setting the selected property, call the LAnnotation::SetSelected function.
FALSE Save only the specified object.

pSAVEFILEOPTION pSaveOption

Pointer to a SAVEFILEOPTION structure that contains optional extended save options. This information is used to add annotation pages or replace annotation pages in a multipage annotation file. Pass NULL to save a one page annotation file.

L_INT nIndex

Index of the annotation file to save. This is an index into an array of annotation files stored in the DICOM data set. Each DICOM data set can store up to 256 annotation files. This is a zero-based index. Valid values are between 0 and 255.

L_UINT32 *pnPrivateCreatorTag

Pointer to a private creator tag. You can specify a private creator tag, or pass NULL to have the tag automatically created.

Returns

Value Meaning
0 SUCCESS
>0 An error occurred. Refer to Return Codes.

Comments

LEAD Annotation files can be saved as private data in a DICOM data set (LEAD native format or binary encoded format). There can be up to 256 private data tags for LEAD annotation files. Specify one of the 256 possible files by setting the nIndex parameter to be a value from 0 to 255.

You can select the private creator tag (and therefore the private tags) or have the private creator tag automatically chosen.

To choose a private creator tag, do the following:

  1. Declare a variable of type L_UINT32. For example: L_UINT32 uPrivateCreatorElement
  2. Set the value to the desired tag and element.

    • Note that private creator tags must follow the following format: (gggg, 0010-00FF) where gggg is odd
    • This reserves 256 private data elements.  For example: uPrivateCreatorElement = 0x00710043
    • This particular private creator tag reserves the elements 0x00714300 through 0x007143FF
  3. Pass the address of uPrivateCreatorElement as the last argument (pnPrivateCreatorTag)

To choose the group but not the element of a private creator tag, do the following:

  1. Declare a variable of type L_UINT32. For example: L_UINT32 uPrivateCreatorElement
  2. Set uPrivateCreatorElement as follows: (gggg0000) where gggg is odd
  3. Pass the address of uPrivateCreatorElement as the last argument (pnPrivateCreatorTag)
  4. If successful, the private creator tag (group and element) will be returned in uPrivateCreatorElement

To have the private creator tag automatically chosen and returned, do the following:

  1. Declare a variable of type L_UINT32. For example: L_UINT32 uPrivateCreatorElement
  2. Set uPrivateCreatorElement = 0
  3. Pass the address of uPrivateCreatorElement as the last argument (pnPrivateCreatorTag)
  4. If successful, the private creator tag (group and element) will be returned in uPrivateCreatorElement

To have the private creator tag automatically chosen but not returned, do the following:

To insert new pages to an annotation multipage file:

  1. Declare a variable of type SAVEFILEOPTION.
  2. Set the uFlags field of the SAVEFILEOPTION structure to ESO_INSERTPAGE.
  3. Set the PageNumber field of the SAVEFILEOPTION structure to the location for insertion. The new page will be inserted in front of the page specified in the PageNumber field.

To replace an existing page in an annotation multipage file:

  1. Declare a variable of type SAVEFILEOPTION.
  2. Set the uFlags field of the SAVEFILEOPTION structure to ESO_REPLACEPAGE.
  3. Set the PageNumber field of the SAVEFILEOPTION structure to the page to replace.

To delete a page from an annotation multipage file, or to delete the entire annotation file, call LDicomDS::AnnDelete.

NOTE: Both DICOM and DOCUMENT capabilities must be unlocked in order to work with DICOM annotations. For more information on unlocking these capabilities, refer to LSettings::SetLicenseFile.

Required DLLs and Libraries

Platforms

Win32, x64

Help Version 20.0.2020.4.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2020 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS DICOM C++ Class Library Help