-1

Currently I am able to open, display and do some image processing on DICOM images. I can also use the mouse to draw polygons.

Can someone give me an indication on how I can make the inside of the polygon 1's and the outside 0's. What I would like to do is then to multiply this "mask" with the original image, therefore creating a region of interest. I'm interested in the information in that ROI.

Amit Joshi
  • 15,448
  • 21
  • 77
  • 141
Adolf
  • 23
  • 3

1 Answers1

3

Use ImageMatrix(string) to create the suitable helper object. From this object, access the pixel data as floats via the Image property.

Next, you can create for example a filled rectangle image (1 inside, 0 outside the rectangle) with the same dimensions and geometry as the pixel data, multiply each pixel in the image data with the corresponding rectangle pixel, and count the number of non-zero pixels in the composite (original image x rectangle) image.

Anders Gustafsson
  • 15,837
  • 8
  • 56
  • 114