[ome-users] converting big ndpi-files

Melissa Linkert melissa at glencoesoftware.com
Sun Oct 4 23:11:57 BST 2015


Hi Felix,

> So re-parsing is the only way to create a new independent store?

Yes, that is currently the only way to get a complete deep copy.

Regards,
-Melissa

On Thu, Oct 01, 2015 at 03:35:34PM +0000, MEYENHOFER Felix wrote:
> Hi Melissa
> 
> thanks for the help.
> 
> > On 28 Sep 2015, at 15:57 , Melissa Linkert <melissa at GLENCOESOFTWARE.COM> wrote:
> > 
> > Hi Felix,
> > 
> >> I looked around a bit more and tried
> >> 	Metadata outMeta = service.createOMEXMLMetadata(inMeta.dumpXML());
> >> This seems to do a deep copy of the metadata. But this also copies everything. So I tried to find a way to select the metadata of a single series. The way I came up with so far is to use the getter methods for the different attributes to retrieve the information and then use the setters on the output metadata.
> >> However there are many attributes and soon we run into the trouble of having to figure out for instance the experimenter index before being able to retrieve the information.
> > 
> > The easiest thing to do is to copy everything, and then remove what you
> > don't want.  An example of this starts here:
> > 
> > https://github.com/openmicroscopy/bioformats/blob/develop/components/bio-formats-plugins/src/loci/plugins/out/Exporter.java#L344
> > 
> > and more concisely would look something like:
> > 
> > // ---
> > 
> > OMEXMLMetadata outMeta = service.createOMEXMLMetadata(inMeta.dumpXML());
> > OMEXMLMetadataRoot root = (OMEXMLMetadataRoot) outMeta.getRoot();
> > int seriesToKeep = 0; // change this to however you're selecting the series
> > List<Image> alLImages = root.copyImageList();
> > for (int i=0; i<allImages.size(); i++) {
> >  if (i != seriesToKeep) {
> >    root.removeImage(allImages.get(i));
> >  }
> > }
> > outMeta.setRoot(root);
> 
> That is what I was looking for.
> So re-parsing is the only way to create a new independent store?
> 
> Best, 
> 
> Felix
> _______________________________________________
> ome-users mailing list
> ome-users at lists.openmicroscopy.org.uk
> http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users



More information about the ome-users mailing list