How to mask the data of no information?

8 views (last 30 days)
Dear Matlab experts,
I need to mask out data with no information and want to keep data for only targets of interest.
I have attached one image in which data with no information is masked out and retain with target information.
I have attached .mat file, could you please guide on how to mask the information of no use and get only target region?
Thank you!
Best Regards,
load('two_targets.mat'); % data
imagesc(intensity,[-45 0]);
I need to keep target area as given in image below and maskout information of no use for spatial mean operation.
I used to cut data or keep points of target but it affects spatial mean operation.
Amjad Iqbal
Amjad Iqbal on 21 Sep 2022
From .mat file we can have this image named *output* given below.
Now I need to keep information of these two circular targets, according to the colormap its value varies roughlt from -20 to 0
I want to keep this information and mask out rest of the information below -45 to -20 with NaN as given in image above
having white background and two targets.
After that I need to apply sliding window for spatial mean operation.

Sign in to comment.

Accepted Answer

Chunru on 22 Sep 2022
websave("two_targets.mat", "");
load('two_targets.mat'); % data
imagesc(intensity,[-45 0]);
intensity(intensity<-20) = nan;
imagesc(intensity,[-45 0]);
Amjad Iqbal
Amjad Iqbal on 22 Sep 2022
@Chunru and @Walter Roberson Thank you dear both!
It helps me a lot and work perfecly, and I learnt somthing new, I really appriciate your inputs

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!