Run plugin from script

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

Run plugin from script

PEARSON Matthew
Hi all,

I was wondering how you can run a specific plugin from within a script.  The plugins i have ran before are StageControl and ImageFlipper.  This time i'd like to run the QI/PM White Balance plugin for imaging/photometrics cameras but when i try to replicate the code i have for image flipper/stagecontrol and substitute in the name of the white balance plugin it doesn't seem to work so perhaps there are permutations of code for running different kinds of plugins?  The white balance plugin appears in the mmplugins>device_control folder.

Thanks for the help,

Matt

--
Matt Pearson
Microscopy Facility
MRC Human Genetics Unit
Institute of Genetics and Molecular Medicine (IGMM)
University of Edinburgh
Crewe Road
EH4 2XU





The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|

Re: Run plugin from script

Nico Stuurman-2
Hi Matt,


>
> I was wondering how you can run a specific plugin from within a
> script.  The plugins i have ran before are StageControl and
> ImageFlipper.  This time i'd like to run the QI/PM White Balance
> plugin for imaging/photometrics cameras but when i try to replicate
> the code i have for image flipper/stagecontrol and substitute in the
> name of the white balance plugin it doesn't seem to work so perhaps
> there are permutations of code for running different kinds of plugins?
>  The white balance plugin appears in the mmplugins>device_control folder.

What is the error?

I could imagine that you did not import all needed packages, but that is
a wild guess.

Also note that in 2.0 it is no longer possible to call plugin code (a
design decision that I understand but do not particularly like).

Best,

Nico


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|

Re: Run plugin from script

PEARSON Matthew
Hi Nico,

I'm just not sure how to implement calling this plugin in 1.4 and the code for any plugin you want to call seems quite different.  For example, to call stage control i would need to do the following:
import org.micromanager.stagecontrol.StageControl;
sc = new StageControl();
sc.setApp(gui);
sc.show();

Or for the image flipping plugin this:
import org.micromanager.newimageflipper.NewImageFlippingProcessor;
processor = new NewImageFlippingProcessor();
processor.makeConfigurationGUI();
gui.addImageProcessor(processor);

Both of these i got from either Mark or Chris.  It would be a bit of a guess as to how to call the white balance plugin, but if i roughly mirror that or calling stage control it would look something like this:
import org.micromanager.whitebalance.WhiteBalance;
wb = new WhiteBalance();
wb.setApp(gui);
wb.show();

Clearly it is not this simple though.  Is there a basic framework for how to call any plugin from the mmplugins folder?

Thanks,

Matt

--
Matt Pearson
Microscopy Facility
MRC Human Genetics Unit
Institute of Genetics and Molecular Medicine (IGMM)
University of Edinburgh
Crewe Road
EH4 2XU





On 15 May 2017, at 22:09, Nico Stuurman <[hidden email]> wrote:

Hi Matt,



I was wondering how you can run a specific plugin from within a
script.  The plugins i have ran before are StageControl and
ImageFlipper.  This time i'd like to run the QI/PM White Balance
plugin for imaging/photometrics cameras but when i try to replicate
the code i have for image flipper/stagecontrol and substitute in the
name of the white balance plugin it doesn't seem to work so perhaps
there are permutations of code for running different kinds of plugins?
The white balance plugin appears in the mmplugins>device_control folder.

What is the error?

I could imagine that you did not import all needed packages, but that is
a wild guess.

Also note that in 2.0 it is no longer possible to call plugin code (a
design decision that I understand but do not particularly like).

Best,

Nico


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general


The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general