Re: saving a "infor for..." file for a dicom image

Posted by Wayne Rasband on
URL: http://imagej.273.s1.nabble.com/saving-a-infor-for-file-for-a-dicom-image-tp3703232p3703233.html

> I was wondering if someone could help me with answering a question  
> regarding running a macro from ImageJ. I am sure there is nothing  
> wrong with the macro itself but may be something with the way  
> ImageJ is set-up because the same txt file runs fine on another  
> computer but gives an error on my computer. I am on Linux x86 and  
> running the latest version of ImageJ 1.36.

> while running the macro, it gives me an error at the point where im  
> trying to save a "Info for.." file (as a text file) for a  DICOM  
> image both of which are open , however it doesnt seem to recognise  
> that the "info for" file is open and gives the error
>
> " This command requires a TextWindow such as the "Log" window or an  
> "Info  for..." window". Could anyone suggest as to why this might  
> be happening and a way to correct it. Thanks !

You can save the information displayed by the Image>Show Info command  
without opening a text window using this macro:

     info = getImageInfo();
     f= File.open(getDirectory("home")+"info.txt");
     print(f, tags);

The information is saved in the users home directory in a file named  
"info.txt". This macro requires ImageJ 1.35g or later, which adds the  
File.open() macro function.

-wayne