LIsis::GetTagASCIIChoice

#include "ltwrappr.h"

virtual L_INT LIsis::GetTagASCIIChoice(uTag, nIndex, pszValue, puSize)

L_UINT uTag;

/* ASCII tag */

L_INT32 nIndex;

/* index value */

L_CHAR *pszValue;

/* character string */

L_UINT32 *puSize;

/* size of the string */

Gets the number of possible values (or choices), or gets the value at the specified index, for the specified ISIS Scanner Driver ASCII Tag. This function is available in the Document/Medical Toolkits.

Parameter

Description

uTag

Value indicating the tag for which to get the specified value, or the number of possible values. For a list of possible tags, refer to ISIS ASCII tags.

nIndex

Index into an array of possible values (or choices) for the specified ASCII tag. This value must be between 0 and the maximum number of values/choices - 1. Pass ISIS_DEFAULT to update puSize with the maximum number of available values/choices for the specified tag.

pszValue

Character string to be updated with the value at the specified index.

puSize

Pointer to a variable that contains the size of the string. If pszValue is NULL, then, puSize will be updated with the required size of the string for the specified tag value.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

ISIS tags can have multiple values, also called choices. This function can be used to get the maximum number of available values/choices, or to get individual values.

To get the maximum number of available values/choices, pass ISIS_DEFAULT for nIndex. The puSize parameter will be updated with the number of available values/choices.

The user is responsible for allocating storage for pszValue and for freeing that memory when pszValue is no longer needed.

To determine the size of the value string, call this function with pszValue set to NULL and nIndex set to the desired value. The puSize parameter will be updated with the necessary size. Then, call this function again, with the correct size in the puSize parameter and pszValue will be updated with the value string.

If a valid pointer is passed for the pszValue parameter, then puSize must contain the correct size for the string pointed to by pszValue.

Required DLLs and Libraries

LTISI

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

LIsis::GetTagASCII, LIsis::SetTagASCII, LIsis::GetTagLong, LIsis::SetTagLong, LIsis::GetTagLongChoice, LIsis::GetTagShort, LIsis::SetTagShort, LIsis::GetTagShortChoice

Topics:

Raster Image Functions: Scanning Images using ISIS

 

Using ISIS to Scan Images

Example

L_VOID IsisASCIITagsChoicesExample(LIsis & Isis)
{
   L_UINT32 uSize;
   L_CHAR * pszTagChoice;
   L_UINT32 uChoicesCount;
   L_CHAR szMessage[512];

   // Get the number of choices available for TAG_PAGESIZE
   Isis.GetTagASCIIChoice(TAG_PAGESIZE, ISIS_DEFAULT, NULL, 
              &uChoicesCount);

   wsprintfA(szMessage, "There are %u choices for TAG_PAGESIZE", 
 uChoicesCount);
   MessageBoxA(NULL, szMessage, "ASCII Tags Choices Example", MB_OK);

   /* Get and display each choice of TAG_PAGESIZE */
   for (L_UINT32 x = 0; x < uChoicesCount; x++)
   {
      Isis.GetTagASCIIChoice(TAG_PAGESIZE, x, NULL, &uSize);
      if (uSize > 0)
      {
         pszTagChoice = new L_CHAR[++uSize];
         Isis.GetTagASCIIChoice(TAG_PAGESIZE, x, pszTagChoice, &uSize);
         wsprintfA(szMessage, "Choice %u is: %s", x, pszTagChoice);
         MessageBoxA(NULL, szMessage, "ASCII Tags Choices Example", 
        MB_OK);
         delete [] pszTagChoice;
      }
   }
}