README.md 3.64 KB
Newer Older
Jean-Yves TINEVEZ's avatar
Jean-Yves TINEVEZ committed
1
2
3
4
5
6
7
8
9
10
# Template maven repository for Icy plugins.

![Icy logo](static/icy_imaging_software_logo-2.png)

This repository serves as a template for your future Icy plugin. If you want to create a new Icy plugin using **maven** for dependency management, just clone this repository, and edit it to your needs. The following gives hints about what to edit and how.

## What to edit.

### The `pom.xml` file.

11
The `pom` for Icy plugin is fairly standard. First it inherits from `parent-pom-plugin` that specifies a few default values used throughout the Icy application.
Jean-Yves TINEVEZ's avatar
Jean-Yves TINEVEZ committed
12
13
14
15
16

You want to edit the first section on the plugin information:

```xml
 <!-- Project Information -->
17
<artifactId>plugin-template</artifactId>
Jean-Yves TINEVEZ's avatar
Jean-Yves TINEVEZ committed
18
19
```

20
The `artefactId` will be the name of the jar file produced by the compilation of the plugin. Put a sensible name for it since this is what you will have to upload to the Icy website to distribute the plugin (lower case only and no space character).
Jean-Yves TINEVEZ's avatar
Jean-Yves TINEVEZ committed
21
22
23
24
25
26
27
28
29
30
31
32
33
34



 Replace the following fields by values that will be informative to an end user:

```xml
<name>A template for Icy plugins.</name>
<description>This repo serves as a template for you to implement new Icy plugins.</description>
<url></url>
<inceptionYear>2020</inceptionYear>
```



Stéphane  DALLONGEVILLE's avatar
Stéphane DALLONGEVILLE committed
35
The dependency section contains only the Icy kernel (that has all the application, GUI, etc...) and the EzPlug library for now. Add more if you need it. The version of the `icy-kernel` and `ezplug` are defined in the parent pom, so you don't have to specify them here.
Jean-Yves TINEVEZ's avatar
Jean-Yves TINEVEZ committed
36
37
38
39
40
41
42
43
44
45
46
47
48

```xml
<!-- List of project's dependencies -->
<dependencies>
  <!-- The core of Icy -->
  <dependency>
    <groupId>org.bioimageanalysis.icy</groupId>
    <artifactId>icy-kernel</artifactId>
  </dependency>

  <!-- The EzPlug library, simplifies writing UI for Icy plugins. -->
  <dependency>
    <groupId>org.bioimageanalysis.icy</groupId>
Stéphane  DALLONGEVILLE's avatar
Stéphane DALLONGEVILLE committed
49
    <artifactId>ezplug</artifactId>
Jean-Yves TINEVEZ's avatar
Jean-Yves TINEVEZ committed
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
  </dependency>

</dependencies>
```



We need to specify where to find the dependency, so that last section has this paragraph:

```xml
<!-- Link to third-party Maven repositories -->
<repositories>
  <repository>
    <id>icy</id>
    <name>Icy's Nexus</name>
    <url>https://icy-nexus.pasteur.fr/repository/Icy/</url>
  </repository>
</repositories>
```

Just keep it as is.

### Package conventions in Icy.

By convention the Java package of Icy plugins takes the following form:

```java
package plugins.authorname.pluginname
```

`authorname` should be a condensed version of your name. For instance the author Alexandre Dufour uses `adufour`. Jean-Yves Tinevez uses `tinevez` _etc_.

`pluginname` should be a condensed name of the plugin you are currently developing, unique among all the plugins you develop to avoir package name clashes with the Icy application. 

For instance the classes of the demo you will find in this template repository are in the package `plugins.authorname.templateplugin`. 

## Examples and documentation.

There is a pdf presentation online that gives starters as how to build an Icy plugin in Java:

http://icy.bioimageanalysis.org/doc/icy-plugin.pdf

The two examples in this repository are inspired by it. You will find:

- A simple plugin example, that modify an image with no UI: [the first example](src/main/java/plugins/authorname/templateplugin/MyIcyPlugin.java)
- A second example plugin that uses [EzPlug](http://icy.bioimageanalysis.org/plugin/ezplug-sdk/) to build a basic UI for a plugin: [the second example](src/main/java/plugins/authorname/templateplugin/MyEzPlugIcyPlugin.java)

## Credits.

The example image found in the `samples` folder is courtesy  of Jakub Sedzinsky, University of Copenhagen. It is an epithelium of the neural plate of _Xenopus laevis_ visualized by utrophin-GFP.