A pathological section focus selection method and system based on focal plane counterfactual update and Z-axis dynamic reachability

By introducing dynamic Z-axis parameters into pathological slide scanning, generating virtual focal length, and assessing first-pass risk, the problem of neglecting Z-axis dynamic motion capability in focus selection is solved, achieving higher scanning efficiency and clarity.

CN122860704BActive Publication Date: 2026-11-06SHENZHEN SHENGQIANG TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202611373207.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-09-07
Publication Date
2026-11-06
Estimated Expiration
2046-09-07

AI Technical Summary

Technical Problem

In pathological slide scanning, existing technologies neglect the dynamic motion capability of the Z-axis in focus selection and lack a focus sampling benefit prediction mechanism, resulting in inaccurate assessment of defocus risk and an inability to prioritize candidate points that can minimize subsequent defocus and rescanning losses before scanning.

Method used

By acquiring the area to be scanned from the pathological slide, a predetermined XY scan trajectory and patch time series are generated, a current focal plane model is established, candidate focal points are determined, and a virtual focal length is generated without performing real focusing. The Z-axis control sequence of the virtual focal plane model is calculated, the first crossing risk of the candidate focal point is assessed, and finally the target candidate focal point is selected for real focusing.

Benefits of technology

It improves the prediction accuracy of the focal plane model, effectively smooths the Z-axis control sequence, reduces defocusing, improves scanning efficiency and clarity, and avoids redundant sampling and insufficient sampling in areas with severe fluctuations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122860704B_ABST
    Figure CN122860704B_ABST
Patent Text Reader

Abstract

This invention provides a method and system for selecting the focal point of pathological slides based on focal plane counterfactual updating and Z-axis dynamic reachability. It addresses the problems of existing focal point selection methods that neglect Z-axis dynamic motion capabilities and lack a sampling benefit prediction mechanism, leading to scanning defocusing or sampling redundancy. The method predicts the target focal length based on a predetermined scan trajectory and focal plane model, and determines the actual reachable Z-axis position by combining Z-axis mechanism dynamic parameters. Candidate focal points are identified on the scan trajectory, and a virtual focal length is generated and the focal plane model is updated without driving hardware focusing. The reduction in defocusing risk is assessed based on the deviation between the target focal length before and after the update and the actual reachable position. The target focal point is selected based on the risk reduction, and the hardware is driven to perform true autofocus. This invention effectively reduces the risk of scanning defocusing and sampling redundancy, and is mainly used in pathological slide scanning equipment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the fields of pathological slide microscopic imaging, automatic focus control and computational optics, and specifically relates to a method and system for selecting the focus of pathological slides based on focal plane counterfactual updating and Z-axis dynamic reachability. Background Technology

[0002] Digital scanning of pathological slides typically utilizes a microscope objective, imaging sensor, XY motion platform, and Z-axis focusing mechanism to continuously image the tissue area on the slide at high magnification, and then stitches multiple images together to form a whole-slide digital image. Due to factors such as slide tilt, coverslip warping, variations in mounting adhesive thickness, tissue undulations, tissue wrinkles, clamping errors, and equipment thermal drift, the optimal focal length usually varies at different locations on the same pathological slide.

[0003] To ensure clear scanned images, scanning equipment typically performs autofocus at several positions first, establishes a focal plane model based on the measured focal points, and then generates Z-axis control commands along a predetermined XY scanning trajectory, causing the objective lens, slide, or other focusing elements to follow the predicted focal plane movement. Insufficient focal points may prevent the focal plane model from reflecting local undulations; excessive focal points will increase XY movement, Z-axis search, platform stabilization waiting time, and exposure processing time.

[0004] Current methods for selecting focal points typically employ rules such as fixed grids, fixed representative points, tissue area proportions, tissue boundaries, or local texture saliency. Another approach adds focal points based on focal plane prediction variance, model uncertainty, or local fitting residuals. These methods primarily evaluate whether the focal point location itself is significant, uncertain, or far from existing focal points, without directly addressing a question more closely related to the operation of the scanning equipment: whether a candidate point, once actually measured, can improve the Z-axis control results along the entire subsequent scanning trajectory.

[0005] For continuous motion or high-speed pathological scanning, even if the target focal length given by the focal plane model is mathematically accurate, the Z-axis actuator may not be able to reach the target position within a finite time between adjacent blocks. Especially when the focal plane slope is large, the scan trajectory changes direction, the height difference between adjacent strips is significant, or the XY platform speed is high, the Z-axis may be limited by the maximum speed, maximum acceleration, rate of change of maximum acceleration, control delay, and mechanical hysteresis, resulting in the actual achievable position lagging behind the target focal length.

[0006] Therefore, both focal plane model error and Z-axis dynamic tracking error jointly determine whether a patch is out of focus. Using only the local prediction uncertainty of the focal plane model as the basis for focus selection may result in choosing locations that significantly improve model statistics but offer limited help to the actual scan quality. Generating candidate focuses solely based on tissue edges, color, or texture may also ignore focal plane control-sensitive areas and dynamically inaccessible areas on the Z-axis. For example, a candidate point located in an isolated small tissue fragment may have an unpredictable focal length, but after measurement, it only affects a small number of patches, having little impact on the Z-axis control sequence on the remaining scan trajectory. Another candidate point may not have a significant prediction difference, but it is located in a transitional region where the scan strip height changes. After measurement, it can correct the target Z-axis sequence of a longer trajectory, ensuring that the actual Z-axis trajectory does not exceed speed or acceleration limits, thereby reducing consecutive out-of-focus patches, slowing down for waiting, and requiring local rescanning.

[0007] Current technologies often determine whether to rescan based on image sharpness or measured focal length error after scanning. This is a correction after the scan result is obtained, and it cannot compare the different effects of multiple candidate focal points on the future scan control results before scanning, nor can it prioritize measuring candidate points that can minimize subsequent defocusing and rescanning losses. Summary of the Invention

[0008] The purpose of this invention is to provide a method and system for selecting the focus of pathological slides based on focal plane counterfactual updates and Z-axis dynamic reachability, in order to solve the problems of neglecting Z-axis dynamic motion capability, lacking a focus sampling benefit prediction mechanism, and inaccurate assessment of defocus risk in the prior art.

