FahamecV 1 : A Low Cost Automated Metaphase Detection System

In this study, FahamecV1 is introduced and investigated as a low cost and high accuracy solution for metaphase detection. Chromosome analysis is performed at the metaphase stage and high accuracy and automated detection of the metaphase stage plays an active role in decreasing analysis time. FahamecV1 includes an optic microscope, a motorized microscope stage, an electronic control unit, a camera, a computer and a software application. Printing components of the motorized microscope stage (using a 3D printer) is of the main reasons for cost reduction. Operations such as stepper motor calibration, are detection, focusing, scanning, metaphase detection and saving of coordinates into a database are automatically performed. To detect metaphases, a filter named Metafilter is developed and applied. Average scanning time per preparate is 77 sec/cm. True positive rate is calculated as 95.1%, true negative rate is calculated as 99.0% and accuracy is calculated as 98.8%. Keywords-automation; metaphase detection system; focus; image processing; 3D printing; FahamecV1


INTRODUCTION
Analysis of metaphase plate images by a computer aided application is a main method used in hospitals and laboratories.In this stage, accuracy plays an important role.Automatic metaphase detection and retrieval with high objective resolution for image analysis is quite beneficial [1].Cytogenetic analysis includes two stages: detection of metaphase and karyotype analysis [2].It is essential that all chromosomes are monitored and classified with high accuracy.These monitoring and classification processes are usually performed by clinical experts.This situation causes humandriven mistakes, wrong diagnosis and loss of time and thus automated systems are bound to be employed.Metaphase detection system is a system which automatically scans, detects and monitors metaphases [3].A metaphase detection system generally includes a camera attached to the ocular piece and a computer controlled motorized microscope.In addition to this, artifacts of other cells and paint residues exist.Removing these artifacts and residues is the first step of a high qualified analysis [4].The improving of diagnostic accuracy and consistency has been studied in [5,6].Researchers have developed many systems to detect metaphases [1][2][3][7][8][9][10][11].Authors in [1] have developed a system which detects metaphases painted with FISH and uses a fluorescent light source.Authors in [2] have released a metaphase detection system named Metafer2 which registers X-Y-Z coordinates of metaphases.Authors in [3] have produced a low-cost system to detect metaphases using morphological operations.Authors in [4] have utilized artificial neural network to identify metaphases and nuclei.In [10], author used a trained classifier to separate metaphases with non-metaphases.Authors in [12] have applied and test computer aided methods such as classical statistical methods, artificial neural networks, knowledge based fuzzy logic systems.Authors in [13] tested the performance of four commercial systems.
There are two groups considered in metaphases detection systems assessment, the true positives (TP) and true negatives (TN).While TP stands for areas including metaphases, TN stands for areas not including metaphases.Under ideal conditions, these two groups are independent.However, independence is inattentive at metaphase detection systems since object detection is a complicated process.Consequently, results obtained by applications are evaluated by a clinical expert [14].In this study, a metaphase detection system named FahamecV1 consisting of hardware and software has been implemented.FahamecV1 is low cost and modular, can be connected with different microscopes, provides high accuracy and high scan speed.Most components of FahamecV1 are printed by a 3D printer and can be reprinted and easily modified.FahamecV1 can be connected with a manual microscope in a fast manner.All components used in FahamecV1 are composed of single, independent and easily provided parts.In addition to hardware properties of FahamecV1, an application has been developed to selfcalibrate, perform focus, detect metaphases and save coordinates of detected metaphases in a database.A filter named Metafilter was developed in this study and is applied to detect metaphases.FahamecV1 excels among other systems because of the easy use of hardware and software, low cost, high scan speed and high accuracy.

II. SYSTEM MATERIALS
FahamecV1 is composed of an optic microscope, a motorized microscope stage, an electronic control unit, a camera, a computer and an application.Figure 1 depicts an overview of the system.A. Camera A DigiRetina16 USB camera produced by Tucsen is used to obtain images from the microscope.Images are captured using 25 frames per second (FPS), 4 megapixel (MP) resolutions, auto white balance and auto exposure time.

