Opening non-standard files from within a command line initiated plugin

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

Opening non-standard files from within a command line initiated plugin

Gregory Jefferis
Dear All,

I want to batch process image files using a plugin called from the command
line.  The plugin is based on the Batch_Converter plugin and my command line
(on MacOS X) looks like this:

java -cp /Applications/ImageJ/ij.jar:.  Batch_Convert_To_Biorad srcdir
dstdir

I would like to be able to open any of the image types supported in my
HandleExtraFileTypes plugin.  While I can do this when running the plugin
from within ImageJ, this does not work when running the plugin from the
command line.  I presume this is because additional ImageJ plugins are not
loaded when starting ij.jar from the command line.  Is there a way round
this?  Many thanks,

Greg.
 
--
Gregory Jefferis, PhD                                   and:
Research Fellow    
Department of Zoology                                   St John's College
University of Cambridge                                 Cambridge
Downing Street                                          CB2 1TP
Cambridge, CB2 3EJ
United Kingdom

Lab Tel: +44 (0)1223 336683                     Office: +44 (0)1223 339899
Lab Fax: +44 (0)1223 336676

http://www.zoo.cam.ac.uk/zoostaff/jefferis.html           [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Opening non-standard files from within a command line initiated plugin

Gregory Jefferis
Hi Jon,

Thanks for your note.  Wayne also suggested including the -Dplugins.dir
command line option to tell ImageJ where the plugins folder is.  However
although that was one problem, that was not quite enough because ImageJ was
not checking for the plugins.dir property unless there was an ImageJ window
or unless a plugin or macro called run().  Wayne modified the main source
code to fix this and sent the change as ij.jar v1.37m.  I presume there will
be a note on the news page in due course.

Best,

Greg.


On 9/8/06 13:51, "Jonathan Jackson" <[hidden email]> wrote:

> On Tue, 8 Aug 2006 06:32:43 +0100, Gregory Jefferis <[hidden email]> wrote:
>
>> Dear All,
>>
>> I want to batch process image files using a plugin called from the command
>> line.  The plugin is based on the Batch_Converter plugin and my command line
>> (on MacOS X) looks like this:
>>
>> java -cp /Applications/ImageJ/ij.jar:.  Batch_Convert_To_Biorad srcdir
>> dstdir
>>
>> I would like to be able to open any of the image types supported in my
>> HandleExtraFileTypes plugin.  While I can do this when running the plugin
>> from within ImageJ, this does not work when running the plugin from the
>> command line.  I presume this is because additional ImageJ plugins are not
>> loaded when starting ij.jar from the command line.  Is there a way round
>> this?  Many thanks,
>>
> I haven't looked at the Batch_Converter plugin, but here are some
> suggestions you could try.
>
> include the Plugins directory as an argument
> java -Dplugins.dir=/Applications/ImageJ/ -cp /Applications/ImageJ/ij.jar:.
>
> Put ImageJ into debug mode at the beginning of your plugin - this will tell
> you if HandleExtraFileTypes is being called, and what file paths are being
> passed as arguments.  (a plugin may assume the file is in / if no directory
> is passed as an argument)
> IJ.debugMode = true;
>
> regards,
> Jon
>
>
>

--
Gregory Jefferis, PhD                                   and:
Research Fellow    
Department of Zoology                                   St John's College
University of Cambridge                                 Cambridge
Downing Street                                          CB2 1TP
Cambridge, CB2 3EJ
United Kingdom

Lab Tel: +44 (0)1223 336683                     Office: +44 (0)1223 339899
Lab Fax: +44 (0)1223 336676

http://www.zoo.cam.ac.uk/zoostaff/jefferis.html           [hidden email]