Short Description

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.

Versions

  • Version 1 • Released on: 2014-02-19 11:47:00
    Download
    Description:

    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)
    
    
    

Leave a Review