[0009] To achieve the above objectives, this technical solution provides a method for selecting the focal point of a pathological slide based on focal plane counterfactual updating and Z-axis dynamic reachability, including the following steps: S1: Obtain the tissue area to be scanned from the pathological section, and generate a predetermined XY scan trajectory and a tile time series corresponding to the predetermined XY scan trajectory. The tile time series includes at least the exposure time of each scan tile and the time interval between adjacent scan tiles that allows the Z-axis actuator to move. S2: Establish the current focal plane model based on the obtained measured focal points; S3: Based on the current focal plane model, the predetermined XY scanning trajectory, and the dynamic parameters of the Z-axis actuator, determine multiple candidate focal points on the remaining scanning trajectory; S4: Generate at least one virtual focal length for each candidate focus. Without performing real autofocus on the candidate focus, add the candidate focus and its corresponding virtual focal length to the current measured focus set to construct a virtual focal plane model corresponding to each candidate focus. S5: For each virtual focal plane model, generate the target Z-axis control sequence corresponding to the remaining scan patch along the predetermined XY scan trajectory, and perform dynamic reachability calculation on the target Z-axis control sequence based on the patch time series and dynamic parameters to obtain the actual reachable Z-axis position of each remaining scan patch at the corresponding exposure time. S6: Based on the optimal focal length, actual achievable Z-axis position, and focal depth of the corresponding objective lens determined by the virtual focal plane model corresponding to each remaining scan patch, establish the time-varying focal depth limit state of the remaining scan patch, and determine the first crossing risk of the remaining scan trajectory first crossing the focal depth safety zone based on the time-varying focal depth limit state. S7: Based on the change in the first crossing risk relative to the current risk for each candidate focus, select the target candidate focus from multiple candidate focuses to perform real autofocus.

[0010] Compared with existing technologies, this technical solution has the following characteristics and beneficial effects: 1. By introducing dynamic parameters such as speed, acceleration, control delay, and mechanical backlash of the Z-axis mechanism into the focus selection evaluation, the actual achievable Z-axis position of the scanning trajectory at the exposure time is calculated. This ensures that the selected target candidate focus can not only improve the prediction accuracy of the focal plane model, but also effectively smooth the target Z-axis control sequence and eliminate the defocusing phenomenon caused by the dynamic following lag of the Z-axis.

[0011] 2. By constructing a virtual focal length for candidate focal points within the algorithm and refitting the virtual focal plane model without driving the hardware to perform real focusing, the reduction in overall focus risk by performing focusing at candidate points is quantitatively evaluated in advance. This greatly avoids redundant sampling in flat areas and insufficient sampling in undulating areas, achieving higher overall image clarity and scanning efficiency with fewer focusing attempts.

[0012] 3. Combining the depth of focus of the microscope objective, the time-varying depth of focus limit state of the remaining scanning trajectory was constructed. Taking into account multiple sources of uncertainty such as focal plane fitting residual, encoder error, delay fluctuation and mechanical backlash, the first crossing probability or reliability index was introduced to quantitatively calculate the defocus risk of the entire trajectory and key areas. Attached Figure Description

[0013] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings: Figure 1 This is a flowchart of a pathological slide focus selection method based on focal plane counterfactual updating and Z-axis dynamic reachability according to an embodiment of this application; Figure 2This is a framework diagram of a pathological slide focus selection system based on focal plane counterfactual updating and Z-axis dynamic reachability according to an embodiment of this application; Figure 3 This is a schematic diagram of the hardware structure of an electronic device according to an embodiment of this application. Detailed Implementation

[0014] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with one or more embodiments of this specification. Rather, they are merely examples of apparatuses and methods consistent with some aspects of one or more embodiments of this specification as detailed in the appended claims.

[0015] It should be noted that the steps of the corresponding methods are not necessarily performed in the order shown and described in this specification in other embodiments. In some other embodiments, the methods may include more or fewer steps than described in this specification. Furthermore, a single step described in this specification may be broken down into multiple steps in other embodiments; and multiple steps described in this specification may be combined into a single step in other embodiments.

[0016] Example 1 like Figure 1 As shown, this scheme provides a method for selecting the focus of a pathological slide based on focal plane counterfactual updating and Z-axis dynamic reachability, including the following steps: S1: Obtain the tissue area to be scanned from the pathological section, and generate a predetermined XY scan trajectory and a tile time series corresponding to the predetermined XY scan trajectory. The tile time series includes at least the exposure time of each scan tile and the time interval between adjacent scan tiles that allows the Z-axis actuator to move. S2: Establish the current focal plane model based on the obtained measured focal points; S3: Based on the current focal plane model, the predetermined XY scanning trajectory, and the dynamic parameters of the Z-axis actuator, determine multiple candidate focal points on the remaining scanning trajectory; S4: Generate at least one virtual focal length for each candidate focus. Without performing real autofocus on the candidate focus, add the candidate focus and its corresponding virtual focal length to the current measured focus set to construct a virtual focal plane model corresponding to each candidate focus. S5: For each virtual focal plane model, generate the target Z-axis control sequence corresponding to the remaining scan patch along the predetermined XY scan trajectory, and perform dynamic reachability calculation on the target Z-axis control sequence based on the patch time series and dynamic parameters to obtain the actual reachable Z-axis position of each remaining scan patch at the corresponding exposure time. S6: Based on the optimal focal length, actual achievable Z-axis position, and focal depth of the corresponding objective lens determined by the virtual focal plane model corresponding to each remaining scan patch, establish the time-varying focal depth limit state of the remaining scan patch, and determine the first crossing risk of the remaining scan trajectory first crossing the focal depth safety zone based on the time-varying focal depth limit state. S7: Based on the change in the first crossing risk relative to the current risk for each candidate focus, select the target candidate focus from multiple candidate focuses to perform real autofocus.

[0017] The pathological slide focus selection method based on focal plane counterfactual updating and Z-axis dynamic reachability provided in this solution is applicable to area scan pathological scanners, line scan pathological scanners, continuous motion scanners, area scanning microscopes, and other microscopic imaging devices that control the focusing mechanism based on the spatial focal plane. This solution performs virtual focal plane updating for each candidate point, generates an exposure time reachable Z-axis trajectory under the real motion constraints of the scanner, establishes a time-varying limit state with the objective lens depth of focus, and determines the sampling value of the candidate point based on the reduced first-crossing risk or improved reliability index.

[0018] Regarding step S1: Step S1 of this scheme first controls the macro camera, low magnification objective lens or fast pre-scanning unit to acquire pre-scanning images of pathological slides, maps the pre-scanning images to the XY motion platform coordinate system, and obtains the tissue area to be scanned, where blank areas can be skipped and not used as formal scan blocks.

[0019] Furthermore, based on the tissue mask, objective lens field of view size, overlap rate of adjacent patches, platform speed, acceleration, exposure time, and scanning mode, a predetermined XY trajectory for the formal scan is generated. The predetermined XY trajectory records the position and time sequence of the scan patches that the XY motion platform passes through sequentially during the formal scan. The action time interval of adjacent scan patches is obtained to form a patch time sequence. That is, the patch time sequence is composed of the action time intervals of multiple scan patches arranged in the time sequence, which represents the motion time window during which the Z-axis actuator is allowed to adjust the focus during the transition period between adjacent patches.

