From: Oliver Woodford on
mikisheadmaster wrote:
> I see now that for some images are blank.
>
> I have this:imdisp(imarray, 'Size', [8 2],'Map',[]) but doesn't change
> anything.
>
> The images are blank white.I can store the map for each image but I
> think it is complicated.
>
> I see that it has been implemented by ImageAnalyst.So if you could
> give me an answer I would appreciate it.

Actually I wrote imdisp. If your colormap is blank then you need to make sure that your images are given as rgb images, i.e. size(imarray, 3) == 3.

If you are doing this then also make sure that the images are either double in the range 0 to 1, or uint8 in the range 0 to 255.

Regards,
Oliver
From: mikisheadmaster on
On May 12, 6:42 pm, "Oliver Woodford" <o.j.woodford...(a)cantab.net>
wrote:
> mikisheadmaster wrote:
> > I see now that for some images are blank.
>
> > I have this:imdisp(imarray, 'Size', [8 2],'Map',[]) but doesn't change
> > anything.
>
> > The images are blank white.I can store the map for each image but I
> > think it is complicated.
>
> > I see that it has been implemented by ImageAnalyst.So if you could
> > give me an answer I would appreciate it.
>
> Actually I wrote imdisp. If your colormap is blank then you need to make sure that your images are given as rgb images, i.e. size(imarray, 3) == 3.
>
> If you are doing this then also make sure that the images are either double in the range 0 to 1, or uint8 in the range 0 to 255.
>
> Regards,
> Oliver

The images are black and white, uint8 in the range 0 to 1.I don't
fully understand the colourmap.

The imarray is 1x15 of uint8.So I changed to that:

image = imread(filename);
imarray{j} = double(image) + 1;

And at the end:
imdisp(imarray, 'Size', [5 3]). Still same problem!
From: Oliver Woodford on
mikisheadmaster wrote:
> image = imread(filename);
> imarray{j} = double(image) + 1;
>
> And at the end:
> imdisp(imarray, 'Size', [5 3]). Still same problem!

Perhaps some of the images are stored as indexed images. You should convert them to rgb images first. Try this (taken from imdisp!) for generating each image:

[A map] = imread(filename);
if ~isempty(map)
map = uint8(map * 256 - 0.5);
A = reshape(map(A,:), [size(A) size(map, 2)]);
end
imarray{j} = im;

Alternatively, this works!:

imarray{j} = filename;

as imdisp will then read in the image for you.

HTH,
Oliver
From: Oliver Woodford on
It seems some images index into colormaps starting at one, while others start at zero.
Try this:

[A map] = imread(filename);
if ~isempty(map)
map = uint8(map * 256 - 0.5);
if min(A(:)) < 1
A = A + 1;
end
A = reshape(map(A,:), [size(A) size(map, 2)]);
end
imarray{j} = im;
From: mikisheadmaster on
On 12 Μάϊος, 21:37, "Oliver Woodford" <o.j.woodford...(a)cantab.net>
wrote:
> It seems some images index into colormaps starting at one, while others start at zero.
> Try this:
>
> [A map] = imread(filename);
> if ~isempty(map)
>     map = uint8(map * 256 - 0.5);
>     if min(A(:)) < 1
>         A = A + 1;
>     end
>     A = reshape(map(A,:), [size(A) size(map, 2)]);
> end
> imarray{j} = im;

Yeap...Thank you very much for your contribution!