B. Microscope
The produced stage is connected to binocular Soif optic microscope.This microscope is selected because of its low cost.4X, 10X, 40X and 100X objectives exist on the microscope and 10X ocular is attached.It is a manual microscope which has a halogen light source, focus and coaxial screws.The produced microscope stage is connected to the microscope by removing its original microscope stage.Halogen light source is replaced with led light source since halogen light source brings about noises on images.10X objective is preferred as an active objective to scan.0.45X connection mount is used to attach camera with ocular.

C. Electronic Control Unit and Computer
An electronic control unit is located in a metal box which has a 12 cm diameter fan.A socket structure is used.Hence, it is assured that FahamecV1 is easily assemblied and disassemblied in case of failure or transport.A power supply with output properties of 12V and 5A is selected.A4988 stepper motor drivers are selected to control stepper motors.Arduino Mega 2560 is selected as a main control card.Commands of the control card are sent by the application."#" symbol is put between the numbers of the activated stepper motor, count of steps, delay time for steps and direction of rotation.The "$" symbol is put at the end of the command line.Hence, the command shown in Figure 2 is sent to the control card as a single command.The command line sent to the control card.
The used computer has an Intel i7 2.50 GHz CPU and 8 GB RAM.C and C# programming languages are preferred for the developing of the application.C programming language is used in Arduino IDE and C# programming language is used in Microsoft Visual Studio 2015.

D. Produced Motorized Microscope Stage
The automated motorized microscope stage produced in this study is composed of stepper motors, ball screws and nuts, miniature rails and runner blocks, end-stop modules, carrier component, main table, preparates carrier and connection materials.The main table is produced using aluminum materials by laser cutting.The carrier component used at the bottom to provide connection of motorized microscope stage to the microscope and the other plastic parts are produced using PLA materials by the 3D printer.12 mm diameter ball screws, 4mm nuts and the stepper motors whose types are NEMA17 and 200 steps for a rotation are used.Heights of the miniature rails and the runner blocks which provide the main table with slipping on Y axis are 10 mm.Limited space between the microscope objective and the light source is effectively used.The motorized microscope stage height is 26 mm (Figure 3).As a result of this, enough space for focus is created.Single and triple preparates can be scanned.The end-stop modules exist on each axis to identify home location.The modules are selected as mechanic switches.The focus screw and shaft of the stepper motors are composed by a coupler (printed on 3D printer) to make Z axis move.Overview of the 3D drawing of the produced motorized microscope stage.

E. Preparates
The preparates used in this study are not highly qualified for analysis, idle and need to be reprepared.Images are captured at 2304x1728 resolutions using the preparates.Size of the preparates is 76x26 mm.The painted areas whose widths on the preparates are 28 mm are used for patient information and brand labels.The 48x26 mm2 areas on the preparates are transparent.36x16 mm2 areas on the preparates are accepted as active scanning areas.The remaining areas are accepted as inactive areas and are not scanned because metaphases whose chromosomes are either rarely or excessively spread exist on inactive areas.

III. METHODS
The application was developed at four stages: scanning preparation, focus, detection of metaphases and saving coordinates of metaphases.The application automatically brings preparates to the initial point, communicates with the electronic control unit, calibrates axis, performs focus, detects metaphases and saves coordinates of metaphases in a database.A scanning name is the only one necessary parameter needed for one to start scanning.During scanning, metaphase images and parameters such as the number of detected metaphases, metaphase coordinates and frame scanning time are monitorized synchronously.One of the interfaces provides access to enter properties as: full step number for a rotation of the stepper motors, micro step levels of the stepper motor drivers and size of the ball screw pitch.

A. Scanning Preparation
The application sets a rectangle as the current scanning area.The rectangle width is 1.2 mm on X axis and the rectangle height is 0.9 mm on Y axis.To scan preparates, it is needed to scan 30 different image areas on X axis and 18 different image areas on Y axis.Hence, the preparates are split to a grid which contains 540 cells of 18 rows and 30 columns.The application detects metaphases by scanning each cell.An end-stop module which identifies home location on each axis is used.The application sets all coordinates to zero by moving to home location before each scanning.Therefore, FahamecV1 calibrates itself automatically.