[0020] In some embodiments, the predetermined XY trajectory is one of a serpentine trajectory, a unidirectional strip trajectory, a space-filling curve trajectory, or a jump trajectory generated according to discrete tissue blocks.

[0021] In some embodiments, the predetermined XY trajectory may remain unchanged during focus selection, or it may be re-optimized based on focal plane slope and Z-axis dynamic capability after a new focus is added.

[0022] That is, this scheme records the position of each scan patch in the predetermined XY trajectory, the predetermined exposure start time, the exposure time, and the allowable Z-axis movement time interval between adjacent scan patches. For example, the predetermined XY trajectory can be represented as:

[0023]

[0024] in Let x be the center coordinates of the k-th scanned patch in the XY platform physical coordinate system. Let k be the scheduled start time of exposure for the k-th scanned patch during the scanning process. The duration of the exposure.

[0025] Furthermore, the action time interval between adjacent scan patches is expressed as:

[0026] Regarding step S2: This method obtains a small number of initial measured focal points in different tissue connectivity regions, different directions of the slide, or preset spatial coverage positions, and establishes the current focal plane model based on the initial measured focal points. The role of the initial measured focal points is to enable the focal plane model to generate the initial target focal length for the remaining scanning positions, rather than directly determining all subsequent focal points. Each measured focal point also obtains its focal reliability, which can be determined based on the focal score peak value, the difference between the peak and sub-peak values, the peak curvature, the repeated focus measurement deviation, image texture, and artifact detection results. Low-reliability focal points can have their model weight reduced or be remeasured.

[0027] In some embodiments, the Z-axis mechanism is controlled at several initial spatial locations on the slide (e.g., tissue edges or geometric centers) to search for the optimal focal length to obtain a set of measured focal points.

[0028] Furthermore, the measured focal length refers to the optimal focal length obtained by the scanning device at a specified XY position on the pathological slide through Z-axis search, single-frame defocus estimation, multi-frame focal length scoring, phase difference measurement, dual-angle illumination, or an independent focal length sensor. The i-th measured focal length is represented as:

[0029] in Let z be the physical coordinates of the glass slide. i To determine the optimal focal length, r i Reliability is measured at the focal point.

[0030] Furthermore, a current focal plane model is constructed based on the measured focal point set. The specific method for establishing the focal plane model can be selected from one or a combination of the following models according to the deformation characteristics of the glass slide surface: plane fitting model, polynomial surface model, thin plate spline (TPS) model or B spline model, Gaussian process regression (GPR) model and Kriging interpolation model, and physical deformation and data residual combination model.

[0031] Regarding step S3: The dynamic parameters of the Z-axis actuator obtained by this solution include at least the maximum speed, maximum acceleration, and control delay; preferably, they also include the maximum acceleration change rate, mechanical hysteresis, load-related response, difference between uplink and downlink response, and controller sampling period.

[0032] In some embodiments, the dynamic parameters of the Z-axis actuator are obtained through device calibration or online identification.

[0033] In some embodiments, dynamic parameters can be established separately for different focusing mechanisms such as objective lens assembly, slide platform or liquid lens, and different sets of dynamic parameters can be called for different magnifications, different loads and different temperature conditions.

[0034] This invention does not require candidate focal points to be generated based on tissue edges, colors, or local textures. Instead, it prioritizes generating candidate focal points at locations that are sensitive to subsequent scan control results. Therefore, in the step of "determining multiple candidate focal points on the remaining scan trajectory based on the current focal plane model, the predetermined XY scan trajectory, and the dynamic parameters of the Z-axis actuator", multiple candidate focal points are determined on the remaining scan trajectory based on scan control sensitivity by combining the current focal plane model, the predetermined XY scan trajectory, and the dynamic parameters.

[0035] Furthermore, the corresponding scan control sensitivity is calculated at the scan trajectory position on the remaining scan trajectory, and multiple candidate focal points are determined in the region where the scan control sensitivity is greater than a set threshold.

[0036] For the scan trajectory position q, the scan control sensitivity is:

[0037] Where θ represents the focal plane model parameters, and g(q) represents the Z-axis dynamic margin, depth-of-focus margin, or supplementary scan cost function. To control scanning sensitivity, This corresponds to the Z-axis position of the scan trajectory. Candidate focal points are preferentially generated in regions with larger J(q). In some embodiments, fixed meshes, Poisson disks, or tissue skeletons can be used as supplementary methods for generating candidate focal points.

[0038] In some embodiments, candidate focal points are determined based on at least one of the following conditions: a position where the depth-of-focus safety margin is less than a preset margin; a position where the Z-axis velocity or acceleration corresponding to the target Z-axis control sequence is close to the upper limit of the Z-axis actuator; the start, end, or reversal position of the scan strip; a position where there is a preset difference in the prediction results of different focal plane models for the target focal length; a position where multiple consecutive out-of-focus patches are expected to form; and a position where the Z-axis control sequence of the remaining scan trajectory has a preset control sensitivity.

[0039] Regarding step S4: For each candidate focal point, the predicted focal length and prediction uncertainty of each candidate focal point are obtained according to the current focal plane model, and one or more virtual focal lengths are generated based on the prediction uncertainty and the predicted focal length.

[0040] Furthermore, the predicted focal length and prediction uncertainty of the current focal plane model at the corresponding candidate focal point are obtained; when the prediction uncertainty is not greater than the preset uncertainty threshold, the predicted focal length is used as the only virtual focal length; when the prediction uncertainty is greater than the preset uncertainty threshold, the predicted focal length, the predicted focal length minus the prediction uncertainty, and the predicted focal length plus the prediction uncertainty are used as three different virtual focal lengths respectively.

[0041] In some embodiments, if the current focal plane model can output a prediction standard deviation, the prediction standard deviation is used as the prediction uncertainty; if the current focal plane model cannot output a prediction standard deviation, the focal plane fitting residual statistic of the measured focal plane adjacent to the current candidate focal plane is used as the prediction uncertainty.

[0042] The virtual focal length generated by the candidate focal point is represented as:

[0043] in Candidate Focus The corresponding number of virtual focal lengths, Let be the virtual focal length of the i-th candidate focal point.

[0044] When the prediction uncertainty is greater than the preset uncertainty threshold At that time, it was assumed that the focal length prediction of the candidate focal point was relatively stable, and only the predicted focal length was used as the virtual focal length, i.e.

[0045] When the prediction uncertainty is less than the preset uncertainty threshold At that time, the predicted focal length and its vertical deviation are used as three virtual focal lengths:

