Update of the Colour Deconvolution plugin

Hello,
I have some some updates for the Colour Deconvolution plugin which I would like to apply to the Fiji version.

Some time ago, that plugin source was split into two separate files by a contributor to make some methods public and to generate a single file which holds the colour vector matrices which makes them easier to edit and maintain.
One drawback is that now I cannot compile that source in IJ1 anymore.
I will have to move from using just a text editor (yep!) and use Eclipse instead.

I tried to find a step by step instruction on how to do this but the instructions are somewhat circular and perhaps understandable for experienced programmers.

I have installed eclipse, maven, git, gitk and Fiji (but never used maven before). I am using linux if that makes any difference.
(I have cloned the IJ source code long time ago, but I currently cannot access that machine and do not recall exactly how I did it and now I am not sure if there is a specific place in Eclipse where I should place the repository.) So, sorry to ask these basic questions…

  1. How do I clone just the Colour Deconvolution plugin and use the current working Fiji install for testing?

  2. Do I need to clone the whole Fiji to work with Eclipse and update the plugin?

  3. Can somebody please suggest how to set up Eclipse to do the above?

Many thanks

Hi @gabriel

This is not an instruction to setup a full FIJI development environment.
Also it does not explain how to contribute modifications to the existing GitHub project.

I only want to explain a simple workaround to be able to modify and compile the ‘FIJI Color Deconvolution’ code.

Maybe this helps.

  1. From
    https://github.com/fiji/Colour_Deconvolution/tree/dca9a107f1d90b2f15dd7fac4e737534984e64f1
    download ZIP

  2. Assuming you have a working Eclipse setup for ImageJ (not FIJI)
    FIJI and other dependencies are not necessary.

  3. Create a new package folder in PluginSourceFiles with the name
    sc.fiji.colourDeconvolution

  4. From the unpacked zip file from the subfolder \src\main\java\sc\fiji\colourDeconvolution copy the two files
    Colour_Deconvolution.java
    StainMatrix.java
    by drag&drop them to the new package folder (from step 3) in Eclipse

Now you should be able to compile them.

(FIJI and other dependencies are not necessary.)

To make the plugin visible in ImageJ started from Eclipse you can (temporarily) rename the package folder from
sc.fiji.colourDeconvolution
to
scfijicolourDeconvolution
(ImageJ can not handle the points.)

Don’t forget your vector definition file colourdeconvolution.txt.
Copy this file to the plugins folder of your Eclipse project (!).

Regards
Peter

1 Like

Hi Peter, I was able to sort all out now. Many thanks for your help.

@gabriel,
you can compile both files inside ImageJ1 (without Eclipse)!

Comment out or delete the line

package sc.fiji.colourDeconvolution;

in both files.
Then first Compile&Run

StainMatrix.java

After that you can Compile&Run

Colour_Deconvolution.java
1 Like

Yes! thanks. That was causing the errors. Much appreciated!