B. Converting the Stepper Motor Steps as Metric Units
A specified step number is necessary for a full rotation.Although the stepper motors take 200 full steps for a rotation, the stepper motor drivers provide 3200 steps for a rotation.This rotation movement is converted to linear movement by the ball screws and can be used with different pitches.However, value of steps for a rotation is changed after either the stepper motors, the stepper motor drivers or the ball screws is replaced.Thus, it is needed to calculate metric changes of the preparate on X-Y-Z axis.Micro step level as M, full steps for a rotation as FS, distance as D and ball screw pitch as SP are used to obtain the equation which finds how many steps should be taken by the stepper motor (1).This equation explains how the application controls the stepper motors.This control is performed until the stepper motor moves to 0.01 mm on X-Y axis and 0.001 mm on Z axis.

C. Focus
Since blurred images can directly affect diagnostic accuracy, it is critical to obtain focused high-resolution microscopic images efficiently.Thus, an autofocus technique is required for high efficiency microscopic system in clinical practice [15].Capturing images and detecting metaphases with high accuracy depends on performing proper focusing.In the application, there are two focus functions: one-way focus and two-way focus.There are also first focus, main focus and short focus which are components of one-way and two-way focuses.FahamecV1 automatically decides which focus component should be applied.First focus and main focus use one-way focus function.Short focus uses two-way focus function.First focus is applied at the beginning of scanning.Short focus is applied once at every 10 cells.Main focus is applied when short focus fails, because short focus runs at a limited distance while main focus runs from home location of Z axis.All focus components are applied automatically by FahamecV1.Histograms of captured images are investigated at red, green, blue and intensity bands.It is proved that the best result is obtained at intensity band when the thresholding method is applied (Figure 4).Focus value is calculated when a comparison between all pixel counts and white pixel counts is made.Focus position is identified when the focus value is calculated as maximum.When main focus is performed, Z axis is located at home location and the stepper motor starts rotating counter-clockwise.The focus value is calculated at each 0.002 mm.When a new focus value is calculated, it is compared with the current focus value.If the new focus value is higher than the current focus value, the new focus value is replaced with the current focus value.When the new focus value is lower than the current focus value, calculation of focus value is stopped.As a result, the stepper motor rotates clockwise and is located at maximum focus position.Hence, necessary focus process is completed before FahamecV1 starts scanning (Figure 5).
The shape of the preparate carrier can be deformed due to the ambient temperature changes because materials used as preparate carriers are produced using PLA materials.In this case, short focus is necessary to be applied.While short focus is applied, the stepper motor rotates until obtaining an image and a first local focus value is calculated as maximum of this period.After that, the stepper motor rotates by changing direction until obtaining a second image and a second local focus value is calculated as maximum of the second period.The two local maximum focus values are compared and the higher one is identified as a short focus value.Z axis is located at short focus position.Therefore, the best qualified image is obtained (Figure 6).

D. Detection of Metaphases
After focus is performed, FahamecV1 starts scanning cells.The images are converted to intensity band and contrast stretching method is applied.Bradley local thresholding method is applied on the images [16].Sobel edge detection method, erosion and dilation processes are applied.As a result of that, metaphases and non-metaphases stay on the images.Metafilter is applied to detect metaphases and eliminate nonmetaphases (Figures 7-8).

E. Saving Coordinates of Metaphases
Center coordinates of detected metaphases are calculated and saved in a database.Relocation can be applied for each detected metaphase whose coordinates are saved.Thus, preparations for chromosome scanning with 100X objective are to be completed.

IV. RESULTS AND DISCUSSION
This study is evaluated according to customizability, scanning time, cost, loss of relocation and accuracy.The fact that FahamecV1 can easily connect and disconnect with other microscopes enhances FahamecV1's ease of use.FahamecV1 is faster than noncommercial systems based on scanning time per preparate.It is presented that FahamecV1 is quite cheap when the camera, the microscope and the computer are not considered.

A. Customizability
The stepper motors, the stepper motor drivers and the screw balls can be changed in case of failure.When the same materials cannot be found, different types of stepper motors, stepper motor drivers and screw balls can be used.By using one of the interfaces, properties of the different types of materials can be entered and saved.Hence, FahamecV1 continues scanning without data loss.The fact that many components are specially printed by a 3D printer makes material supply easier.The connection of FahamecV1 with the manual microscope is performed by using four screws for carrier components and one screw for Z axis.It is also possible that the microscope can be restored by removing the five screws.If FahamecV1 is requested to connect with another microscope, it can be done easily by suitable printed carrier components (Figure 9).

