Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Bioimage Analysis
Plugin template
Commits
9e1ce0fb
Commit
9e1ce0fb
authored
Aug 27, 2020
by
Jean-Yves TINEVEZ
Browse files
The demo main() method loads an image and runs the plugin.
parent
385fce70
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/plugins/authorname/MyIcyPlugin.java
View file @
9e1ce0fb
package
plugins.authorname
;
import
java.lang.reflect.InvocationTargetException
;
import
javax.swing.SwingUtilities
;
import
icy.file.Loader
;
import
icy.gui.dialog.MessageDialog
;
import
icy.gui.viewer.Viewer
;
import
icy.image.IcyBufferedImage
;
import
icy.main.Icy
;
import
icy.plugin.abstract_.PluginActionable
;
import
icy.sequence.Sequence
;
import
icy.sequence.SequenceUtil
;
import
icy.system.thread.ThreadUtil
;
/**
...
...
@@ -118,8 +125,25 @@ public class MyIcyPlugin extends PluginActionable
* Icy plugins have a package that always starts with "plugins.authorname".
*/
public
static
void
main
(
final
String
[]
args
)
public
static
void
main
(
final
String
[]
args
)
throws
InvocationTargetException
,
InterruptedException
{
// Launch the application.
Icy
.
main
(
args
);
// Load an image.
final
String
imagePath
=
"samples/Cont1.lsm"
;
final
Sequence
sequence
=
Loader
.
loadSequence
(
imagePath
,
0
,
true
);
// Copy it so that we work on a copy.
final
Sequence
copy
=
SequenceUtil
.
getCopy
(
sequence
);
// Display the images.
SwingUtilities
.
invokeAndWait
(
()
->
{
new
Viewer
(
sequence
);
new
Viewer
(
copy
);
}
);
// Run the plugin on the last active image (the copy).
new
MyIcyPlugin
().
run
();
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment