/code/getpoints.m
http://ne-proj.googlecode.com/ · Objective C · 25 lines · 23 code · 2 blank · 0 comment · 1 complexity · d0ecabf14e22648fd3cb7164866ca4ca MD5 · raw file
- %************************************************************************************************************
- % "getpoints.m" creates a set of points corresponding to the average
- % ROI value in each slice .
- % inputs:
- % im- the image from which the ROI is selected.
- % num_s- the image's number of slices
- % ROI- an image with the same size of 'im':the pixels of the ROI equal 1
- % and the others 0.
- % output:
- % points- the set of averaged points
- % SD- the standard deviation
- % mask_size- the number of pixels in the chosen ROI
- %************************************************************************************************************
-
- function [points,SD, mask_size] = getpoints(im, num_s,ROI)
-
- for j=1:num_s
- im_mask=im(:,:,j).*ROI;
- mask_temp=im_mask(im_mask>0);
- points(j)=mean(mask_temp);
- % SD= std(im_mask(im_mask>0))/points(j);
- SD(j)= std(mask_temp);
- end
- mask_size=length(mask_temp);
- end