[0046]

[0047] At this point, the three virtual focal lengths are used to update the focal plane model and calculate the corresponding remaining scan trajectory, Z-axis dynamic reachable position, and first crossing risk. The final evaluation of the candidate focus can be based on the maximum risk among the three virtual results to avoid underestimating the risk of defocusing based solely on the average prediction result.

[0048] In some embodiments, the virtual focal length includes at least the current predicted focal length, and preferably also includes the upper and lower boundaries of the predicted focal length or multiple probability samples, in order to avoid evaluating candidate focal points based on a single predicted value. The role of the virtual focal length is to simulate the impact of candidate focal points on subsequent scans under different possible measurement results.

[0049] In some embodiments, the preset uncertainty threshold is determined based on the allowable depth of focus of the corresponding objective lens and the historical focusing error of the device.

[0050] Furthermore, the candidate focal points and their m-th virtual focal lengths are added to the current measured focal point set to construct virtual focal plane models corresponding to each candidate focal point. It should be noted that different candidate focal points are updated separately and are not mixed. When using planar, spline, or polynomial models, the model parameters can be refitted. When using Gaussian or Bayesian models, virtual posterior updates can be performed. When using neural models, the updated focal plane can be approximated through fast adaptation layers or pre-trained value networks.

[0051] Regarding step S5: For each virtual focal plane model, this scheme calculates the target Z-axis position of the remaining scan patches sequentially along a predetermined XY scan trajectory, forming a complete target Z-axis control sequence corresponding to candidate points and virtual results. This step evaluates the impact of candidate focal points on the overall remaining scan trajectory, rather than only evaluating the focal plane changes in the neighborhood of the candidate focal points.

[0052] In some embodiments, for each virtual focal plane model, the optimal focal length of the remaining scanned image is calculated along a predetermined XY scan trajectory, and the thickness of the cover glass and the refractive index structure compensation are superimposed to obtain the target Z-axis control sequence of the remaining scanned image.

[0053] For example, the target Z-axis control sequence is represented as:

[0054] in This is the compensation amount caused by coverslip refraction, objective lens switching, liquid lens calibration, or other imaging structures. For virtual focal plane model, Let be the coordinates of the k-th virtual focus.

[0055] In some embodiments, kinematic or servo response simulation is performed on the target Z-axis control sequence based on the timestamp of each scanned block, the time interval between adjacent positions, and dynamic parameters to obtain the actual reachable Z-axis trajectory. The actual reachable Z-axis trajectory is the Z-axis dynamic reachable trajectory, which refers to the actual Z-axis position that can be reached at the exposure time of each scanned block within a finite time between adjacent scanned blocks, after considering the speed limit, acceleration limit, control delay, and mechanical backlash of the actuator.

[0056] When the target command requires a speed or acceleration that exceeds the equipment's upper limit, the target trajectory is limited according to the equipment's control laws, and the following error caused by the limiting, delay, and mechanical hysteresis is calculated. Preferably, the dynamic simulation can also output the XY platform speed that needs to be reduced to ensure focal length following. This allows for the differentiation of two scenarios: one is that the focal plane model itself is predicting incorrectly; the other is that the focal plane model is predicting reasonably, but the Z-axis cannot be reached under the current scanning sequence.

[0057] Furthermore, the dynamic reachability calculation includes: correcting the target Z-axis position in the target Z-axis control sequence based on the control delay to obtain the delayed target position; determining whether the Z-axis motion direction between adjacent scanned blocks has changed direction; if a change occurs and the target displacement after the change is not greater than a preset mechanical backlash distance, then the delayed target position before the change is kept as the effective target position; if the target displacement after the change is greater than the preset mechanical backlash distance, then the preset mechanical backlash distance is subtracted from the target displacement to obtain the corrected effective target position; if no change occurs, then the delayed target position is used as the effective target position; inputting the effective target position into a kinematic limiting model based on the maximum velocity and maximum acceleration to calculate the Z-axis position that can actually be reached within the time interval between adjacent scanned blocks.

[0058] For example, for the k-th scan patch, according to the control delay Obtain the delayed target Z-axis position:

[0059] in For the first The exposure time of each scanned patch To control delay, The original target Z-axis position, To delay the target location.

[0060] Further, it determines whether a direction change has occurred based on the current Z-axis movement direction and the previous movement direction. If the movement direction has not changed, the delayed target position is directly used as the effective target position; if the movement direction has changed, the preset distance after the direction change is used. This is considered mechanical hysteresis or dead zone. When the target displacement after reversal is not greater than... At that time, it is assumed that this segment of motion is mainly used to eliminate mechanical backlash, and the effective Z-axis position remains in the position before the reversal; when the target displacement after the reversal is greater than At that time, the backlash distance is subtracted from the target displacement. It will exceed The portion of the displacement is taken as the effective motion displacement, and then the effective target position after control delay and commutation dead zone correction is obtained. Then, based on the maximum speed along the Z-axis... Maximum acceleration and the optional maximum rate of change of acceleration Calculate the time interval between adjacent scanned patches. The actual achievable position inside:

[0061] in, It represents the dynamic reachability function that calculates the effective target position after delay and hysteresis correction based on the dynamic capability of the Z-axis actuator. This represents the actual Z-axis position that the (k-1)th scanned patch can reach. For effective target location, The time interval between adjacent scanned patches. Maximum speed along the Z-axis For maximum acceleration, This represents the maximum rate of change of acceleration.

[0062] In some embodiments, the kinematic limiting model for dynamic reachability calculation can employ a velocity and acceleration limiting model, an S-curve model with acceleration constraints, a servo system state-space model, a device identification model, or a measured command-position lookup table. Regardless of the model used, at least control delay and the mechanical hysteresis or dead zone effects during Z-axis commutation must be considered. For devices with different response characteristics in upward and downward motion, different hysteresis parameters or dynamic parameter sets can be set separately. For example, the Z-axis initially moves in the positive direction, and then the target command changes to move in the negative direction. When the target displacement in the negative direction is less than the hysteresis distance... At this time, this segment of motion is mainly used to eliminate commutation backlash, and the actual position of the Z-axis remains approximately unchanged; when the target displacement in the negative direction exceeds At that time, only more than The portion is taken as the effective displacement. Simultaneously, the target command is executed according to the control delay. The kinematic limiting model is delayed to obtain the actual reachable Z-axis position of each patch at the exposure time.

[0063] Regarding step S6: In some embodiments, for candidate focus The The virtual focal length result is defined as the first The time-varying limit state of the focal depth for the remaining scan patches is:

