ClearCanvas.ImageViewer.RoiGraphics.Roi.GetRawPixelValues C# (CSharp) Method

GetRawPixelValues() public method

Gets an enumeration of the raw pixel values contained within the region of interest.
public GetRawPixelValues ( ) : IEnumerable
return IEnumerable
		public IEnumerable<int> GetRawPixelValues()
		{
			if (PixelData == null)
				yield break;

			Rectangle bounds = GetBoundingBoxRounded(true);
			for (int x = bounds.Left; x <= bounds.Right; x++)
			{
				for (int y = bounds.Top; y <= bounds.Bottom; y++)
				{
					PointF p = new PointF(x, y);
					if (Contains(p))
						yield return PixelData.GetPixel(x, y);
				}
			}
		}