Using find indices to make new matrix
1 view (last 30 days)
Show older comments
Hello,
I'm currently working on my bachelor thesis and i have the following problem.
From a data set I have Z = 128*128*63 image, so a stack of 63 2D images. From this i have to extract the values which are greater then 1/8 of the mean of the set.
I calculated the mean like: mean_final = mean(mean(mean(Z)));
I used the follwing command to find the corresponding values: [r,c,v] = ind2sub(size(Z),find(Z > mean_final/8));
I assume that r,c and v give the corresponding x,y,z indices.
What i would like to have now is a new matrix with only these coordinates.
Some background: the image is an image of the head, sourrounded by air. What I need is this same image but without the sourring air, which gives a lot of noise and unneccesary data in further analysis.
I hope you can help me with this problem!
1 Comment
the cyclist
on 12 Jun 2012
I have a question, but let me frame it in terms of a simpler, 2-dimensional problem. Suppose Z is a 3x3 matrix, and you find that all elements except for the upper left one, Z(1), are greater than 1/8 the mean. What would you want the output, which consists of the other eight elements, to look like?
Similarly, given the "ragged" shape that you will find in your real problem, what do you want your output to look like?
Answers (0)
See Also
Categories
Find more on Feature Detection and Extraction in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!