[0064] in, As the candidate focus number, Candidate Focus The corresponding number This virtual focal length result Number the scan patches sequentially in the remaining scan trajectory. To determine the depth of focus of the objective lens corresponding to scan patch k, To add candidate focus The After the virtual focal length is determined, the virtual focal plane model predicts the first... The optimal focal length for each tile To account for tile exposure time, Z-axis velocity, acceleration, control delay, and hysteresis, the first... The actual Z-axis position that a tile can reach at the exposure time. For a joint vector of uncertain variables, This represents the time-varying limit state of the depth of focus.

[0065] Joint Uncertain Variable Vector Including at least one of the following: focal plane model residual, encoder measurement error, control delay variation, mechanical hysteresis variation, and Z-axis position error caused by temperature drift, expressed as:

[0066] in For the focal plane model residual, For encoder measurement error, To control the amount of delay change, This refers to the mechanical hysteresis or dead zone variation. The Z-axis position error caused by temperature drift, " indicates vector transpose.

[0067] That is, when calculating the risk of the first crossing, focal plane residual, encoder error, control delay, mechanical hysteresis and temperature drift are treated as joint uncertain variables.

[0068] It should be noted that when the time-varying depth of focus is greater than 0, it indicates that the first... The actual reachable Z-axis position of a scanned image block is still within the objective lens's depth-of-focus safety zone; when the depth-of-focus time-varying limit state is less than or equal to 0, it indicates that the scanned image block is expected to go beyond the depth-of-focus safety zone, and there is a risk of defocusing.

[0069] In some embodiments, the scan patch where the time-varying depth of focus limit state is less than or equal to 0 is taken as the position of the scan patch that first exceeds the depth of focus safety zone. For example, the candidate focus... In the Under this virtual focal length result, the position of the scanned patch that first crosses the depth-of-focus safety zone is represented as follows:

[0070] in: This is the set of remaining scanned images arranged in chronological order of the actual scan time. Indicates the earliest scanned tile number that satisfies the conditions within the parentheses; This indicates the initial predicted location of the out-of-focus tile. For the first The time-varying depth of focus limit state of the remaining scanned blocks.

[0071] In some embodiments, when no scan patch in the remaining scan trajectory extends beyond the depth-of-focus safety zone, it can be set as follows: .

[0072] In the step of "determining the first crossing risk of the remaining scan trajectory first exceeding the focal depth safety zone based on the time-varying focal depth limit state", the focal depth safety margin in the remaining scan trajectory is obtained according to the time-varying focal depth limit state, and the minimum value of the focal depth safety margin is taken as the first crossing risk; or, historical data synchronously recorded in the same scan or under the same equipment state are taken to form a joint sample, and the first crossing risk is estimated using the time-varying focal depth limit state of the joint sample; or, the shortest distance to the first defocus boundary is calculated based on the uncertain variables in the time-varying focal depth limit state as a reliability index, and the first crossing risk is obtained by processing the reliability index.

[0073] For example, candidate focus In the The risk of the first crossing under the virtual focal length result is in Indicates the probability of the event within the parentheses occurring; This represents the minimum depth-of-focus safety margin in the remaining scan trajectory. When this minimum depth-of-focus safety margin is not greater than zero, it means that at least one patch in the remaining scan trajectory has exceeded the depth-of-focus safety zone.

[0074] Furthermore, when multiple virtual focal length results are generated for a candidate focal point, the first crossing risk of the remaining scan trajectory first crossing the focal depth safety zone under each virtual focal length is calculated, and the first crossing risk of the remaining scan trajectory first crossing the focal depth safety zone is obtained by weighting the first crossing risk of different virtual focal length results.

[0075] When candidate focus Include When considering virtual focal length results, the overall first-crossing risk is expressed as:

[0076] in, Candidate Focus In the The first crossing risk under the virtual focal length result Candidate Focus The corresponding number of virtual focal length results; For the first The weights of the virtual focal length results satisfy the following:

[0077] In some embodiments, when the virtual focal length results have equal importance, it can be set that:

[0078] At this point, in the original expression This indicates that the average of all virtual focal length results is calculated.

[0079] In addition, historical data recorded synchronously in the same scan or under the same equipment condition are used to form a joint sample. The joint sample is used to estimate the risk of the first crossing, which can preserve the original correlation between different error variables and between adjacent tiles.

[0080] For example, historical data recorded synchronously during the same scan or under the same device condition can be grouped into a joint sample: in , This represents the number of historical joint samples. When estimating the first crossing risk using joint samples, it can be expressed as:

[0081] in: The first crossing risk is estimated based on historical joint samples; This is an indicator function; it takes the value 1 when the condition within the parentheses is true, and 0 otherwise. Each joint sample is calculated once along the complete remaining scan trajectory.

[0082] When the joint sample size is insufficient, and different variables can be determined to originate from independent measurements or physical processes, the corresponding variables can be approximated as independent. When there is a clear common source or synchronous change relationship between variables, their correlation can be described using a joint empirical distribution, correlation coefficient matrix, or Copula function. The Copula function is an optional implementation and does not constitute a necessary limitation of this invention.

[0083] In addition to calculating the risk of the first crossing, joint uncertainties can also be considered. Convert to standardized variables The shortest distance to the first defocus boundary is calculated as a reliable indicator, expressed as:

[0084] in These are the standardized variables obtained after transforming the joint uncertain variables; The standardized variable represents the Euclidean distance to the origin. Candidate Focus In the Reliability indicators under virtual focal length results; The larger the value, the farther away from the initial defocus boundary, and the safer the remaining scan. The corresponding risk of the first crossing can be approximated as:

[0085] in, The cumulative distribution function of the standard normal distribution. Indicates the first The approximate first-pass probability corresponding to the virtual focal length result.

[0086] Regarding step S7: The difference between the first-crossing risk (i.e., the probability that the remaining scan trajectory first crosses the depth-of-focus safety zone) for each candidate focus and the first-crossing risk for not including that candidate focus is calculated as the change, expressed as:

[0087] in For the first crossing risk of not being included in this candidate focus, The risk of the first crossing to join the j-th candidate focus.

[0088] In some embodiments, the sampling benefit value is obtained by combining the change amount and the hardware autofocus cost, and the candidate focus with the largest sampling benefit value or the candidate focus that can reduce the first pass risk below the target threshold or the risk of continuous out-of-focus segment the most is selected as the target candidate focus.

[0089] For example, the calculation of the sampling benefit value is expressed as follows:

[0090] in For the change, The cost of hardware autofocus includes the XY movement, Z-axis search, platform stabilization, exposure processing, and focus failure costs required for true autofocus. To prevent tiny constants with a denominator of zero.

[0091] In some embodiments, for key organizational areas, a weighted first-crossing risk may be used; for continuous blurred strip risk, a single boundary crossing event may be replaced by r consecutive tile out-of-focus events.

