Data Translation
Data Translation Knowledge Base
Home / All Categories / Imaging Software / GLOBAL LAB Image/2
KB HomeKnowledge Base Home | SearchSearch | GlossaryGlossary

How to access variables with the Global Lab Image/2 API

GLI/2 & DTVF API Example Code, Global Lab Image/2" "In building a custom tool, I would like to access the variables within GLI/2. I am referring to the point and click script variables and variables generated by other tools (for example, the centroid value generated by a blob analysis or the input from a text prompt tool.) The API documentation, explains that it is easy to get pointers of ROIs and images, but did not mention how to access the variables. How can I access the variables in coding?" "The variables in GLI2 are saved in two linked list. The following code sample shows how to get a pointer to the list and how to create a new variable in coding.

//Get Pointers to main apps object lists

m_pCListNumber = (CcList *)::SendMessage( m_hActiveViewport,HL_REQUEST,HLR_SUPPLY_LIST_BY_NAME,(LPARAM)""Number"" );

m_pCListString = (CcList *)::SendMessage( m_hActiveViewport,HL_REQUEST,HLR_SUPPLY_LIST_BY_NAME,(LPARAM)""String"" );

if( m_pCListNumber-GetViaName("MyVariable") == NULL )

if( m_pCListNumber->

{
CNumber = new CcNumber();
if(CNumber == NULL) return(-1);
CNumber-SetName("MyVariable");
CNumber->m_pCListNumber-InsertTail(CNumber);
}
m_pCListNumber->
  *Created: 11/10/05.

Copyright © 2013 Data Translation, Inc. All rights reserved.