9: Boar Sperm Analysis 2

After you finish the preprocessing you are ready to extract sperm cells from the image. You will extract each cell into to a separate image and get the sperm head mean intensity. Sperm cells should be analyzed one by one. Make a subVI to contain the analysis.


subVI – Get Data in Image


  • Input: Original image, preprocessed image, error in
  • Output: TypDef with cell data, SpermCellArray(TypDef) and error out

Next you start on working inside the Get Data in Image subVI

  • Use ‘IMAQ Particle Analysis’ to get information on particle area and bounding rect. Use the area information to filter for elements that are too large

Make a subVI that extracts the cell from the image using the bounding rect information. Use this subVI to extract cell from both original and preprocessed image


subVI – Extract Cell in Image


  • Input: Image, new image reference, bounding rect information and error in
  • Output: Extracted image and error out

Make a subVI that removes anything but the head from the cell. Use erode and dilate morphology with a structuring element 3-by-3 four times to get the result


subVI – Headseparator


  • Input: Preprocessed cell image and error in
  • Output: Head of cell image and error out

Next you can use ‘IMAQ Histograph’ to get mean intensity from the cell head. The output from your Headseparator can be used as mask on your original image. When you finished analyzing all cells use ‘IMAQ dispose’ to delete your image references from memory.

Lastly you need to save each cell into an image array and make a TypDef that contains bounding rect data, cell area and mean head intensity from each cell. Display this information on your interface.

Created by Samuel Thrysøe © 2013