[0092] Furthermore, after acquiring the target candidate focus, this solution controls the XY motion platform and Z-axis actuator to move to the target candidate focus and perform real autofocus to obtain the true optimal focal length. The true optimal focal length is then added to the measured focus set to update the focal plane model. Additionally, based on the updated focal plane model, the initial crossing risk of the remaining scanning trajectory is re-determined. Based on the relationship between the updated risk and the preset risk threshold, or the marginal risk reduction corresponding to the candidate focus, it is determined whether to continue selecting the candidate focus to perform real autofocus.

[0093] That is, the target candidate focus that has passed the quality acceptance is added to the current measured focus set and the current focal plane model is updated; the encoder Z position at the autofocus position and the formal exposure time is read simultaneously, the focal plane residual and Z-axis following residual are updated, and the remaining best focal length sequence, dynamic reachable trajectory, time-varying limit state and first crossing risk are regenerated based on the updated model, and the remaining candidate focus is reordered online.

[0094] In some embodiments, acquisition of target candidate focal points is stopped when at least one of the following conditions is met: 1. The maximum reduction in first-crossing risk or increase in reliability index that the remaining candidate focal points can bring is lower than the marginal benefit threshold; 2. The first-crossing probability of the remaining scan trajectory is lower than the allowable threshold; 3. The risk of out-of-focus events in high-weight regions and their consecutive r-blocks is lower than the corresponding threshold; 4. After joint residual calibration, the depth-of-focus limit state of all key blocks has a specified safety margin; 5. The expected rescan amount, platform deceleration time, or Z-axis dynamic over-limit is lower than the allowable threshold; 6. The number of focal points acquired, the sampling time, or the scan preparation time reaches the preset budget.

[0095] Of course, after obtaining the target focus, this solution controls the XY motion platform to move to that position and performs true autofocus. If the focus measurement result has multiple peaks, low texture, bubbles, dust, or severe wrinkles, a re-search, neighbor replacement, or local multi-focal layer acquisition is performed, and the focus measurement reliability is included in subsequent risk calibration.

[0096] Furthermore, an executable scan control sequence is generated based on the final focal plane model, the predetermined XY trajectory, and the dynamic constraints of the Z-axis. If the local target Z-axis change still exceeds the actuator's capability, the XY speed can be locally reduced, the Z-axis command smoothed, or the scan direction adjusted without changing the focal point position. During the actual scan, the image sharpness, single-frame defocus estimation, exposure time Z-axis following error, and continuous defocus trend are monitored. When the actual first defocus position, continuous defocus length, or depth-of-focus safety margin differs from the pre-scan prediction, the residual distribution is updated using the actual focal point and encoder data, and candidate focal points are regenerated in the area with the greatest impact on the remaining first-pass risk. This forms a closed loop of "virtual update of candidate points—optimal focal length sequence—dynamically reachable trajectory—depth-of-focus limit state—first-pass risk—actual focusing—joint calibration—marginal termination—actual scan feedback."

[0097] Example 2 Taking an H&E pathological slide scanned with a 20x objective lens as an example, the device first acquires a low-magnification pre-scan image, identifies three discrete tissue blocks, and generates a high-magnification block time series according to a serpentine trajectory. The device is calibrated to obtain the maximum velocity, maximum acceleration, maximum acceleration rate of change, control delay, and hysteresis parameters of the Z-axis, and the allowable depth of focus is determined based on the objective lens numerical aperture and illumination wavelength.

[0098] The system acquires six initial measured focal points in three tissue connectivity domains and different directions of the slide to establish an initial focal plane model. Combining historical autofocus results and encoder trajector trajectory, the system performs grouped calibration on the focal plane prediction residual and Z-axis following residual. Based on the current focal plane and Z-axis dynamic model, the system calculates the baseline limit state and first crossing risk of the remaining plots.

[0099] The system generates candidate focal points at locations where the depth-of-focus safety margin is less than the preset margin, the Z-axis target speed is close to the upper limit of the Z-axis actuator, the focal length changes rapidly after the strip reversal, and multiple consecutive out-of-focus blocks may be formed. For each candidate point, the predicted mean, upper boundary, and lower boundary are used as virtual focal lengths, and the focal plane is updated one by one and the dynamic reachable position at the exposure time is recalculated.

[0100] Candidate focus A is located in an isolated tissue fragment, which can reduce the local model variance, but the position and probability of the remaining scan first crossing the depth of focus safety zone after its virtual update remain basically unchanged. Candidate point B is located in the height transition zone of adjacent scan strips, and its virtual update slows down the subsequent optimal focal length sequence, delays the first boundary crossing position, and significantly reduces the risk of three consecutive out-of-focus events.

[0101] The system prioritizes performing real autofocus on candidate focus point B. After the real focal length is added to the model, the recalculated first-pass risk is lower than the set threshold, and the maximum marginal risk reduction of the remaining candidate points is insufficient. Therefore, point acquisition is stopped and the formal scan is performed.

[0102] If the actual continuous out-of-focus segment is detected earlier than predicted during the formal scan, the system updates the focal plane residual and dynamic residual using the newly added real focal length and encoder position, and inserts a supplementary focus at a position that can minimize the risk of the remaining first pass, instead of directly rescanning the entire slice.

[0103] Example 3 like Figure 2 As shown in Example 1, this solution provides a pathological slide focus selection system based on focal plane counterfactual updating and Z-axis dynamic reachability, including: The scan trajectory generation module is used to acquire the tissue area to be scanned in the pathological slide and generate a predetermined XY scan trajectory and the corresponding patch time series. The focal plane model construction module is used to build the current focal plane model based on the obtained measured focal points; The candidate focus determination module is used to determine multiple candidate focuses on the remaining scan trajectory based on the current focal plane model, the predetermined XY scan trajectory, and the dynamic parameters of the Z-axis actuator. The virtual focal plane update module is used to generate at least one virtual focal length for each candidate focus, and to construct a virtual focal plane model corresponding to each candidate focus without performing real autofocus on the candidate focus. The dynamic reachability simulation module is used to generate target Z-axis control sequences based on each virtual focal plane model, and to perform dynamic reachability calculations based on the patch time series and dynamic parameters to obtain the actual reachable Z-axis position of each remaining scan patch at the exposure time. The risk assessment module is used to establish the time-varying depth-of-focus limit state based on the optimal focal length, actual achievable Z-axis position, and objective depth of focus for each remaining scan patch, and to determine the risk of the first crossing of the remaining scan trajectory; and The focus selection module is used to select the target candidate focus for actual autofocus based on the risk change of the first crossing risk corresponding to each candidate focus.

