Difference between revisions of "Developing Fiji"

(Add a central starting point for developers)
 
m (Update minimal-ij1-plugin link to example-legacy-plugin, due to renamed repository)
 
(83 intermediate revisions by 15 users not shown)
Line 1: Line 1:
 +
{{FijiMenu}}{{Outdated}}
 +
 
Fiji is a community effort.  So we are happy whenever we see new people developing Fiji!
 
Fiji is a community effort.  So we are happy whenever we see new people developing Fiji!
 +
 +
== Purpose ==
 +
 +
The purpose of this tutorial is to get you started hacking on [https://github.com/fiji/ Fiji's source code] (i.e., the core Fiji plugins). If you need to develop a ''new plugin'' for ImageJ, you do not actually need Fiji's source. Rather, see these resources:
 +
* {{GitHub|org=imagej|repo=example-legacy-plugin|label=example-legacy-plugin}} project template
 +
* [[Introduction into Developing Plugins]] tutorial
 +
* [https://www.youtube.com/watch?v=Ac-6gJ2eRb0 Developing ImageJ 1.x plugins with NetBeans] screencast
 +
 +
See also [[Developing Fiji in Eclipse]] for a tutorial specific to the Eclipse IDE.
  
 
== Getting started ==
 
== Getting started ==
  
First, you have to [[Downloading_and_Building_Fiji_From_Source|download and build Fiji]].
+
First, you have to [[Downloading_and_Building_Fiji_From_Source|download and build Fiji]]. If you do not know Git yet, we have a [[Git for dummies|concise introduction]] for you.
 +
 
 +
== Building Fiji ==
 +
 
 +
Fiji is organized into a set of [[Maven]] projects. For convenience and speed, there is [[SciJava]]'s minimal Maven-lookalike [[MiniMaven]] to build Fiji, but it is recommended to use an [[IDEs|Integrated Development Environment]], or at least real Maven.
 +
 
 +
For details, please see [[Downloading and Building Fiji From Source]].
 +
See also the [[Supported Compilers]] page for more information.
 +
 
 +
== Testing ==
 +
 
 +
It is strongly recommended to write regression tests (also known as ''unit tests''). It is [[Fiji_contribution_requirements#Regression_tests|easy]].
 +
 
 +
Furthermore, it is highly recommended to write and run unit tests in an [[IDEs|Integrated Development Environment]] for efficient debugging.
 +
 
 +
You may also want to measure the code coverage of your tests - one way is described in the page [[Code Coverage in Fiji]].
 +
 
 +
At some point, you might want to debug whatever you wrote.  There's a small [[Debugging intro]] page.
 +
 
 +
== Discussing code ==
 +
 
 +
When you want to propose and/or discuss changes to some source code, the preferred way is to [[contributing|submit a PR on GitHub]].
 +
 
 +
== Contributing ==
 +
 
 +
Please have a look at the excellent ''[[How to contribute to an existing plugin or library]]'' tutorial.
 +
 
 +
== Providing documentation ==
 +
 
 +
A plugin wants to be used. Therefore you want to give users some information about it, and most likely also a tutorial how to use it.
 +
 
 +
If you have an account on this Wiki, you can easily create new tutorials with the [[Tutorial Maker]].
  
== Adding plugins ==
+
== Further reading for developers ==
  
After you built Fiji successfully, you can add your own plugins.
+
*[[Overview of Fiji's source code]]
 +
*[[Description of ImageJ's plugin architecture]]
 +
*[[Tips for developers]]
 +
*[http://jenkins.imagej.net/job/ImageJ1-javadoc/lastStableBuild/artifact/target/site/apidocs/ ImageJ1 Javadoc ZIP] (for offline usage)
 +
*[http://jenkins.imagej.net/job/ImageJ-daily/lastStableBuild/artifact/target/site/apidocs/ ImageJ2 Javadoc ZIP] (for offline usage)
 +
*[[Developers HowTo]]
 +
*[http://www.imagingbook.com/index.php?id=102 ImageJ plugin writing tutorial]
 +
*[http://albert.rierol.net/imagej_programming_tutorials.html ImageJ programming tutorials]
 +
*[[Uploading plugins]]
 +
*[[Developing Fiji in Eclipse]]
 +
*[[Git]]
 +
*[[Project ideas]]
 +
*[[Code Coverage in Fiji]]
 +
*[[Debugging intro|Introduction to debugging]]
 +
*[[Profiling Java Code]]
 +
*[[Tips for C++ developers]]
  
* If you haven't done so, pick a name for your .jar file, say ''My_Plugin''.  Make sure that it has at least one underscore in it, otherwise ImageJ will not pick it up.  If you cannot think of a name with an underscore, just append one.  Then create a subdirectory ''src-plugins/My_Plugin''.
+
[[Category:Development]]
* Now put your sources into that subdirectory.  Please no .class files.  Readme or license files are okay, however.
+
[[Category:Fiji]]
* Create a ''staged-plugins/My_Plugin.config'' file.  This will be included in the .jar file as ''plugins.config''.
 
* In Fiji's root folder, call '''./fiji scripts/commit-plugin.py src-plugins/My_Plugin/'''.  Please make sure that it ends with a slash.  This command will make the necessary edits to the Fakefile and .gitignore, and commit everything needed for your plugin.
 
* Now build the plugin with '''./fiji --fake'''.
 
* After testing, you might realize that you need changes.  In this case, decide if you want to amend the commit (if there was a silly typo, you might want to hide that fact from the world), or if you want to make a new commit.
 
* When everything is done and fine, publish!
 

Latest revision as of 14:56, 6 June 2017

Fiji-icon.png Fiji Is Just ImageJ
Overview
Using Fiji
Featured Fiji Projects
Fiji Publications
Links
Developing Fiji
Building Fiji from source
Developing Fiji
Contribution requirements



Fiji is a community effort. So we are happy whenever we see new people developing Fiji!

Purpose

The purpose of this tutorial is to get you started hacking on Fiji's source code (i.e., the core Fiji plugins). If you need to develop a new plugin for ImageJ, you do not actually need Fiji's source. Rather, see these resources:

See also Developing Fiji in Eclipse for a tutorial specific to the Eclipse IDE.

Getting started

First, you have to download and build Fiji. If you do not know Git yet, we have a concise introduction for you.

Building Fiji

Fiji is organized into a set of Maven projects. For convenience and speed, there is SciJava's minimal Maven-lookalike MiniMaven to build Fiji, but it is recommended to use an Integrated Development Environment, or at least real Maven.

For details, please see Downloading and Building Fiji From Source. See also the Supported Compilers page for more information.

Testing

It is strongly recommended to write regression tests (also known as unit tests). It is easy.

Furthermore, it is highly recommended to write and run unit tests in an Integrated Development Environment for efficient debugging.

You may also want to measure the code coverage of your tests - one way is described in the page Code Coverage in Fiji.

At some point, you might want to debug whatever you wrote. There's a small Debugging intro page.

Discussing code

When you want to propose and/or discuss changes to some source code, the preferred way is to submit a PR on GitHub.

Contributing

Please have a look at the excellent How to contribute to an existing plugin or library tutorial.

Providing documentation

A plugin wants to be used. Therefore you want to give users some information about it, and most likely also a tutorial how to use it.

If you have an account on this Wiki, you can easily create new tutorials with the Tutorial Maker.

Further reading for developers