AnnotationRef is not in Image tag
Posted: Thu Sep 20, 2018 11:51 pm
Hi Team,
I am using Matlab to call java obj/functions to add MapAnnotation into ometiff file. But in the result ometiff xml, AnnotationRef is not in the Image tag but instead in StructuredAnnotations tag:
This is part of the code I am using to add the MapAnnotation:
Could anyone give me a solution to place AnnotationRef into Image tag but not in StructuredAnnotations tag using matlab calling java way ?
I am using Matlab to call java obj/functions to add MapAnnotation into ometiff file. But in the result ometiff xml, AnnotationRef is not in the Image tag but instead in StructuredAnnotations tag:
- Code: Select all
<StructuredAnnotations>
<MapAnnotation Annotator="test_Annotator" ID="Annotation:1" Namespace="test_Namespace">
<Description>
test_Description
</Description>
<AnnotationRef ID="Annotation:1"/>
<Value>
<M K="test1">
value1
</M>
<M K="test2">
value2
</M>
</Value>
</MapAnnotation>
</StructuredAnnotations>
This is part of the code I am using to add the MapAnnotation:
- Code: Select all
OMEXMLService = javaObject('loci.formats.services.OMEXMLServiceImpl');
metadata = OMEXMLService.createOMEXMLMetadata();
...
pairList=java.util.ArrayList;
pairList.add(ome.xml.model.MapPair('test1','value1'));
pairList.add(ome.xml.model.MapPair('test2','value2));
metadata.setMapAnnotationID('Annotation:1',0);
metadata.setMapAnnotationDescription('test_Description',0);
metadata.setMapAnnotationNamespace('test_Namespace',0)
metadata.setMapAnnotationValue(pairList,0);
metadata.setMapAnnotationAnnotator('test_Annotator',0)
metadata.setMapAnnotationAnnotationRef('Annotation:1',0,0);
...
bfsave( omeimg, test.ome.tif, 'metadata', metadata, 'Compression', 'LZW' );
Could anyone give me a solution to place AnnotationRef into Image tag but not in StructuredAnnotations tag using matlab calling java way ?