[ImageJ-devel] scijava-common newbie question

Tobias Pietzsch pietzsch at mpi-cbg.de
Tue Dec 24 08:47:27 CST 2013


Hi,

after browsing around a bit in SCJ and IJ2 examples, I would like to apply some of it in my BigDataViewer plugin. Before I do it all wrong, I thought I ask for advice on best practices…

My first application scenario is the following:
I have some code that exports from various sources to BigDataViewer's hdf5 based file format. There is stuff that can go wrong, and usually the export takes some time. Thus, it would be nice to have some user feedback on progress and warnings etc. If the code is called from an IJ1 plugin, this should be directed to IJ.log and the IJ progressbar. If the code is called from other code, it should be directed to stdout. Currently I'm using my own ProgressListener interface and IJ /  sysout implementations.
However this seems like the textbook example for LogService, so I would like to replace my crooked reinvented wheel by a shiny new scijava one :-)

I'm a bit unclear on how to do it exactly:
1) A lot of the code lives in static methods. The correct (and only) way to get the LogService in there is as a method parameter, right?
2) Where do I instantiate the service? Probably in the respective IJ1 plugin, somthing like this:
    new Context(IJ1LogService.class) in the constructor, and then
    context.inject(this) to fill a @Parameter annotated LogService field.
    Is that about right?
3) Is there something like a ProgressService which could be implemented to set the IJ1 progressbar? (I had a quick look but couldn't find one)

thanks a lot for any pointers,
Tobias


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 455 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://imagej.net/pipermail/imagej-devel/attachments/20131224/13400180/attachment.pgp>


More information about the ImageJ-devel mailing list