show tag info on picture

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

show tag info on picture

rednef
Is it possible to select a tag and show it on the picture, i.e. show the [0008,1030] Study Description as text on the picture?
Reply | Threaded
Open this post in threaded view
|

Re: show tag info on picture

Rasband, Wayne (NIH/NIMH) [E]

> On Aug 22, 2016, at 4:47 AM, rednef <[hidden email]> wrote:
>
> Is it possible to select a tag and show it on the picture, i.e. show the
> [0008,1030] Study Description as text on the picture?

You can do this using a macro. For example, this macro opens the “CT” sample image, retrieves the Study Description tag and displays it as an overlay:

   run("CT (420K, 16-bit DICOM)");
   desc = getInfo("0008,1030");
   Overlay.drawString(desc, 5, 25);
   Overlay.show;

And here is a JavaScript version:

  img = IJ.openImage("http://wsr.imagej.net/images/ct.dcm.zip");
  desc = img.getStringProperty("0008,1030");
  font = new Font("SanSerif", Font.PLAIN, 18);
  text = new TextRoi(10, 10, desc, font);
  text.setStrokeColor(Color.yellow);
  overlay = new Overlay();
  overlay.add(text);
  img.setOverlay(overlay);
  img.show();

-wayne




--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html