I have data from a fits file that is displayed with the help of imagesc. The image is very dark (data range in [20 2200]). When I use imcontrast(gca) i can manually remove outliers, and if 0.01% of the outlieres is removed, the data range is [59 1175], and I get the desired contrast.
Is there any way to remove the outliers in the command window, as I have many files to be analysed?
p.s. I know i can use the command imagesc(data, [cmin cmax]),colormap(gray), but the problem is that I dont know cmin and cmax for the different images.
Any help appriciated,
No products are associated with this question.
ndev = 3; data_mean = mean(data(:)); data_std = std(data(:)); data_min = min(data(:)); data_max = max(data(:)); cmin = max( data_min, data_mean - ndev * data_std ); cmax = min( data_max, data_mean + ndev * data_std ); imagesc( data, [cmin, cmax] )