Showing results for 
Search instead for 
Do you mean 

How to programmatically retrieve the property name of an AOI object?

by Technical Evangelist on ‎08-18-2016 08:03 AM (346 Views)

Question

We have created a customized viewer program including the AOI tool palette using ERDAS IMAGINE functions. The AOI tools will be used to create various AOI objects and then modify the Name Property of the AOI objects. The program will retrieve various information about the AOI objects, but we can’t find the ERDAS IMAGINE function to retrieve the AOI property name programmatically.

Answer

Please use the eaoi_ReadAoiFromHfaFile() function, which will return the data structure. An example is included below:

 

Ehfa_File            *aoiFile = NULL;
Eaoi_AreaOfInterest  *aoi = NULL;
Eant_AnnotationInfo  *aInfo = NULL;

 

aoiFile = ehfa_FileOpen( "D:/work/Data/output/test.aoi", "rb", eint_GetInit(), &lclerr );
EERR_CHECK(lclerr , EFS0( "Evue_SelectViewer" ));                
      
aoi = eaoi_ReadAoiFromHfaFile( aoiFile, NULL, NULL, &lclerr );
EERR_CHECK(lclerr , EFS0( "Evue_SelectViewer" ));  

 

/*
aoi->objectlist[0] is the first element in the .aoi
aInfo->headElm->name.data will return the element name
*/

 

if (aoi->objectlist[0]->objecttype == EAOI_ANNOTATION_OBJECT)
{
      aInfo = ((Eaoi_AntAoiInfo *) (aoi->objectlist[0]->objectInfo))->antinfo;
}

Contributors