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

ROI export to Excel

by fab / Fabrice de Chaumont

This script exports the ROI infos to an excel file. Here we just show it as an example for min, mean and max intensity for each ROI.

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.tprovoost.scripteditor.uitools.filedialogs.FileDialog)
importClass(Packages.plugins.tprovoost.scripteditor.uitools.userdialogs.Dialog)
importClass(Packages.icy.file.FileUtil)
importClass(Packages.icy.util.XLSUtil)
importClass(Packages.icy.roi.ROIUtil)

sequence = getSequence()

if ( sequence == null ) throw "No sequence opened."

println( sequence.getName() )

println( sequence.getSizeC() )

listROI = sequence.getROIs()

workbook = XLSUtil.createWorkbook( FileDialog.open() )

page = XLSUtil.createNewPage( workbook, "my result page")

for ( i = 0 ; i < listROI.size() ; i++ )
{
	roi = listROI.get( i )
	println ("------ " + roi.getName() )

	meanIntensity = ROIUtil.getMeanIntensity(sequence, roi)
	minIntensity = ROIUtil.getMinIntensity(sequence, roi)
	maxIntensity = ROIUtil.getMaxIntensity(sequence, roi)

	println( minIntensity + "\t" + maxIntensity + "\t" + meanIntensity)

	XLSUtil.setCellNumber( page , 0, i, minIntensity )
	XLSUtil.setCellNumber( page , 1, i, maxIntensity )
	XLSUtil.setCellNumber( page , 2, i, meanIntensity )

}

XLSUtil.saveAndClose(workbook)


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



Icy script publication Id : D8Z7R4