Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Open an XML file saved by Cell Counter as an ImageJ PointRoi (ignoring stack position)
/*
* Open an XML file saved by Cell Counter as an ImageJ PointRoi (ignoring stack position)
*
* (see https://forum.image.sc/t/convert-cell-counter-markers-to-multi-point/23844?u=imagejan)
*/
#@ ImagePlus imp
#@ File input
import groovy.util.XmlParser
import ij.gui.PointRoi
roi = new PointRoi()
parser = new XmlParser()
doc = parser.parse(input)
doc.Marker_Data.Marker_Type.each {
roi.setCounter( it.Type[0].text() as int )
it.Marker.each {
roi.addPoint( it.MarkerX[0].text() as int, it.MarkerY[0].text() as int )
}
}
roi.setShowLabels(true)
imp.setRoi(roi)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.