B. Scanning Time
Time interval is between 34 and 78 milliseconds per image during all image processing operations.The time interval is between 384 and 506 sec to perform scanning on active scanning areas (36x16 mm 2 ).During scanning, focus is performed 54 times on average.The time passing while performing focus is included total scanning time.FahamecV1 needs 77 sec average time to scan per cm 2 .The average scanning speed of FahamecV1 is measured as 1.29 mm 2 /sec.

C. Cost
Low cost materials are selected to produce FahamecV1.The expenditure was 600 dollars for the microscope, 1285 dollars for the camera, 285 dollars for the electronic control unit, 22 dollars for the filament used in 3D printer, 71 dollars for laser cutting and 28 dollars for other expenses.Total expenditure was 2291 dollars including taxes (Table I).

D. Loss of Relocation
The screw balls, the nuts, the miniature rails and the runner blocks used to produce the motorized microscope stages are generally preferred in industry area.Therefore, loss of relocation occurs when measurements in micron level are performed.The effect of these measurements on 100 micron steps is measured and modeled with a microscope micrometer (Figure 10).Spearman, Kendall Tau and Pearson correlation analysis are performed on obtained measurements.As a result of these analyses, coefficient of correlation is obtained as close to zero and P-values are very close to each other (Table II).When the measurements obtained on X and Y axis are investigated at the time-series plot and scatter plot of X versus Y, no correlated results are found.Hence, the obtained errors of relocation are not systematic and increased.Besides, it is seen that the obtained errors were realized randomly in a specific area (Figure 11).

E. Accuracy
A total of 3018 objects obtained as a result of scanned images and are randomly selected and evaluated by a cytogeneticist.184 of 3018 objects are identified as metaphases by the application.155 of 184 objects as metaphase and 29 of 184 objects as non-metaphase are marked by a cytogeneticist.True positive rate (TPR) is calculated as 95.1% and true negative rate (TNR) is calculated as 99.0%.Positive predictive value (PPV) is calculated as 84.2%.Negative predictive value (NPV) is calculated as 99.7%.The fact that TNR, PPV and NPV are quite high brings the application to the fore of detecting objects as a metaphase and a non-metaphase.
Accuracy is calculated as 98.8% and F1 Score is calculated as 0.893 (Table III).

V. DISCUSSION
The ball screws, the nuts, the miniature rails and the runner blocks used in FahamecV1 are selected from products used for solution of industrial type.The loss of relocation can be reduced by choosing more sensitive products.The scanning time obtained in FahamecV1 is compared with the scanning time in the literature in Table IV.The accuracy obtained in FahamecV1 is compared with the literature in Table V.The main reason why TPR is low in FahamecV1 is the obtaining of images using low-qualified preparates.Paint artifacts, metaphases which cannot be spread and paint loss are considered to be the causes.In future versions, all fixed parts will be produced with a 3D printer instead of laser cutting materials.Thus, the cost of FahamecV1 will be further reduced.The height and weight of the motorized microscope stage can be reduced by choosing thinner ball screws.The stepper motors can be replaced with smaller ones thus reducing the total weight and power consumption.

VI. CONCLUSION
A low cost and high accuracy solution for metaphase detection is investigated in this paper.The proposed system, FahamecV1, is described and the various aspects of its operation are investigated and compared to other systems described in the literature.Results show that FahamecV1 provides a fast, highly accurate and low cost solution.

Fig. 2 .
Fig. 2.The command line sent to the control card.

Fig. 3 .
Fig. 3.Overview of the 3D drawing of the produced motorized microscope stage.

Fig. 4 .
Fig. 4. Original image, b.Image view of R band and its histogram graph, c.Image view of G band and its histogram graph, d.Image view of B band and its histogram graph, e. Image view of Intensity band and its histogram graph.

Fig. 11 .
Fig. 11.Time series plot of X and Y(upper), scatter plot of X versus Y (lower).

ACKNOWLEDGMENT
This work was supported by Scientific Research Projects Coordination Unit of Karabük University.Project Number: KBÜ-BAP-15/2-DR-024

TABLE OF CORRELATIONS
AND P-VALUES.

TABLE III .
CONFUSION MATRIX OF SCANNING RESULTS.

TABLE IV . TIME COMPARISON Metaphase Detection System Scanning speed (mm 2 /sec) Average Time Per Preparate (sec)
*: not reported

TABLE V .
*: not reported