Posted by
dscho on
Apr 01, 2014; 2:01pm
URL: http://imagej.273.s1.nabble.com/Stack-operations-overhaul-tp5007162p5007166.html
Hi Christophe,
On Tue, 1 Apr 2014, Christophe Leterrier wrote:
> I'd like to propose some small changes and upgrades to the way ImageJ/Fiji
> manipulates stacks. I'm quite aware that most ImageJ developers are focused
> on higher-level stuff and that the most likely answer will be "it's open
> source, code it yourself", but I'm unfortunately still unable to do it for
> now.
This is actually one of the most excellent opportunities you have to get
your feet wet: you have the motivation, the capability, and the help you
need.
> The behavior of various stack tools (Image>Stacks>Tools in Fiji, don't know
> which ones are preset in vanilla ImageJ) is a bit inconsistent at the
> moment, regarding slice labels. I'm talking about these (maintained by
> Jean-Yves):
http://fiji.sc/Stack_Manipulation. "Concatenate" keeps the
> labels form the input stacks, but "Interleave" does not. Would it be
> possible to update the various tools so that they always keep the labels
> when possible?
The different stack tools are really different plugins, grouped into a single
.jar because they share purpose. "Concatenate" is actually no longer among
them because Wayne implemented the functionality in ImageJ 1.x itself, so
we removed it.
But the Sorter is still there, and it keeps the labels. Here is how it is
done:
https://github.com/fiji/fiji/blob/6f95b6117b6ad68658806b00d2612e1311f0ba97/src-plugins/Stack_Manipulation/src/main/java/Stack_Sorter.java#L219To fix the "Interleave" plugin, you will therefore have to find all
invocations of the `addSlice()` method in the respective source code:
https://github.com/fiji/fiji/blob/6f95b6117b6ad68658806b00d2612e1311f0ba97/src-plugins/Stack_Manipulation/src/main/java/Stack_Interleaver.java#L54and change the `null` appropriately. For example, in line 54, it should
call
stack3.addSlice(stack1.getSliceLabel(i), ip3);
instead of
stack3.addSlice(null, ip3);
To get started with this project, I would suggest following this
screencast:
https://www.youtube.com/watch?v=XyfE_fVphCs&list=UUOXCsWKZNGez9QOQMWw-Qww(but work on
https://github.com/fiji/fiji instead of
https://github.com/fiji/ImageJA).
I am happy to help you with all obstacles you encounter in that project.
Ciao,
Johannes
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html