Yet Another Kymograph plugin

Check this new plugin : https://github.com/fiji/KymographBuilder

Build from scratch with IJ2.

Any feedback is welcome.

Hi hadim,

cool thing. And as I’m indeed looking for something like this, so I gave it a try. However, I’m not sure if I used it in the right way.

  • when running the plugin, it complains “Please define a line in order to build the kymograph.” even though a line is present. After adding the line to the ROI manager it doesn’t complain anymore. But I found out about the ROI-manager thing by looking in the source code. I guess a normal user won’t do that.

  • The plugin runs fine, but I’m wondering, what is the difference to the menu Image > Stacks > Reslice [/]…? I mean, the resulting image is exactly the same but 90 degrees rotated. Did I miss something?

  • and another hint: maven packaging failes, because of errors like this in java-doc:

    [ERROR] /Users/rhaase/code/KymographBuilder/src/main/java/fiji/plugin/kymographbuilder/KymographFactory.java:41: error: malformed HTML
    [ERROR] * @author Hadrien Mary <hadrien.mary@gmail.com>
    [ERROR] ^

  • last but not least: The channel-index question at the beginning is a bit confusing: non-computer-scientist-users talk about “channel 1” when they mean “channel 0”. “channel -1” is even more confusing. The description of the parameter is not shown (and nobody expects a tooltip to appear when hovering over the spin box). Is that parameter really important? Why not always processing all channels?

Cheers,
Robert

That’s great! Thanks for contributing. What about creating a short documentation page in the wiki so users can better understand how the plugin works?

Sure I’ll dot that soon.

Yes I know this bug. It is an IJ1 - IJ2 issue. While using IJ2 API, I still need to use IJ1 to manipulate ROI. That is why I added this fallback to RoiManager. I will try to make things smoother at some point.

Good question. I am not sure Reslice handle line thickness and the use of IJ2 make it easier to automate. (and that was also a good opportunities to learn the IJ2 API).

Fixed.[quote=“haesleinhuepf, post:2, topic:1431”]
last but not least: The channel-index question at the beginning is a bit confusing: non-computer-scientist-users talk about “channel 1” when they mean “channel 0”. “channel -1” is even more confusing. The description of the parameter is not shown (and nobody expects a tooltip to appear when hovering over the spin box). Is that parameter really important? Why not always processing all channels?
[/quote]

Fixed. You are correct that behaviour is misleading. I just removed the option.

Thanks for the feedback.

1 Like

A first version of a wiki page is here : http://imagej.net/KymographBuilder_:_Yet_Another_Kymograph_Fiji_plugin

1 Like

As discussed on Gitter, this plugin is now part of core Fiji:

Left to do:

  • Cut a release
  • Add to fiji/fiji
  • Upload to the Java-8 update site (later the Fiji update site, after Java-8 stuff is migrated back to core)

Thanks @hadim for writing this plugin, and for agreeing to support it in core Fiji!

2 Likes

This is now fixed.

And channels are also merged after computing the kymographs for each of them.

2 Likes

Hi @hadim,

I just wanted to point a user to the plugin but had again some issues in making it running. As it is not part of the current FIJI distribution (it does not come with a fresh copy of FIJI and it does not ship using FIJI update) I decided to update the code from Github and compile it again. However, when installing it in a fresh downloaded copy of FIJI and running it on the sample image “mitosis.tif”, it complains with this error message:

(Fiji Is Just) ImageJ 2.0.0-rc-46/1.50g; Java 1.8.0_66 [64-bit]; Mac OS X 10.10.5; 177MB of 10326MB (1%)
 
