LDicomDS::GetBinaryValue

#include "Ltdic.h"

L_BOOL LDicomDS::GetBinaryValue(pElement, pValue, nLength)

Updates a buffer with a binary value.

Parameters

pDICOMELEMENT pElement

Pointer to a DICOMELEMENT structure within the Data Set.

L_VOID * pValue

Buffer that will be updated with the value of the binary value associated with the specified item in the Data Set. You are responsible for allocating the memory for this buffer.

L_UINT32 nLength

Length, in bytes, of the buffer you allocated.

Returns

Value Meaning
TRUE The function is able to update the buffer with the binary value.
FALSE The function cannot update the buffer with a binary value.

Comments

NOTE: You must allocate the memory for pValue.

The DICOMELEMENT structure has a member also called nLength. If this nLength value is greater than the nLength of the buffer you allocated (pValue), then the binary value copied into pValue will be truncated to the smaller length. If the nLength of the DICOMELEMENT is shorter than the nLength of pValue, the entire binary value associated with the DICOMELEMENT will be copied into pValue.

This function can be called for every Value Representation, and it will return the exact value in the Value Field (unconverted).

Required DLLs and Libraries

Platforms

Win32, x64

See Also

Functions

Topics

Example

This example gets the binary value for an element.

L_INT LDicomDS_GetBinaryValueExample() 
{ 
   LDicomDS      *pDS; 
   pDICOMELEMENT  pElement; 
   L_CHAR         szText[256]; 
 
   pDS = new LDicomDS(NULL); 
 
   pDS->InitDS( CLASS_XA_BIPLANE_IMAGE_STORAGE_RETIRED, 0);  
 
   pElement = pDS->FindFirstElement(NULL, TAG_PATIENT_NAME, FALSE); 
   if (pElement != NULL) 
   { 
      memset(szText, 0, sizeof(szText)); 
      pDS->GetBinaryValue(pElement, szText, sizeof (szText)-1); 
   } 
 
   delete pDS; 
 
   return DICOM_SUCCESS; 
} 

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