FIJI avoid Console Warning or bioformats not verbose

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

FIJI avoid Console Warning or bioformats not verbose

Emanuele Martini
Hi to all,
it is possible to avoid that the console of Fiji appears with warnings, or close it programmatically?

Since I am launching a plugin that analyze with bioformats many lei and image file, but every image series analyze it throws me out warnings and "populating metadata" text on console... with the result that after some iteration the console has problem of updating (it is all gray without any text) and Fiji is stucked; even if the plugin completes the operations on all images.

So another solution it is to say to bioformats to don't throw out warnings and text on the console.

I am using Java.

Thank you,
Emanuele
Image Analyst @Ifom-IEO research campus -MI-
Reply | Threaded
Open this post in threaded view
|

Re: FIJI avoid Console Warning or bioformats not verbose

Jan Eglinger
Hi Emanuele,

On 14.10.2015 16:00, Emanuele Martini wrote:
> it is possible to avoid that the console of Fiji appears with warnings, or
> close it programmatically?
>

One possibility is to temporarily change the log level:

     final Logger logger = (Logger) LoggerFactory
         .getLogger(org.slf4j.Logger.ROOT_LOGGER_NAME);
     final Level logLevel = logger.getLevel(); // save previous log level
     logger.setLevel(Level.toLevel("error"));

then use some bio-formats components, e.g.:

     final ImageReader reader = new ImageReader();
     reader.setId(filePath);
     nChannels = reader.getEffectiveSizeC();
     reader.close();

and then set it back to the original level after processing:

     logger.setLevel(logLevel);


(using
     import ch.qos.logback.classic.Level;
     import ch.qos.logback.classic.Logger;
     import org.slf4j.LoggerFactory;          )

But there might be more elegant solutions?!

Jan


> Since I am launching a plugin that analyze with bioformats many lei and
> image file, but every image series analyze it throws me out warnings and
> "populating metadata" text on console... with the result that after some
> iteration the console has problem of updating (it is all gray without any
> text) and Fiji is stucked; even if the plugin completes the operations on
> all images.
>
> So another solution it is to say to bioformats to don't throw out warnings
> and text on the console.
>
> I am using Java.
>
> Thank you,
> Emanuele
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: FIJI avoid Console Warning or bioformats not verbose

Emanuele Martini
Thank you,
in the end I use this class:

http://downloads.openmicroscopy.org/bio-formats/5.1.4/api/loci/common/DebugTools.html

with this method:
enableIJLogging(false)

i think that is correct...after I will reset to true.

See you,
Emanuele
Image Analyst @Ifom-IEO research campus -MI-