[0104] The content of this embodiment that is the same as that of embodiment one will not be described again.

[0105] Example 4 This embodiment also provides an electronic device, see reference. Figure 3 It includes a memory 402 and a processor 401, the memory 402 storing a computer program and the processor 401 being configured to run the computer program to perform the steps in any of the embodiments of the pathological slide focus selection method based on focal plane counterfactual update and Z-axis dynamic accessibility described above.

[0106] Specifically, the processor 401 may include a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this application.

[0107] The memory 402 may include a large-capacity memory 402 for data or instructions. The memory 402 can be used to store or cache various data files that need to be processed and / or communicated, as well as possible computer program instructions executed by the processor 401.

[0108] The processor 401 reads and executes computer program instructions stored in the memory 402 to implement any of the pathological slide focus selection methods based on focal plane counterfactual update and Z-axis dynamic reachability in the above embodiments.

[0109] Optionally, the electronic device may further include a transmission device 403 and an input / output device 404, wherein the transmission device 403 is connected to the processor 401 and the input / output device 404 is connected to the processor 401.

[0110] The transmission device 403 can be used to receive or send data via a network. Specific examples of the network described above may include wired or wireless networks provided by the communication provider of the electronic device. In one example, the transmission device includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 403 may be a Radio Frequency (RF) module used for wireless communication with the Internet.

[0111] The input / output device 404 is used to input or output information. In this embodiment, the input information may be the tissue region to be scanned, and the output information may be the target candidate focus, etc.

[0112] Optionally, in this embodiment, the processor 401 can be configured to perform the following steps via a computer program: S1: Obtain the tissue area to be scanned from the pathological section, and generate a predetermined XY scan trajectory and a tile time series corresponding to the predetermined XY scan trajectory. The tile time series includes at least the exposure time of each scan tile and the time interval between adjacent scan tiles that allows the Z-axis actuator to move. S2: Establish the current focal plane model based on the obtained measured focal points; S3: Based on the current focal plane model, the predetermined XY scanning trajectory, and the dynamic parameters of the Z-axis actuator, determine multiple candidate focal points on the remaining scanning trajectory; S4: Generate at least one virtual focal length for each candidate focus. Without performing real autofocus on the candidate focus, add the candidate focus and its corresponding virtual focal length to the current measured focus set to construct a virtual focal plane model corresponding to each candidate focus. S5: For each virtual focal plane model, generate the target Z-axis control sequence corresponding to the remaining scan patch along the predetermined XY scan trajectory, and perform dynamic reachability calculation on the target Z-axis control sequence based on the patch time series and dynamic parameters to obtain the actual reachable Z-axis position of each remaining scan patch at the corresponding exposure time. S6: Based on the optimal focal length, actual achievable Z-axis position, and focal depth of the corresponding objective lens determined by the virtual focal plane model corresponding to each remaining scan patch, establish the time-varying focal depth limit state of the remaining scan patch, and determine the first crossing risk of the remaining scan trajectory first crossing the focal depth safety zone based on the time-varying focal depth limit state. S7: Based on the change in the first crossing risk relative to the current risk for each candidate focus, select the target candidate focus from multiple candidate focuses to perform real autofocus.

[0113] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementations, and will not be repeated here.

[0114] Generally, various embodiments can be implemented in hardware or dedicated circuitry, software, logic, or any combination thereof. Some aspects of the invention can be implemented in hardware, while others can be implemented by firmware or software executed by a controller, microprocessor, or other computing device, but the invention is not limited thereto. Although various aspects of the invention may be shown and described as block diagrams, flowcharts, or using some other graphical representation, it should be understood that, by way of non-limiting example, these blocks, apparatuses, systems, techniques, or methods described herein can be implemented in hardware, software, firmware, dedicated circuitry or logic, general-purpose hardware or controllers or other computing devices, or some combination thereof.

[0115] Embodiments of the present invention can be implemented by computer software, which may be executable by a data processor of a mobile device, such as a processor entity, or by hardware, or by a combination of software and hardware. Computer software or programs (also referred to as program products), including software routines, applets, and / or macros, can be stored in any device-readable data storage medium, and they include program instructions for performing specific tasks. A computer program product may include one or more computer-executable components configured to perform embodiments when the program is run. One or more computer-executable components may be at least one piece of software code or a portion thereof. Additionally, it should be noted that any block in the logical flow of the figures may represent a program step, or interconnected logical circuitry, blocks and functions, or a combination of program steps and logical circuitry, blocks and functions. The software may be stored on physical media such as memory chips or blocks of storage implemented within a processor, magnetic media such as hard disks or floppy disks, and optical media such as, for example, DVDs and their data variants, CDs, etc. The physical medium is a non-transient medium.

[0116] Those skilled in the art should understand that the technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments have been described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0117] The above embodiments are merely illustrative of several implementation methods of this application, and their descriptions are relatively specific and detailed, but they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A pathological section focus selection method based on focal plane counterfactual update and Z-axis dynamic reachability, characterized in that, include: S1: Obtain the tissue region to be scanned from the pathological section, and generate a predetermined XY scan trajectory and a time series of the corresponding blocks; S2: Establish the current focal plane model based on the obtained measured focal points; S3: Based on the current focal plane model, the predetermined XY scanning trajectory, and the dynamic parameters of the Z-axis actuator, determine multiple candidate focal points on the remaining scanning trajectory; S4: Generate at least one virtual focal length for each candidate focus. Without performing real autofocus on the candidate focus, add the candidate focus and its corresponding virtual focal length to the current measured focus set to construct a virtual focal plane model corresponding to each candidate focus. S5: For each virtual focal plane model, generate the target Z-axis control sequence corresponding to the remaining scan patch along the predetermined XY scan trajectory, and perform dynamic reachability calculation on the target Z-axis control sequence based on the patch time series and dynamic parameters to obtain the actual reachable Z-axis position of each remaining scan patch at the corresponding exposure time. The dynamic reachability calculation includes: correcting the target Z-axis position in the target Z-axis control sequence based on the control delay to obtain the delayed target position; determining whether the Z-axis movement direction between adjacent scanned blocks has changed direction; if a change occurs and the target displacement after the change is not greater than a preset mechanical backlash distance, then the delayed target position before the change is kept as the effective target position; if the target displacement after the change is greater than the preset mechanical backlash distance, then the preset mechanical backlash distance is subtracted from the target displacement to obtain the corrected effective target position; if no change occurs, then the delayed target position is used as the effective target position; inputting the effective target position into a kinematic limiting model based on the maximum velocity and maximum acceleration to calculate the Z-axis position that can actually be reached within the time interval between adjacent scanned blocks; S6: Based on the optimal focal length, actual achievable Z-axis position, and focal depth of the corresponding objective lens determined by the virtual focal plane model corresponding to each remaining scan patch, establish the time-varying focal depth limit state of the remaining scan patch, and determine the first crossing risk of the remaining scan trajectory first crossing the focal depth safety zone based on the time-varying focal depth limit state. The calculation relationship for the time-varying depth of focus limit state is expressed as follows: in, As the candidate focus number, Candidate Focus The corresponding number This virtual focal length result Number the scan patches sequentially in the remaining scan trajectory. To determine the depth of focus of the objective lens corresponding to scan patch k, To add candidate focus The After obtaining the virtual focal length, the virtual focal plane model predicts the first... The optimal focal length for each tile To account for tile exposure time, Z-axis velocity, acceleration, control delay, and hysteresis, the first... The actual Z-axis position that a tile can reach at the exposure time. For a joint vector of uncertain variables, This represents the time-varying limit state of the depth of focus; S7: Based on the change in the first crossing risk relative to the current risk for each candidate focus, select the target candidate focus from multiple candidate focuses to perform real autofocus.

