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

Merge AxioVision channels

by adufour / Alexandre Dufour

This script asks the user for an experiment folder produced by Axiovision and will create a multi-channel tiff file from the separate channel files.

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.Saver)
importClass(Packages.icy.sequence.SequenceUtil)
importClass(Packages.icy.sequence.Sequence)
importClass(Packages.icy.file.Loader)
importClass(Packages.icy.file.FileUtil)
importClass(Packages.java.io.File)
importClass(Packages.plugins.tprovoost.scripteditor.uitools.filedialogs.FileDialog)

// select input folder
inputFolder = FileDialog.openFolder()
// cancelled
if (inputFolder == null) throw "Cancelled..."

// retrieve the sub-folders
paths = FileUtil.getFiles(inputFolder, null, false, true, false);

for(i = 0; i < paths.length; i++)
{
	// paths[i] = "/.../0025/
	if (!FileUtil.isDirectory(paths[i])) continue

	dataName = FileUtil.getFileName(paths[i]); // => 0025
	println("Processing dataset " + dataName)

	c1 = paths[i] + File.separator + dataName + "_c1.TIF"
	c2 = paths[i] + File.separator + dataName + "_c2.TIF"
	c3 = paths[i] + File.separator + dataName + "_c3.TIF"

	channels = []
	channels[0] = Loader.loadSequence(c1, 0, false)	
	channels[1] = Loader.loadSequence(c2, 0, false)	
	channels[2] = Loader.loadSequence(c3, 0, false)	

	merge = SequenceUtil.concatC(channels)
	newFile = inputFolder + File.separator + dataName + ".tif"
	Saver.save(merge, new File(newFile));
}
println("done.")

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



Icy script publication Id : S2G2P3