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