Getting the source code for fiji without using maven?

I’ve been writing scripts in python, but I often end up reading some of the java source code to figure out how use a particular thing. I’ve mostly just been referring to the source of ImageJ, because I’ve found the source for it. But it would be nice if I had the entire source code for the current version of Fiji I’m using. I know it’s possible to get the entire thing with maven. But I don’t know how to use maven and because I’m not even programming in java, it really isn’t worth it for me to learn right now.

So is there somewhere else or some other way to get the entire source code for a particular version of fiji?

Hi @in-tension,

Do you mean Fiji? or a particular plugin?

If you want to learn about a particular command / plugin then one nice option is to use the search bar (bottom right of the fiji window - or Ctrl-L. If you type the name of the plugin / function you want a window will appear that has a Source button. That button takes you to the github page with the relevant source code.

(Sometimes that’s only a start and some digging is needed, but it’s saved me a bunch of time)

John

PS. You can thank @haesleinhuepf for this :slight_smile:

2 Likes

And @ctrueden and @frauzufall and @imagejan :wink:

2 Likes

I’m looking for the entire source for Fiji, all together.

I have used the search bar and it has been helpful. But the source button has never worked for me.
06

1 Like

Hey @in-tension,

so you will find most of the sources here:



For example, the Particle Analyser lives here:

Fiji is quite complex. If you tell us what you’re looking for, we can guide you :wink:

Cheers,
Robert

1 Like

@in-tension Did you see this wiki page?

If you really want to have all the sources in one place, there is a script in the Fiji GitHub repository that can be used to shallow clone the repositories of all components:

$ git clone git://github.com/fiji/fiji
$ cd fiji
$ bin/melt.sh -s
$ find . -name '*.java'

Or if you want deep clones of everything, the way I do it is using myrepos with the various organizations’ dotfiles repositories. See here for one way (not the only way) to do it:

It’s a bug! I launched Fiji in debug mode on my macOS system, and saw the following output when trying to open the source for the Analyze Particles command:

[DEBUG] Weird SCM tag 'HEAD'; using commit hash.
[DEBUG] java.io.IOException: Could not open https://github.com/imagej/ImageJA/blob/232620e0a3b0fd33bb22083aaadb2c26b1a31fc6/src/main/java/ij/plugin/filter/ParticleAnalyzer.java
	at org.scijava.platform.DefaultPlatform.open(DefaultPlatform.java:77)
	at org.scijava.platform.DefaultPlatformService.open(DefaultPlatformService.java:103)
	at net.imagej.legacy.search.SourceSearchActionFactory.sourceForClass(SourceSearchActionFactory.java:208)

I fixed it by running Help > Update… and installing the missing library jars/scijava-plugins-platforms-0.3.1.jar. You could double check whether this library is installed for you. I just downloaded a fresh Fiji and it is indeed there in the distribution. If you do have the library, you could launch Fiji in debug mode to get a better error message:

DEBUG=1 /Applications/Fiji.app/Contents/MacOS/ImageJ-macosx

Edit: I pushed a commit which makes the failure behavior better in some situations:

5 Likes