Prev: hyperbolic interpolation
Next: Batch job
From: yusuf awal on 10 Mar 2010 02:43 Hi, I have a region (say: in a matrix X=[250 52]),then I want to mask some area that I'm not interested in my analysis e.g. one area (60,2) to (60,7) and (90,2) to (90,7), how to do that in matlab? and what if I have more than one area to be masked? thanks ysf
From: Przemo :) on 10 Mar 2010 03:16 "yusuf awal" <awaludinium(a)yahoo.com> wrote in message <hn7iie$99r$1(a)fred.mathworks.com>... > Hi, > I have a region (say: in a matrix X=[250 52]),then I want to mask some area that I'm not interested in my analysis e.g. one area (60,2) to (60,7) and (90,2) to (90,7), how to do that in matlab? and what if I have more than one area to be masked? > > thanks > > ysf I create binary mask if I am interested in some selected area. what means that some specific point won't be modified. e.g. % initialisation mask = ones(size(X)); mask(60,2:7) = 0; % processing step Y = imfilter(X,ones(3,3)/9,'replicate'); Y(find(~mask)) = X(find(~mask)); Regards, Przemo
From: Przemo :) on 10 Mar 2010 04:58 "yusuf awal" <awaludinium(a)yahoo.com> wrote in message <hn7iie$99r$1(a)fred.mathworks.com>... > Hi, > I have a region (say: in a matrix X=[250 52]),then I want to mask some area that I'm not interested in my analysis e.g. one area (60,2) to (60,7) and (90,2) to (90,7), how to do that in matlab? and what if I have more than one area to be masked? > > thanks > > ysf Check roifilt2 function too !
From: ImageAnalyst on 10 Mar 2010 06:29 yusuf awal Get a binary matrix of your matrix. Then multiply it by your other matrix. Like this maskedArray = originalMatrix .* logicalMatrix; % Note .* instead of * If the originalMatirx is of integer type, then you'll have to cast logicalMatrix to be the same integer type as originalMatrix.
From: yusuf awal on 10 Mar 2010 18:41
Hi Przemo, Thanks for your suggestion. unfortunately I don't have imfilter and roifilt2 function, since I am using Matlab R2007a. any alternative for that? thanks ysf <hn7iie$99r$1(a)fred.mathworks.com>... > > Hi, > > I have a region (say: in a matrix X=[250 52]),then I want to mask some area that I'm not interested in my analysis e.g. one area (60,2) to (60,7) and (90,2) to (90,7), how to do that in matlab? and what if I have more than one area to be masked? > > > > thanks > > > > ysf > > Check roifilt2 function too ! |