java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.ArrayIndexOutOfBoundsException: 4
    at net.imagej.legacy.LegacyService.runLegacyCompatibleCommand(LegacyService.java:277)
    at net.imagej.legacy.DefaultLegacyHooks.interceptRunPlugIn(DefaultLegacyHooks.java:163)
    at ij.IJ.runPlugIn(IJ.java)
    at ij.Executer.runCommand(Executer.java:137)
    at ij.Executer.run(Executer.java:66)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.util.concurrent.ExecutionException: java.lang.ArrayIndexOutOfBoundsException: 4
    at java.util.concurrent.FutureTask.report(FutureTask.java:122)
    at java.util.concurrent.FutureTask.get(FutureTask.java:192)
    at net.imagej.legacy.LegacyService.runLegacyCompatibleCommand(LegacyService.java:273)
    ... 5 more
Caused by: java.lang.ArrayIndexOutOfBoundsException: 4
    at net.imglib2.img.planar.PlanarRandomAccess.setPosition(PlanarRandomAccess.java:324)
    at fiji.plugin.kymographbuilder.KymographCreator.fillKymograph(KymographCreator.java:191)
    at fiji.plugin.kymographbuilder.KymographCreator.buildKymograph(KymographCreator.java:127)
    at fiji.plugin.kymographbuilder.KymographCreator.build(KymographCreator.java:91)
    at fiji.plugin.kymographbuilder.KymographFactory.build(KymographFactory.java:107)
    at fiji.plugin.kymographbuilder.KymographBuilder.run(KymographBuilder.java:135)
    at org.scijava.command.CommandModule.run(CommandModule.java:205)
    at org.scijava.module.ModuleRunner.run(ModuleRunner.java:167)
    at org.scijava.module.ModuleRunner.call(ModuleRunner.java:126)
    at org.scijava.module.ModuleRunner.call(ModuleRunner.java:65)
    at org.scijava.thread.DefaultThreadService$2.call(DefaultThreadService.java:191)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    ... 1 more

Furthermore, in the log, I can read this:

[INFO] Running KymographBuilder version 1.2.1-SNAPSHOT
[INFO]     Dataset : mitosis.tif
    Width = 171
    Height = 196
    Depth = 5
    Timepoints = 51
    Number of channels = 2

[INFO] The following channels will be used : [0, 1]
[INFO] 1 lines with a width of 1 will be used for the kymograph 1.
[INFO] Creating kymograph for the channel 0.
[ERROR] Module threw exception
java.lang.ArrayIndexOutOfBoundsException: 4
    at net.imglib2.img.planar.PlanarRandomAccess.setPosition(PlanarRandomAccess.java:324)
    at fiji.plugin.kymographbuilder.KymographCreator.fillKymograph(KymographCreator.java:191)
    at fiji.plugin.kymographbuilder.KymographCreator.buildKymograph(KymographCreator.java:127)
    at fiji.plugin.kymographbuilder.KymographCreator.build(KymographCreator.java:91)
    at fiji.plugin.kymographbuilder.KymographFactory.build(KymographFactory.java:107)
    at fiji.plugin.kymographbuilder.KymographBuilder.run(KymographBuilder.java:135)
    at org.scijava.command.CommandModule.run(CommandModule.java:205)
    at org.scijava.module.ModuleRunner.run(ModuleRunner.java:167)
    at org.scijava.module.ModuleRunner.call(ModuleRunner.java:126)
    at org.scijava.module.ModuleRunner.call(ModuleRunner.java:65)
    at org.scijava.thread.DefaultThreadService$2.call(DefaultThreadService.java:191)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

:’-(

Cheers,
Robert

Thank you for reporting this. I’ll keep you in touch once I have figured out what is going on.

The bug is related to the fact that the image has Z stacks and the plugin does not take into account that.

What behaviour would you like to see for this case ? Building the kymograph along the current Z stack ?

In the meantime you can still use Z projection before running the plugin, that is going to work.

I filled an issue : https://github.com/fiji/KymographBuilder/issues/7

1 Like

My fault; I had not uploaded it yet. I have now done so (to the Java-8 update site).

2 Likes

This bug is now fixed in the v1.2.1. Plugin can handle 3, 4 and 5D images stack.

2 Likes

Ah cool, it’s working now :slight_smile:

Cheers,
Robert