[ImageJ-devel] Stitching - CompositeImage forces stack slices to channel if < 7

Johannes Schindelin schindelin at wisc.edu
Wed Jan 22 10:42:49 CST 2014


Hi Mark,

On Wed, 22 Jan 2014, Mark Hiner wrote:

>  I noticed today that on line 60 of
> CompositeImage<http://trac.imagej.net/browser/imagej/src/main/java/ij/CompositeImage.java?rev=5edb0e269f08a596c926bc171d516f7b3f85631f>,
> if the stack size is less than 7, the stack is converted to channels
> (coupled with lines 68-69).

... and the only way to fix it is to do it manually after constructing the
CompositeImage. I actually stumbled over this part of the ImageJ 1.x
source code quite a couple of times. Unfortunately, it is too late to fix
it because people and plugins already rely on that surprising behavior.

>  This causes bizarre & inconsistent behavior (especially to scientist
>  users), e.g. when stitching if there are more than 7 slices everything
>  looks great, and less than 7 all of a sudden you get back a colored
>  channel stack.
> 
>   It's not clear to me why this code is necessary.. perhaps it should only
> be executed if the mode is set to COMPOSITE?

That's a good idea!

How about adding the workaround to call setDimensions() *directly* after
constructing (and saving the correct dimensions before) in any case?

Ciao,
Dscho



More information about the ImageJ-devel mailing list