I cannot understand what's the problem. This code works for other jpg images but for my dicom stack of images it comes up with an error (see subject line), to the _Background_blending = bsxfun(@times, Background, bsxfun(@minus,1,alpha)); line. PLease Help. Thanks!
Foreground = im2double(mask)*350-50;Background = im2double(I);% build alpha layer for Foreground
alpha = bsxfun(@times, ones(size(Foreground,1), size(Foreground,2)), .6);figure(3)imshow(alpha)% find a scale dynamically with some limit
Foreground_min = min( min(Foreground(:)), -50 );Foreground_max = max( max(Foreground(:)), 300 );% overlay the image by blending
Background_blending = bsxfun(@times, Background, bsxfun(@minus,1,alpha));
Best Answer