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

Micro-Manager continous acquisition on crops

by stef / Stephane Dallongeville

This script take ROI(s) from an input image and create cropped image(s) from it / them then continuously acquire and update crops.

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.sequence.Sequence)
importClass(Packages.icy.image.IcyBufferedImage)
importClass(Packages.icy.image.IcyBufferedImageUtil)
importClass(Packages.plugins.tprovoost.Microscopy.MicroManager.MicroManager)

// get acquired image containing ROIs
acquiredSeq = getSequence()
// get image type
dataType = acquiredSeq.getDataType_()
// get rois
rois = acquiredSeq.getROIs()

cropImages = []

// create result image
for(r = 0; r < rois.size(); r++)
{
	roi = rois.get(r)
	bnd = roi.getBounds5D()
	img = new IcyBufferedImage(bnd.getSizeX(), bnd.getSizeY(), 1, dataType)

	// store image
	cropImages[r] = img

	// create sequence
	s = new Sequence(img)
	// change sequence name
	s.setName("image" + r + " - " + roi.getName())
	// show it
	gui.addSequence(s)
}


while(true)
{
	// snap image
	newImage = MicroManager.snapImage()

	for(r = 0; r < rois.size(); r++)
	{
		roi = rois.get(r)
		bnd = roi.getBounds5D().toRectangle2D().getBounds()
		
		img = cropImages[r]
		img.copyData(newImage, bnd, null)
	}

	// do processig here on cropped images
}

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



Icy script publication Id : E4Q6U8