i have an image that i segmented using the image segmenter app in matlab . i need to perform mathmatical operations on the segmented part only (which is all the values greater than zero) while maintaing the same image size .
the segment image function is giving me a mask and a segmented image how do i use this mask to process the pixels where the mask equals (1) and ignore the pixels where the mask equals(0) while maintaining the same image size . i tried the (M=feval (A(this is a function handle),O)) function followed by (M=M(BW)) but it seems to change the image size
N = 256 ;
I = Phantom3D('modified shepp-logan',N) ;
I = squeeze(I(:,128,:)) ;
[BW,O] = segmentImage(I) ;