sperm-sizer

:straight_ruler: Sperm Sizer

Sperm Sizer is a tool that helps you measure the lengths of sperm cells in digital photos by simply clicking on the sperm cell you want to measure. It can be customized to measure different components such as the head, body and tail.

Download Sperm Sizer 1.6.6

Sperm Sizer Demo

:page_facing_up: Scientific Article

For more information and ground-truth data, view our methods paper on Sperm Sizer.

Sperm Sizer: a program to semi-automate the measurement of sperm length

Please cite this paper if you decide to use Sperm Sizer in your publication.

:star: Features

:keyboard: Controls

| Select | Pan | Zoom | Undo | Redo | Next Image | Previous Image | | :–: | :–: | :–: | :–: | :–: | :–: | :–: | | Left Click | Drag with Right Click</kdb> | Scroll Wheel</kdb> | A</kdb> | D</kdb> | S</kdb> | W</kdb> |

:joystick: Usage

Sperm Cell Measurement

Basic Instructions

  1. Use the Add Images button to load photos of the sperm cells you want to measure.
  2. For each sperm cell, select:
    1. The start of the sperm cell.
    2. The connection between the head and the body.
    3. The connection between the body and the tail.
    4. The end of the sperm cell.
  3. Export the measurements using the Export Measurements button.

Requirements

Sperm Sizer requires Java 8 or later to run. Make sure you have Java installed on your device.

:microscope: Measurements

Unit Conversions

Measurements are provided in pixels. For conversion into a different unit (e.g. micrometers), export the measurements to a CSV file and perform the conversions using Microsoft Excel.

Measurements in Microsoft Excel
Measurements in Microsoft Excel

Definition of Length

The length of a line is calculated by treating each pixel as a coordinate and summing up the straight-line distance between each pixel. For example, a 3-pixel straight line would have a length of 2 pixels, and a 2-pixel diagonal line would have a length of √2 (≈1.41) pixels.

3-pixel Straight Line (l = 2) 2-pixel Diagonal Line (l = √2)
3-pixel Straight Line 2-pixel Diagonal Line

:blue_book: How It Works

How It Works

Tracing Algorithm

1. Designate four points.
2. Binarize the image via thresholding.
    * Use the smallest threshold value that results in all points being connected.
3. Select the group of pixels connecting the points together and:
    1. Remove all other pixels.
    2. Fill holes.
4. Perform line smoothing:
    1. Apply Gaussian blur.
    2. Repeat Step 2.
5. Skeletonize.
6. Remove all pixels within TrimRadius pixels of the first and last point.
7. Snap both ends of the line to the first and last point.

Note: Snapping, trim radius and Gaussian blur intensity can be configured in the settings.

:gear: Settings

Sperm Sizer can be configured via config.ini, a file located in the same directory as Sperm Sizer.

:bulb: Tips

Optimal Conditions

For best results, ensure that:

Note: If the sperm cells on your image are lighter than the background, consider inverting the colors (e.g. using Microsoft Paint).

Scenario Ideal Not Ideal
A Non-overlapping Sperm Cell Overlapping Sperm Cell
B Dark Cells on Light Background Light Cells on Dark Background
C Good Contrast Bad Contrast

Straight-line Extensions

Drawing Lines

When selecting the first or last point on a sperm cell, you have the option of drawing a line. To do this, simply Left Click and drag. This is useful when you are having trouble measuring sperm cells with very faint heads and/or tails.

Note: When drawing a line, always drag from head to tail. Dragging in the opposite direction (tail to head) will produce incorrect results.

Dragging from Head to Tail Dragging from Tail to Head
Drawing Line from Head to Tail Drawing Line from Tail to Head

Custom Components

Two-point Measurement

To measure different components, edit the Labels property in config.ini. For example, if you only want to measure the entire length of a sperm cell, use Labels=Sperm Cell. This would measure 1 component named “Sperm Cell”, requiring 2 inputs.

Note: By default, Labels=Head,Body,Tail. This means 3 components are measured (“Head”, “Body” and “Tail”), requiring 4 inputs.

:information_source: Additional Information

Sperm Sizer uses a version of ImageJ where the skeletonization function in the BinaryProcessor class is subject to a timeout. This allows for interruptible skeletonization. The JAR is available the lib directory.

SPERM COUNTER

https://github.com/aibolem/DeepSperm