MATLAB Answers

0

How to calculate the mean and standard deviation of the 27 neighbourhood of a voxel in a 3D matrix?

Asked by Joaquim on 25 Apr 2017
Latest activity Answered by Image Analyst
on 25 Apr 2017
Hello everybody!
I have a matrix 336*336*65. I want to create two new matrices of the same size, one representing the mean value of the 27-neighboor of each voxel and another one representing the standard deviation for the same neighbors.
Can anyone help me?

  0 Comments

Sign in to comment.

1 Answer

Answer by Image Analyst
on 25 Apr 2017
 Accepted Answer

Use convn() and stdfilt().
kernel = ones(3,3,3);
out = convn(inputImage, kernel, 'same')

  0 Comments

Sign in to comment.