LDicomDS::CreateLayer

#include "Ltdic.h"

L_UINT16 LDicomDS::CreateLayer(pGraphicLayer, pLayerIndex)

Adds a new item under the "Graphic Layer Sequence" (0070,0060) in the Graphic Layer Module".

Parameters

pDICOMGRAPHICLAYER pGraphicLayer

Pointer to a Graphic Layer attributes structure, which holds the attributes of the layer to be created.

L_UINT * pLayerIndex

Pointer to a variable, which will be updated with the index of the newly created layer.

Returns

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

Comments

Before calling this function, initialize pDICOMGRAPHICLAYER->uStructSize to be sizeof(DICOMGRAPHICLAYER) and initialize all the structure members.

If for example there are already 2 items under the "Graphic Layer Sequence" (0070,0060) and we call this function, then the index of the new layer will be 2.

This function will fail and return DICOM_ERROR_PARAMETER if a layer with the same name as the new layer already exists in the dataset.

Required DLLs and Libraries

Platforms

Win32, x64

See Also

Functions

Topics

Example

L_INT LDicomDS_CreateLayerExample(LDicomDS& PresStateDS)  
 
{ 
   L_INT             nRet; 
   DICOMGRAPHICLAYER Layer;  
 
   memset(&Layer, 0, sizeof(DICOMGRAPHICLAYER));  
 
   L_TCHAR szText[256] = TEXT("\0"); 
   L_INT16 RGBColors[3];  
   L_INT16 pGrayScle[1];  
 
   pGrayScle[0] = 32767;  
 
   RGBColors[0] = 255;  
   RGBColors[1] = 255;  
   RGBColors[2] = 255;  
 
   Layer.nLayerOrder = 1;  
 
   Layer.pszLayerDescription = TEXT("First Layer"); 
 
   Layer.pszLayerName = TEXT("LAYER0"); 
 
   Layer.puGrayscale = pGrayScle;  
 
   Layer.pRGBLayerColors = NULL;  
 
   Layer.uStructSize = sizeof(DICOMGRAPHICLAYER);  
 
   L_UINT uLayerIndex;  
 
   nRet = PresStateDS.CreateLayer(&Layer, &uLayerIndex);  
 
   if (nRet == DICOM_SUCCESS)  
 
   { 
 
      wsprintf(szText, TEXT("Index of the new layer is: %u "), uLayerIndex);  
 
      MessageBox( NULL,  szText, TEXT("Note"), MB_OK);  
 
   } 
 
   return nRet; 
} 
Help Version 21.0.2021.7.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS DICOM C++ Class Library Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.