2. The method for selecting the focal point of a pathological section according to claim 1, characterized in that, include: Control the XY motion platform and Z-axis actuator to move to the target candidate focus and perform real autofocus to obtain the real best focal length. Then add the real best focal length to the measured focus set to update the focal plane model. as well as The initial crossing risk of the remaining scan trajectory is re-determined based on the updated focal plane model, and the decision on whether to continue selecting candidate focal points for true autofocus is made based on the relationship between the updated risk and the preset risk threshold, or the marginal risk reduction corresponding to the candidate focal point.

3. The method for selecting the focal point of a pathological section according to claim 1, characterized in that, Obtain the predicted focal length and prediction uncertainty of the current focal plane model at the corresponding candidate focal point; when the prediction uncertainty is not greater than the preset uncertainty threshold, the predicted focal length is used as the only virtual focal length; when the prediction uncertainty is greater than the preset uncertainty threshold, the predicted focal length, the predicted focal length minus the prediction uncertainty, and the predicted focal length plus the prediction uncertainty are used as three different virtual focal lengths respectively.

4. The method for selecting the focal spot of a pathological section according to claim 1, characterized in that, When multiple virtual focal length results are generated for a candidate focal point, the first crossing risk of the remaining scan trajectory first crossing the focal depth safety zone is calculated for each virtual focal length. The first crossing risk of the remaining scan trajectory first crossing the focal depth safety zone is obtained by weighting the first crossing risks of different virtual focal length results.

5. The method for selecting the focal point of a pathological section according to claim 1, characterized in that, The following methods can be used to determine the first crossing risk: 1) Obtain the focal depth safety margin in the remaining scan trajectory based on the time-varying focal depth limit state; 2) Take the minimum value of the focal depth safety margin as the first crossing risk; 3) Take historical data recorded synchronously in the same scan or under the same equipment state to form a joint sample, and use the time-varying focal depth limit state of the joint sample to estimate the first crossing risk; 4) Calculate the shortest distance to the first defocus boundary based on the uncertain variables in the time-varying focal depth limit state as a reliability index, and process the reliability index to obtain the first crossing risk.

6. The method for selecting the focal point of a pathological section according to claim 1, characterized in that, Candidate focal points are determined based on at least one of the following conditions: the position where the depth of focus safety margin is less than the preset margin; the position where the Z-axis velocity or acceleration corresponding to the target Z-axis control sequence is close to the upper limit of the Z-axis actuator; the start, end, or reversal position of the scan strip; Locations where different focal plane models predict different target focal lengths; locations where multiple consecutive out-of-focus patches are expected to form; and locations where the Z-axis control sequence of the remaining scan trajectory has a preset control sensitivity.

7. A pathological slide focus selection system based on focal plane counterfactual updating and Z-axis dynamic reachability, characterized in that, include: The scan trajectory generation module is used to acquire the tissue area to be scanned in the pathological slide and generate a predetermined XY scan trajectory and the corresponding patch time series. The focal plane model construction module is used to build the current focal plane model based on the obtained measured focal points; The candidate focus determination module is used to determine multiple candidate focuses on the remaining scan trajectory based on the current focal plane model, the predetermined XY scan trajectory, and the dynamic parameters of the Z-axis actuator. The virtual focal plane update module is used to generate at least one virtual focal length for each candidate focus, and to construct a virtual focal plane model corresponding to each candidate focus without performing real autofocus on the candidate focus. The dynamic reachability simulation module is used to generate target Z-axis control sequences based on each virtual focal plane model, and to perform dynamic reachability calculations based on the patch time series and dynamic parameters to obtain the actual reachable Z-axis position of each remaining scan patch at the exposure time. The dynamic reachability calculation includes: correcting the target Z-axis position in the target Z-axis control sequence based on the control delay to obtain the delayed target position; determining whether the Z-axis movement direction between adjacent scanned blocks has changed direction; if a change occurs and the target displacement after the change is not greater than a preset mechanical backlash distance, then the delayed target position before the change is kept as the effective target position; if the target displacement after the change is greater than the preset mechanical backlash distance, then the preset mechanical backlash distance is subtracted from the target displacement to obtain the corrected effective target position; if no change occurs, then the delayed target position is used as the effective target position; inputting the effective target position into a kinematic limiting model based on the maximum velocity and maximum acceleration to calculate the Z-axis position that can actually be reached within the time interval between adjacent scanned blocks; The risk assessment module is used to establish the time-varying depth-of-focus limit state based on the optimal focal length, actual achievable Z-axis position, and objective depth of focus for each remaining scan patch, and to determine the risk of the first crossing of the remaining scan trajectory. The calculation relationship of the time-varying depth-of-focus limit state is expressed as follows: in, As the candidate focus number, Candidate Focus The corresponding number This virtual focal length result Number the scan patches sequentially in the remaining scan trajectory. To determine the depth of focus of the objective lens corresponding to scan patch k, To add candidate focus The After obtaining the virtual focal length, the virtual focal plane model predicts the first... The optimal focal length for each tile To account for tile exposure time, Z-axis velocity, acceleration, control delay, and hysteresis, the first... The actual Z-axis position that a tile can reach at the exposure time. For a joint vector of uncertain variables, This represents the time-varying limit state of the depth of focus; The focus selection module is used to select the target candidate focus to be performed for real autofocus based on the risk change of the first crossing risk corresponding to each candidate focus.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the pathological slide focus selection method based on focal plane counterfactual update and Z-axis dynamic reachability as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • 3D imaging and fusion method based on pathological slice scanning device

    CN105118088A

  • Pathological section scanning method and device based on local allowable scanning speed constraint

    CN122069324A