Skip to content

Instantly share code, notes, and snippets.

@whatalnk
Created March 13, 2017 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save whatalnk/75dc1cb25c4e1dfd4bee51951f84e0a7 to your computer and use it in GitHub Desktop.
Save whatalnk/75dc1cb25c4e1dfd4bee51951f84e0a7 to your computer and use it in GitHub Desktop.
ImageJ API TextRoi
from __future__ import with_statement, print_function
from ij import IJ
from ij.gui import Overlay, Line, TextRoi
import java.lang.Boolean as JBool
from java.awt import Font
imp = IJ.getImage()
selection = Line(1200, 2500, 2500, 2500)
textroi = TextRoi(selection.x1, selection.y1, "text", Font("Consolas", Font.PLAIN, 300))
overlay = Overlay()
overlay.add(selection)
overlay.add(textroi)
imp.setOverlay(overlay)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment