How to rescale the intensity range of a grayscale 3 dimension image (x,y,z) using Matlab -
i can't find information online intensity rescaling of 3d image made of several 2d images.
i'm looking same function imadjust
works 2d images.
my 3d image combination of 2d images stacked have process 3d image , not 2d images 1 one.
i can't loop imadjust because want process images one, consider information available, in directions.
for applying imadjust
set of 2d grayscale images taking whole value account, trick might work
a = imread('pout.tif'); = imresize(a,[256 256]); %// re-sizing match image b's dimension b = imread('cameraman.tif'); im = cat(3,a,b); %//where a,b separate grayscale images of same dimensions %// if have images separately edit line %// im = cat(2,a,b); %// , avoid next step %// reshaping 2d matrix apply imadjust im = reshape(im,size(im,1),[]); out = imadjust(im); %// applying imadjust %// reshaping original shape out = reshape(out,size(a,1),size(a,2),[]);
to check:
x = out(:,:,1); y = out(:,:,2);
as see workspace image, first image (variable x
) not re-scaled 0-255
previous range (variable a
) not near 0 point.
workspace:
edit: one-step process this: (as other answer suggests)
%// reshaping single column using colon operator , using imadjust %// reshaping out = reshape(imadjust(image3d(:)),size(image3d));
edit2:
as have image cell arrays in i2
, try this:
i2d = cat(2,i2{:})
Comments
Post a Comment