## 2 Software Description
### Image Processing  
In the tracking mode, AniWellTracker computes the coordinates of the animal's centroid by performing a series of image processing from time-lapse images. In the review mode, users can review the tracking path obtained from the tracking mode and reprocess the data to obtain various analysis results or output them as charts. To analyze the location of the animal in the tracking mode, the original image was first converted into a black and white image, and then converted into a binary image consisting only of white (gray value = 255) and black pixels (gray value = 0) (Figures 1 and 3). Region extraction is then performed to detect a white pixel object, and the size, area, and centroid coordinates (x, y) of the object are calculated. The movement path of the animal can be obtained by connecting the centroid coordinates of the animal obtained from time-lapse images. The detailed image-processing method is described below. To track the small animals in the image, binarization was first performed to detect objects with different brightness from the background. There are several binarization algorithms. When imaging an animal, the lighting conditions, including brightness and contrast, are different, and brightness may not be uniform throughout the entire image. AniWellTracker uses an adaptive thresholding algorithm [20] to create binary images. In AniWellTracker, the adaptive thresholding characteristics can be adjusted by setting the processing box size and threshold value. The processing box size refers to the size of the area where the average brightness is calculated, and is set slightly larger than the size of the object to be detected. The threshold value represents the sensitivity of binarization. The higher the value, the better the detection of objects, with a small difference in brightness from the background. However, the larger the value, the more severe the noise. Next, region extraction was performed to detect white objects in the binary image. A method called connected-component labeling [22; 23] was used to detect a white object on a black background. While sequentially scanning the pixels of an image, all adjacent white pixels are assigned the same number (label) and other unconnected white objects are assigned a different number. When the region extraction is completed, a lump of all white pixels in the image is detected. Because an image may contain various noises, two or more white objects may be detected in an individual well. AniWellTracker can only detect valid animals using the appropriate area of the white object and bounding box size range (minimum-maximum value) set by the user to determine which white object is an animal. If two or more white objects satisfy this condition, the white object with the largest area is finally determined to be an animal. When only one animal object is detected, the centroid coordinates can be calculated by calculating the average of the x-coordinate and y-coordinate values of the white pixels. After obtaining the centroid coordinates of the individual wells in the time-lapse images, the tracking path was obtained by sequentially connecting the coordinates. The movement distance L (in pixels), which is the distance between the centroid coordinates of two time-lapse images, was then calculated (L = sqrt((x\({}_{2}\)-x\({}_{1}\))\({}^{2}\) + (y\({}_{2}\)-y\({}_{1}\))\({}^{2}\)), and the total distance traveled was calculated by adding all movement distances. The speed of the animal (in pixels/time) was determined by dividing the movement distance or total distance traveled by the time interval between specific times. In addition to centroid coordinates, distance traveled, and speed, AniWellTracker measures the position of the animal (relative position within the ROI, centroid angle between the center of the ROI and the animal position, and distance between the center of the ROI and centroid).