Need help or advice ? Come to the Icy club ! - Every Wenesday morning from 9h30 to 12h30 - Francois Jacob Building - Main hall - Pasteur
Register

Rename Sequence Metadata

by tprovoost / Thomas Provoost

Sometimes, images metadata contains the same name, and thus are confusing for the user (two very different sequences with the same name). This changes the name in the metadata to the file name.

version 1 (last version):

download to use and modify in Icy. How do I use scripts ? A Problem ? ask the community.
Changelog for this version: initial version
importClass(Packages.icy.file.Loader)
importClass(Packages.plugins.tprovoost.scripteditor.uitools.filedialogs.FileDialog)
importClass(Packages.java.io.File)

importClass(Packages.icy.file.Saver)
importClass(Packages.loci.formats.ome.OMEXMLMetadataImpl)
importClass(Packages.icy.sequence.Sequence)
importClass(Packages.icy.main.Icy)

f = FileDialog.open()

if (f == null) throw "No file"

seq = Loader.loadSequence(f)

s = f.getName()

// get the metadata
meta = seq.getMetadata()

// iterate over the images
for (i = 0; i < meta.getImageCount(); ++i) {
        meta.setImageName(s, i)
}

seq.setName(s)

// Auto-Save
multipleFiles = false;
Saver.save(seq, f, multipleFiles)

// Load the sequence
Loader.load(f)

This script has no documentation. A Problem ? ask the community.



Icy script publication Id : M7Z3K6