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

Micro-Manager Sequence acquisition with threshold

by stef / Stephane Dallongeville

This java script show how to perform a timelaps (20 frames) and Z-Stack acquisition trough Micro-Manager and applying auto K-Means auto threshold on result.

WARNING: You need to start Micro-Manager for Icy plugin before executing the script.

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.plugins.adufour.thresholder.KMeans)
importClass(Packages.plugins.adufour.thresholder.Thresholder)
importClass(Packages.icy.sequence.Sequence)
importClass(Packages.plugins.tprovoost.Microscopy.MicroManager.tools.StageMover)
importClass(Packages.plugins.tprovoost.Microscopy.MicroManager.MicroManager)

sequence = new Sequence()               // create the result sequence
gui.addSequence(sequence)		// display it

StageMover.moveXYAbsolute(5, 5)         // move microscope to position XY (5, 5)

for(t = 0; t < 20; t++)
{
	MicroManager.setExposure(10 + (t * 5))	// set exposure depending T position
	
	for(z = 0; z < 10; z++)
	{
		StageMover.moveZAbsolute(-5 + z, true)  // set microscope Z position by 10
		image = MicroManager.snapImage()        // acquire 1 image
		sequence.setImage(t, z, image)       	// set it in resulting sequence at position 0
	}
}

value = KMeans.computeKMeansThresholds(sequence, 0, 2, 256)
rois = Thresholder.threshold(sequence, 0, value)

for(i = 0; i < rois.length; i++)
	sequence.addROI(rois[i])

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



Icy script publication Id : D3J7Y1