Re: Concatenator GenericDialog interface removes hyperness

Posted by Fred Damen on
URL: http://imagej.273.s1.nabble.com/GenericDialog-addStringField-addToSameRow-addMessage-not-widening-tp5020545p5020564.html

Greetings,

After looking into this a little more, my statement that the
concatenateHyperstacks was working as expected is incorrect.  This method
dehyperizes the hyperstacks.  Note that my datasets are 32-bit float and
sometimes have nz==1  and/or nf==1;

From reviewing the code at:
https://imagej.nih.gov/ij/developer/source/ij/plugin/Concatenator.java.html

The method createHypervol appears like it should work, although it will not be
called if Concatenator is invoked from the gui and you supply a HyperStack;
and does not appear to be callable from outside its class.  Also, for note,
createHypervol does not seem to handle HyperStack RGB datasets.

From A below:
1) One reason someone would want to concatenate 'images' is to take/make
individual ImagePlus(s) and produce a series of images, i.e., hyperstack,
especially when each ImagePlus contains only a single volume.
2) If each stack was identified as containing different conceptual stuff,
i.e., representing a stack as substacks of multiple frames, then this
representation should be carried forward into the resultant ImagePlus, even if
the substack has only one slice.
3) The code assumes that all the 'images' have the same number of frames, but
does not express this fact.  There should be no conundrum with concatenating
varying number of frames, like there is with concatenating varying number of
slices.

From B) below:
1) Only color images are HyperStack(s)???

public class Concatenator implements PlugIn, ItemListener{
...
    public ImagePlus concatenateHyperstacks(ImagePlus[] images, String
newTitle, boolean keep) {
.A.
        int slices =  images[0].getNSlices();
        int frames = images[0].getNFrames();
        boolean concatSlices = slices>1 && frames==1;
.A.
            if (concatSlices) {
                slices = images[i].getNSlices();
                slices2 += slices;
                frames2 = frames;
            } else {
                frames = images[i].getNFrames();
                frames2 += frames;
                slices2 = slices;
            }
            for (int f=1; f<=frames; f++) {
.B.
        if (channels>1 && frames2>1)
            imp2.setOpenAsHyperStack(true);
...


Thanks for listening,

Fred

On Sun, April 22, 2018 10:43 pm, Fred Damen wrote:

> Greetings,
>
> Calling the stack concatenator on hyperstacks from the
> Image>Stacks>Tools>Concatenate menu item and specifying two hyperstacks(nz>1
> and nf>1) results in a nonhyper-stack (nf==1); independent of selecting
> the'display as 4D' option.
>
> Although calling (new
> Concatenator()).concatenateHyperstacks(ImagePlus[],String,true) works as
> expected.
>
> Thanks for listening,
>
> Fred
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html