/code/getpoints.m
Objective C | 25 lines | 23 code | 2 blank | 0 comment | 1 complexity | d0ecabf14e22648fd3cb7164866ca4ca MD5 | raw file
1%************************************************************************************************************ 2% "getpoints.m" creates a set of points corresponding to the average 3% ROI value in each slice . 4% inputs: 5% im- the image from which the ROI is selected. 6% num_s- the image's number of slices 7% ROI- an image with the same size of 'im':the pixels of the ROI equal 1 8% and the others 0. 9% output: 10% points- the set of averaged points 11% SD- the standard deviation 12% mask_size- the number of pixels in the chosen ROI 13%************************************************************************************************************ 14 15function [points,SD, mask_size] = getpoints(im, num_s,ROI) 16 17for j=1:num_s 18 im_mask=im(:,:,j).*ROI; 19 mask_temp=im_mask(im_mask>0); 20 points(j)=mean(mask_temp); 21 % SD= std(im_mask(im_mask>0))/points(j); 22 SD(j)= std(mask_temp); 23end 24mask_size=length(mask_temp); 25end