From: ImageAnalyst on
On Feb 3, 6:40 am, "mat001 " <priya.biom...(a)gmail.com> wrote:
> ImageAnalyst <imageanal...(a)mailinator.com> wrote in message <84398068-72eb-4444-9f84-bcbc597bd...(a)z41g2000yqz.googlegroups.com>...
> > OK, so just call the mean() function over a certain dimension (the 3rd
> > one if you want slices), and then display with imshow().  Very easy.
>
> Its not very clear in what order i have to use this functions.
> Explain please !!

-----------------------------------------------------------------------------------
All right!! I'll explain the ordering in more detail. The word
"then" means that what follows is supposed to be executed *after* the
thing that was mentioned before. So, in this case, when I say that
you call mean() then imshow(), it means that the code basically looks
like this
mean(.......);
imshow(.......);

As a further expanded illustration, I've devised this demo. It will
create some test data and then display 8 slices. Then, it takes the
mean of all 8 slices with mean(), and then displays that mean with
imshow(). Copy and paste it into an editor window and run it. Then
(there's that word again), look at and understand all the steps.

clc;
clear all;
close all;
workspace;

% Create a 100 by 100 by 8 slice 3D array.
imageArray3D = uint8(255 * rand(100, 100, 8));
% Display the 8 slices.
figure;
set(gcf, 'Position', get(0, 'ScreenSize')); % Maximize figure.
for k = 1 : 8
subplot(3,3,k);
caption = sprintf('Image of slice #%d', k);
% Display slice #k
imshow(imageArray3D(:,:,k), []);
title(caption);
end

% Calculate the mean along the Z dimension of all the slices.
imageArray2D = mean(imageArray3D, 3);
% Display the mean along the Z dimension.
subplot(3,3,9);
imshow(imageArray2D, []);
caption = sprintf('Mean Image of all slices');
title(caption);
From: mat001 on
ImageAnalyst <imageanalyst(a)mailinator.com> wrote in message <d06d5b12-fd09-4a53-a72b-8fa3cde93191(a)v25g2000yqk.googlegroups.com>...
> On Feb 3, 6:40 am, "mat001 " <priya.biom...(a)gmail.com> wrote:
> > ImageAnalyst <imageanal...(a)mailinator.com> wrote in message <84398068-72eb-4444-9f84-bcbc597bd...(a)z41g2000yqz.googlegroups.com>...
> > > OK, so just call the mean() function over a certain dimension (the 3rd
> > > one if you want slices), and then display with imshow().  Very easy.
> >
> > Its not very clear in what order i have to use this functions.
> > Explain please !!
>
> -----------------------------------------------------------------------------------
> All right!! I'll explain the ordering in more detail. The word
> "then" means that what follows is supposed to be executed *after* the
> thing that was mentioned before. So, in this case, when I say that
> you call mean() then imshow(), it means that the code basically looks
> like this
> mean(.......);
> imshow(.......);
>
> As a further expanded illustration, I've devised this demo. It will
> create some test data and then display 8 slices. Then, it takes the
> mean of all 8 slices with mean(), and then displays that mean with
> imshow(). Copy and paste it into an editor window and run it. Then
> (there's that word again), look at and understand all the steps.
>
> clc;
> clear all;
> close all;
> workspace;
>
> % Create a 100 by 100 by 8 slice 3D array.
> imageArray3D = uint8(255 * rand(100, 100, 8));
> % Display the 8 slices.
> figure;
> set(gcf, 'Position', get(0, 'ScreenSize')); % Maximize figure.
> for k = 1 : 8
> subplot(3,3,k);
> caption = sprintf('Image of slice #%d', k);
> % Display slice #k
> imshow(imageArray3D(:,:,k), []);
> title(caption);
> end
>
> % Calculate the mean along the Z dimension of all the slices.
> imageArray2D = mean(imageArray3D, 3);
> % Display the mean along the Z dimension.
> subplot(3,3,9);
> imshow(imageArray2D, []);
> caption = sprintf('Mean Image of all slices');
> title(caption);


This is the error when i run

??? Undefined function or method 'imshow' for input arguments of type 'uint8'.
From: mat001 on
Thanks I sliced my 3d !!