A pathological section data output method, device and equipment
Patent Information
- Application Number
- CN202611212462.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-11
- Publication Date
- 2026-10-30
AI Technical Summary
现有技术中,用户通常需凭借病理号分别登录病理信息系统、数字切片管理系统、实验室信息系统等多个平台,手动检索并下载全玻片图像、诊断报告、切片缩略图等各类文件,再依据个人经验将这些零散资料组织成文件夹结构进行打包;部分机构则采用简单脚本按病理号进行扁平化数据拉取,后续仍需大量人工分类整理
[0049]从上述的技术方案可以看出,本申请实施例提供的一种病理切片资料输出方法、装置和设备,首先根据用户身份信息和/或取片授权码从各病理信息系统查询获得病理资料集合,建立以病理号为一级节点、蜡块号为二级节点、切片号为三级节点并挂载染色类型、采样部位、全玻片数字图像文件标识等属性数据的多层级索引树,对同病理号下的多个蜡块及同蜡块号下的多个切片建立父子引用指针,随后遍历索引树执行逐层一致性校验,校验全部通过后生成待输出资料集合并输出。
Smart Images

Figure CN123017535A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data analysis technology, and more specifically, to a method, apparatus, and device for outputting pathological slide data. Background Technology
[0002] In pathological diagnosis, scientific research, teaching, and remote consultations, it is often necessary to output complete pathological slide data from patients. Currently, users typically need to log into multiple platforms, such as pathology information systems, digital slide management systems, and laboratory information systems, using the pathology number. They manually retrieve and download various files, including whole-slide images, diagnostic reports, and slide thumbnails, and then organize these scattered data into folders based on personal experience. Some institutions use simple scripts to perform flattened data retrieval by pathology number, but this still requires significant manual sorting and organization. This approach has significant drawbacks: firstly, operating across multiple systems and manually switching logins is extremely time-consuming, resulting in low output efficiency; secondly, the inherent hierarchical relationship between pathology number, paraffin block number, and slide number is easily lost during flattened retrieval or arbitrary folder creation, leading to misattributions between slide images and corresponding diagnostic reports and consultation records. Data integrity relies entirely on manual visual verification, lacking systematic automated verification methods, resulting in frequent file omissions and mismatches. Furthermore, it is difficult to automate filtering based on user identity or authorized scope, compromising both security and accuracy.
[0003] Therefore, there is an urgent need for a new method for outputting pathological slide data to overcome the shortcomings of existing technologies and achieve efficient integration of multi-source pathological data and accurate solidification of hierarchical classification. Summary of the Invention
[0004] This application provides a method, apparatus, and equipment for outputting pathological slide data, enabling efficient integration of multi-source pathological data and precise solidification of hierarchical classification.
[0005] A method for outputting pathological slide data includes:
[0006] Based on the user's identity information and / or slide retrieval authorization code, the pathological data set is queried from each pathology information system. The pathological data set includes the pathology number, as well as the paraffin block number, slide number, staining type, sampling site, whole slide digital image file identifier, slide thumbnail file identifier, diagnostic report identifier, and consultation data identifier that are hierarchically associated with the pathology number.
[0007] A multi-level index tree data structure is established for the pathological data set, wherein the pathology number is used as the first-level node, the paraffin block number is used as the second-level node, and the slide number is used as the third-level node. Under each slide number node, attribute data including staining type, sampling site, whole slide digital image file identifier, slide thumbnail file identifier, diagnostic report identifier, and consultation data identifier are attached. For multiple paraffin blocks under the same pathology number and multiple slides under the same paraffin block number, parent-child reference pointers between nodes are established in the multi-level index tree data structure.
[0008] Before generating output tasks based on the output items selected by the user, the multi-level index tree data structure is traversed to perform a layer-by-layer consistency check on the pathological data set.
[0009] When all the layer-by-layer consistency checks pass, a set of data to be output is generated and the output operation is performed.
[0010] Optionally, the parent-child reference pointer includes a pointer from the parent node to the child node and a pointer from the child node to the parent node;
[0011] The traversal of the multi-level index tree data structure and the performance of layer-by-layer consistency checks on the pathological data set include:
[0012] The depth-first traversal algorithm is used to access each level of the multi-level index tree data structure sequentially.
[0013] During the access process, it is verified whether the pointers of the child nodes to the parent nodes of the current node point to the correct parent node. If the pointers of the child nodes to the parent nodes are null or do not point to the correct parent node, it is determined that a node level disconnection anomaly has occurred, the abnormal node path information is recorded, and subsequent verification is terminated.
[0014] Optionally, when accessing the slice number node, the layer-by-layer consistency check further includes:
[0015] Read the coloring type and sampling location from the attribute data attached to the slice number node;
[0016] Based on the diagnostic report file pointed to by the diagnostic report identifier, parse the slice number and its corresponding staining type and sampling site recorded in the diagnostic report file, find the slice number record corresponding to the current slice number node, and obtain the corresponding staining type and sampling site;
[0017] The read staining type and sampling site are matched with the corresponding staining type and sampling site obtained from the diagnostic report file. If the match fails, an attribute inconsistency exception is recorded and the output corresponding to the slice number node is blocked.
[0018] Optionally, the attribute data may further include a first hash value corresponding to the digital image file identifier of the whole slide and a second hash value corresponding to the slice thumbnail file identifier;
[0019] When accessing the slice number node, the layer-by-layer consistency check also includes:
[0020] Based on the storage paths indicated by the full-slide digital image file identifier and the slice thumbnail file identifier mounted on the slice number node, retrieve the corresponding full-slide digital image physical file and slice thumbnail physical file;
[0021] If the retrieved physical file does not exist, a file missing exception is recorded.
[0022] If the retrieved physical file exists, calculate the hash value of each retrieved physical file, and compare the calculated hash value with the corresponding first hash value and second hash value in the attribute data. If the comparison is inconsistent, record the file integrity as abnormal.
[0023] Optionally, in the multi-level index tree data structure, each slice number node also has one or more layer number child nodes attached, forming a fourth-level node with the slice number node as the parent node and the layer number child nodes. Each layer number child node has the corresponding staining type, the digital image file identifier of the whole slide, and the pre-stored hash value of the digital image file of the whole slide attached.
[0024] The layer-by-layer consistency check also includes:
[0025] Traverse the child nodes of the layer number and verify whether the reference pointer of the child node of the layer number to the parent node of the slice number is complete;
[0026] The physical file is retrieved based on the digital image file identifier of the whole glass slide mounted on the layer number sub-node. The existence of the retrieved physical file is verified, and the hash value of the retrieved physical file is calculated. The calculated hash value is then compared with the pre-stored hash value mounted on the layer number sub-node.
[0027] Optionally, when the user selects an output item that includes generating a slice index page, generating the set of data to be output and performing the output operation includes:
[0028] Extract all node data that pass the layer-by-layer consistency check from the multi-level index tree data structure;
[0029] For the thumbnail image pointed to by the slice thumbnail file identifier, the resolution is adapted and scaled according to the thumbnail display area size of the preset template;
[0030] Using a layout algorithm, based on the number of slices under the same wax block number node, the layout coordinates of each slice thumbnail and the text label associated with the slice thumbnail in the page are calculated. The text label includes the slice number, coloring type, and sampling location.
[0031] When the number of slices under the same wax block number exceeds the single page capacity threshold, a pagination mark is inserted within the grouping area of the same wax block number;
[0032] The calculated page description data is sent to the print output module for rasterization.
[0033] Optionally, the process of calculating the layout coordinates also includes:
[0034] Group all slice thumbnails belonging to the same wax block number secondary node into one rendering group;
[0035] When rendering the rendering group, the graphics drawing interface is called to draw closed border lines at the group boundary, and the wax block number is rendered as the group title text at a preset position on the border line to form a visual block grouped by wax block on the printed slice index page.
[0036] Optionally, when the user-selected output item includes writing digital pathology slide files to an external storage medium, the step of generating the set of data to be output and performing the output operation includes:
[0037] Call the operating system interface to obtain the remaining storage space parameters of the external storage medium, and compare the remaining storage space parameters with the total size of the file to be written;
[0038] With sufficient remaining storage space, based on the pathology number, paraffin block number, and slide number node names in the multi-level index tree data structure, a corresponding hierarchical directory structure is created level by level on the external storage medium.
[0039] Multiple parallel writing threads are started to write the full slide digital image file, diagnostic report file and slice thumbnail file to the corresponding directories respectively, and each writing thread reports the writing byte progress to the main thread during the writing process.
[0040] After all write threads have finished, the written files are reread item by item and the write file checksum is calculated. The write file checksum is compared with the source file checksum stored in memory corresponding to the written file. If any of the comparisons are inconsistent, the separate write thread corresponding to the inconsistent file is rescheduled until the rewritten file checksum matches the source file checksum or the preset number of retries is reached.
[0041] A pathological slide data output device, comprising:
[0042] The data query module is used to query the pathological data set from various pathological information systems based on the user's identity information and / or slide retrieval authorization code. The pathological data set includes the pathology number, as well as the paraffin block number, slide number, staining type, sampling site, whole slide digital image file identifier, slide thumbnail file identifier, diagnostic report identifier, and consultation data identifier that are hierarchically associated with the pathology number.
[0043] The index building module is used to build a multi-level index tree data structure for the pathological data set. The pathology number is used as the first-level node, the paraffin block number as the second-level node, and the slide number as the third-level node. Each slide number node is equipped with attribute data including staining type, sampling site, whole slide digital image file identifier, slide thumbnail file identifier, diagnostic report identifier, and consultation data identifier. For multiple paraffin blocks under the same pathology number and multiple slides under the same paraffin block number, parent-child reference pointers between nodes are established in the multi-level index tree data structure.
[0044] The layer-by-layer verification module is used to traverse the multi-level index tree data structure and perform layer-by-layer consistency verification on the pathological data set before generating the output task according to the output items selected by the user.
[0045] The data output module is used to generate a set of data to be output and perform the output operation when all the layer-by-layer consistency checks pass.
[0046] A pathological slide data output device, including a memory and a processor;
[0047] The memory is used to store programs;
[0048] The processor is configured to execute the program to implement the various steps of the pathological slide data output method as described in any of the preceding claims.
[0049] As can be seen from the above technical solutions, the pathological slide data output method, apparatus, and device provided in this application first obtain a set of pathological data from various pathological information systems based on user identity information and / or slide retrieval authorization code. Then, a multi-level index tree is established with pathology number as the first-level node, paraffin block number as the second-level node, and slide number as the third-level node, and attribute data such as staining type, sampling site, and whole slide digital image file identifier are attached. Parent-child reference pointers are established for multiple paraffin blocks under the same pathology number and multiple slides under the same paraffin block number. Then, the index tree is traversed to perform layer-by-layer consistency verification. After all verifications pass, the data set to be output is generated and output.
[0050] This application utilizes a joint query mechanism based on user identity and slide retrieval authorization code to match a complete set of pathological data from the pathology information system. This achieves precise aggregation of multi-source data according to permissions, eliminating the need for manual cross-system searches. By constructing a multi-level index tree and explicitly establishing parent-child reference pointers between paraffin blocks and slide nodes, the natural hierarchical relationship of pathological data is transformed into a structured data association. This ensures that the attributes of each slide, such as images, reports, and consultation data, are uniquely attached to the correct node, achieving precise positioning of the output data's attribution and avoiding hierarchical errors. Furthermore, before output, the index tree is traversed to perform layer-by-layer consistency checks. Each node is checked to verify the existence and accessibility of the actual files, such as the full-slide digital images, thumbnails, diagnostic reports, and consultation data pointed to by each file identifier. This proactively intercepts any data readiness issues or missing associations at the output source, ensuring that only data that has passed all checks is included in the output set, thereby achieving the completeness and reliability of the output content. Ultimately, the verified set of data to be output can be naturally mapped into a hierarchical output directory using the index tree structure, which can be directly used for archiving or sharing. The entire process organically integrates query aggregation, hierarchical indexing, integrity verification and output execution, significantly improving the accuracy and efficiency of pathological slide data output. Attached Figure Description
[0051] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0052] Figure 1 This is a flowchart of a method for outputting pathological slide data disclosed in an embodiment of this application;
[0053] Figure 2 This is a schematic diagram of a pathological slide data output device disclosed in an embodiment of this application;
[0054] Figure 3 This is a hardware structure block diagram of a pathological slide data output device disclosed in an embodiment of this application. Detailed Implementation
[0055] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0056] This application can be used in a wide variety of general-purpose or special-purpose computing device environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor devices, distributed computing environments including any of the above devices, etc.
[0057] The following section introduces the solution proposed in this application. The technical solution is as follows, please refer to the text below for details.
[0058] Figure 1 This is a flowchart of a method for outputting pathological slide data disclosed in an embodiment of this application.
[0059] like Figure 1 As shown, the method may include:
[0060] Step S1: Based on the user's identity information and / or slide retrieval authorization code, query the pathology data set from each pathology information system. The pathology data set includes the pathology number, as well as the paraffin block number, slide number, staining type, sampling site, whole slide digital image file identifier, slide thumbnail file identifier, diagnostic report identifier, and consultation data identifier that are hierarchically associated with the pathology number.
[0061] Specifically, the system receives slide retrieval requests submitted by users through an interactive interface. These requests carry user identification information, a slide retrieval authorization code generated based on specific business rules, or both. The system first verifies the legitimacy of the identification credentials and authorization code, and dynamically determines the data range for the query based on the verified credentials. Subsequently, the system initiates parallel queries to multiple pathology information systems from different vendors and with different architectures within the hospital via a pre-built unified data access layer. These pathology information systems may respectively carry pathology data from different stages, such as tissue processing records, slide preparation information, image archiving, and diagnostic documents. During the query process, through adapters customized for each system, heterogeneous data records are integrated into a structurally unified set of pathology data. Each core record in this set contains at least one pathology number used as a primary index, and, based on the inherent hierarchical relationship of the pathology workflow, it is associated with several paraffin block numbers, and further, slide numbers belonging to the paraffin block numbers. The collection also aggregates and links attribute information fields closely related to each slide, specifically covering: the staining type identifying the slide preparation method used, the sampling site describing the tissue source, the digital image file identifier of the whole slide pointing to a high-resolution full-field digital slide, the slide thumbnail file identifier for quick preview, the diagnostic report identifier for associating with structured or unstructured diagnostic text, and the consultation data identifier for tracing multidisciplinary consultation records. These scattered data are converged into a logically complete set of pathological data through semantic mapping and association rules, providing a clean data source for index construction.
[0062] Step S2: Establish a multi-level index tree data structure for the pathological data set, wherein the pathology number is used as the first-level node, the paraffin block number is used as the second-level node, and the slide number is used as the third-level node. Under each slide number node, attribute data including staining type, sampling site, whole slide digital image file identifier, slide thumbnail file identifier, diagnostic report identifier, and consultation data identifier are attached. For multiple paraffin blocks under the same pathology number and multiple slides under the same paraffin block number, parent-child reference pointers between nodes are established in the multi-level index tree data structure.
[0063] Specifically, the system constructs a multi-level index tree data structure in memory for the pathology data set obtained in step S1 to accurately reflect the inherent tissue hierarchy of the pathology data. The construction process uses the pathology number as the anchor point; each unique pathology number is instantiated as a first-level node in the tree, serving as the root for accessing all information for the corresponding case. Under the first-level node, the system traverses all paraffin block numbers associated with that pathology number, generating a second-level node, the paraffin block node, for each paraffin block number. Further, the system continues to delve deeper, generating third-level nodes, or slide nodes, for all slide numbers belonging to each paraffin block number. Within each slide node, the system mounts an attribute data set, which, in the form of key-value pairs or field objects, contains complete attributes such as staining type, sampling site, whole-slide digital image file identifier, slide thumbnail file identifier, diagnostic report identifier, and consultation data identifier. To ensure the navigability of the entire tree, for all paraffin block nodes under the same pathology number, the system maintains an ordered set of child node references within that pathology number node, and sets a reference pointer in each paraffin block node that points back to its parent pathology number node. Similarly, for all slice nodes under the same paraffin block number, a set of child node references is also maintained within the paraffin block node, and a reference pointer in each slice node points to its parent paraffin block node. Through this bidirectional parent-child reference pointer distributed across all nodes, the multi-level index tree data structure forms a complete relational network that can penetrate downwards from any pathology number to any slice attribute, and can also trace back upwards from any slice node to the case root node, providing an efficient data skeleton for subsequent consistency review and data extraction.
[0064] Step S3: Before generating the output task based on the output items selected by the user, traverse the multi-level index tree data structure and perform a layer-by-layer consistency check on the pathological data set.
[0065] Specifically, before generating specific output tasks based on the user's subsequently selected output items, the system initiates an independent layer-by-layer consistency verification process to comprehensively check the multi-level index tree data structure constructed in step S2 and its mapped set of pathology data. The verification engine starts from all first-level nodes of the tree and performs a depth-first or breadth-first traversal. The first-level verification focuses on the pathology number node itself, checking whether it is within the valid range allowed by the current user's permissions or slide retrieval authorization code, and whether its format conforms to the established coding specifications of the medical record system. The second-level verification operates on each wax block node. The system verifies whether the hierarchical relationship between the wax block number and the parent pathology number is consistent with the actual association recorded in the source system, and checks whether there are indeed usable slide nodes under the wax block node to avoid empty wax block levels without actual content. The third-level verification delves into each slide node, performing a fine-grained existence and logical review of its attached attribute data. This includes verifying whether the staining type field is empty and whether its value is within the controlled vocabulary; verifying whether there is a logical conflict between the sampling site and the anatomical site recorded in the patient's basic information corresponding to the pathology number; detecting whether there is a corresponding digital file entity response at the physical storage location pointed to by the digital image file identifier of the whole slide and the slide thumbnail file identifier; and calling a lightweight interface to quickly query whether the document objects referenced by the diagnostic report identifier and the consultation data identifier actually exist and have not been deleted. Simultaneously, the verification engine also cross-validates the reference loops within the tree structure, that is, confirming the bidirectional consistency of parent and child pointers node by node to prevent dangling nodes or broken hierarchical chains. This traversal verification process collects all found inconsistencies and potential risk points and forms a structured verification report. Only when every level, every node, and all its attributes of the entire tree structure meet the preset completeness, consistency, and reachability criteria will the layer-by-layer consistency verification be considered complete.
[0066] Step S4: When all the layer-by-layer consistency checks pass, generate the set of data to be output and perform the output operation.
[0067] Specifically, once the layer-by-layer consistency verification result in step S3 is marked as passed, the system dynamically generates a set of data to be output based on the output items previously or currently selected by the user, and drives the execution of specific output operations. The system parses the user's output intent; for example, the user may specify to output multiple digital images of whole slides with a specific staining type under a certain pathology number and their corresponding diagnostic reports, or request to output thumbnails of all slides associated with the entire paraffin block and consultation data. Based on this, the system performs projection and pruning in the multi-level index tree that has passed the verification, accurately extracts the matching slide nodes and their attribute data, and aggregates these selected file identifiers and metadata into a list to be output. Subsequently, the system calls the data aggregation and file collection service, and according to the file identifiers recorded in the list, temporarily aggregates the corresponding entity files from object storage, image archiving servers, or document management libraries into an isolated temporary storage work area. Before output, post-processing operations such as lossless compression, format transcoding, digital watermarking, and patient privacy information anonymization may also be performed on the files in the work area. The final output operation takes various forms depending on the scenario. For example, the entire workspace may be packaged into an encrypted compressed file and provided to the user for download; it may be streamed in real time to a remote digital pathology consultation system via a secure transmission protocol; or it may be directly scheduled for physical output using medical-grade image recording or printing equipment. After output is completed, the system automatically cleans up temporary resources and records a complete operation log. If the verification phase fails completely, this step will not be triggered, and the system will directly interrupt the process and return hierarchical and readable verification error details to the user interface, guiding the operator to make targeted corrections. This ensures that every output of pathology data is based on a complete, consistent, and reliable data foundation.
[0068] As can be seen from the above technical solutions, the pathological slide data output method, apparatus, and device provided in this application first obtain a set of pathological data from various pathological information systems based on user identity information and / or slide retrieval authorization code. Then, a multi-level index tree is established with pathology number as the first-level node, paraffin block number as the second-level node, and slide number as the third-level node, and attribute data such as staining type, sampling site, and whole slide digital image file identifier are attached. Parent-child reference pointers are established for multiple paraffin blocks under the same pathology number and multiple slides under the same paraffin block number. Then, the index tree is traversed to perform layer-by-layer consistency verification. After all verifications pass, the data set to be output is generated and output.
[0069] This application utilizes a joint query mechanism based on user identity and slide retrieval authorization code to match a complete set of pathological data from the pathology information system. This achieves precise aggregation of multi-source data according to permissions, eliminating the need for manual cross-system searches. By constructing a multi-level index tree and explicitly establishing parent-child reference pointers between paraffin blocks and slide nodes, the natural hierarchical relationship of pathological data is transformed into a structured data association. This ensures that the attributes of each slide, such as images, reports, and consultation data, are uniquely attached to the correct node, achieving precise positioning of the output data's attribution and avoiding hierarchical errors. Furthermore, before output, the index tree is traversed to perform layer-by-layer consistency checks. Each node is checked to verify the existence and accessibility of the actual files, such as the full-slide digital images, thumbnails, diagnostic reports, and consultation data pointed to by each file identifier. This proactively intercepts any data readiness issues or missing associations at the output source, ensuring that only data that has passed all checks is included in the output set, thereby achieving the completeness and reliability of the output content. Ultimately, the verified set of data to be output can be naturally mapped into a hierarchical output directory using the index tree structure, which can be directly used for archiving or sharing. The entire process organically integrates query aggregation, hierarchical indexing, integrity verification and output execution, significantly improving the accuracy and efficiency of pathological slide data output.
[0070] In some embodiments of this application, the parent-child reference pointer includes a pointer from the parent node to the child node and a pointer from the child node to the parent node;
[0071] The traversal of the multi-level index tree data structure and the performance of layer-by-layer consistency checks on the pathological data set include:
[0072] The depth-first traversal algorithm is used to access each level of the multi-level index tree data structure sequentially.
[0073] During the access process, it is verified whether the pointers of the child nodes to the parent nodes of the current node point to the correct parent node. If the pointers of the child nodes to the parent nodes are null or do not point to the correct parent node, it is determined that a node level disconnection anomaly has occurred, the abnormal node path information is recorded, and subsequent verification is terminated.
[0074] Specifically, the parent-child reference pointers constructed within the multi-level index tree data structure are configured as a bidirectional reference system, meaning that each pointer simultaneously contains a pointer from the parent node to a child node and a pointer from the child node to the parent node. In the physical structure of the tree, each parent node stores a list of references or pointer fields pointing to its direct child nodes, clearly defining all reachable child nodes. Simultaneously, each child node also maintains a unique pointer that identifies and points to the direct parent node that generated the child node. Thus, starting from any node in the tree, one can traverse downwards along the child node pointers to the leaf nodes, or back up along the parent node pointers to the root node, forming an unambiguous hierarchical navigation path.
[0075] Based on the aforementioned bidirectional pointer structure, when traversing the multi-level index tree data structure to perform the layer-by-layer consistency check, the system employs a depth-first traversal algorithm as the main path for node access. The verification engine starts from the root node, i.e., the pathology number node, and follows the depth-first strategy, delving deeper layer by layer along the pointers from parent nodes to child nodes, sequentially visiting each wax block node and slide node until it reaches the deepest slide node of a certain branch. Then, it backtracks to the nearest parent node that still has unvisited child nodes and continues to explore along another branch, ensuring that all nodes in the tree are visited sequentially and without omission.
[0076] During each node access operation in the verification traversal process, the system performs a core parent-child relationship integrity check. Specifically, when the verification engine reaches the current node via the child node pointer of the parent node, it immediately reads the pointers from the child nodes to the parent nodes stored in the current node and checks whether these pointers actually point to the identified parent node in this traversal path. The comparison benchmark for the check is the unique identifier of the parent node and the parent-child relationship context. If the pointer from the child node to the parent node is null, it indicates that the hierarchical tracing chain between this node and its parent node has been broken, and its source legitimacy cannot be confirmed. If the pointer is not null but the node identifier it points to is inconsistent with the identifier of the currently accessed parent node, it indicates that there are incorrect links or confusion in the tree structure. When either of the above situations occurs, the system determines that a node hierarchy breakage anomaly has occurred. Once the anomaly is caught, the verification process will no longer delve deeper into the current branch or explore other branches in the tree. Instead, it will immediately record the complete node path information, including information from the root node, through intermediate nodes at all levels, to the current node where the anomaly occurred. This will generate an anomaly record describing the anomaly level and type, and terminate all subsequent consistency verification operations. This error-on-error strategy can expose structural defects in the index tree at the first moment, preventing attribute verification or output tasks from continuing on incomplete hierarchical relationships. This provides a precise anomaly scenario for problem localization and data repair, ensuring the rigor of data quality review before outputting pathological data.
[0077] Furthermore, when accessing the slice number node, the layer-by-layer consistency check also includes:
[0078] Read the coloring type and sampling location from the attribute data attached to the slice number node;
[0079] Based on the diagnostic report file pointed to by the diagnostic report identifier, parse the slice number and its corresponding staining type and sampling site recorded in the diagnostic report file, find the slice number record corresponding to the current slice number node, and obtain the corresponding staining type and sampling site;
[0080] The read staining type and sampling site are matched with the corresponding staining type and sampling site obtained from the diagnostic report file. If the match fails, an attribute inconsistency exception is recorded and the output corresponding to the slice number node is blocked.
[0081] Specifically, when the layer-by-layer consistency verification process reaches the slide number node, the verification scope expands from the integrity of the node hierarchy to a cross-consistency check of attribute data and diagnostic report file content. At this stage, the verification engine first performs an attribute reading operation within the node. Specifically, the system reads the attribute data set attached to the current slide number node and extracts two key attribute values: the staining type field and the sampling site field. These attribute values represent the slide preparation and sampling information recorded during the internal collection and indexing of the pathology data set within the system.
[0082] Subsequently, the verification engine locates and retrieves the corresponding diagnostic report file entity based on the diagnostic report identifier recorded in the attribute data of the slide number node. The diagnostic report file itself is an authoritative diagnostic document issued by a pathologist, containing detailed observation results and corresponding information for each slide under that pathology number in a structured or semi-structured format. The system calls the appropriate parser according to the specific storage format of the diagnostic report file, extracting and parsing the slide information recorded in the file. This information includes at least the slide number listed in the report, as well as the staining type and sampling site explicitly bound to that slide number. After parsing, the system performs a precise search in the parsing results based on the unique identifier of the currently verified slide number node to locate the specific record corresponding to that slide number in the diagnostic report file, and obtains the staining type and sampling site confirmed by the diagnostic report.
[0083] After obtaining data from two sources, the system initiates a field-level string matching process. The system uses the staining type and sampling site read from the slice node attribute data as the values to be verified, and the staining type and sampling site parsed from the diagnostic report file as the reference values, performing a strict string equality comparison between the two. The comparison logic requires that the two strings be completely identical in content and format, excluding meaningless differences caused by noise such as capitalization, full-width or half-width spaces. If the match is successful, it indicates that the slice attributes collected in the pathology data set are consistent with the final diagnostic document, and the attribute verification of the slice node passes. If the match fails, meaning there is a difference in either the staining type or sampling site between the two sources, regardless of the size of the difference, the system determines that an attribute inconsistency anomaly has occurred. After triggering this anomaly, the verification engine immediately records the detailed information of the anomaly, including the complete path of the current slice number node, the specific field name of the inconsistency, and the actual values provided by each of the two data sources, and appends this anomaly information to the anomaly report of the layer-by-layer consistency verification. More importantly, in terms of the verification strategy, this abnormal event will directly block any possibility of the current slice number node being included in the set of data to be output in subsequent steps. That is, the slice number node is marked as output disabled, thereby forcibly isolating it in the output stage and ensuring that only slice data that has been cross-confirmed by multiple sources and has completely consistent attributes are eligible to enter the final output operation.
[0084] Furthermore, the attribute data also includes a first hash value corresponding to the digital image file identifier of the whole slide and a second hash value corresponding to the slice thumbnail file identifier;
[0085] When accessing the slice number node, the layer-by-layer consistency check also includes:
[0086] Based on the storage paths indicated by the full-slide digital image file identifier and the slice thumbnail file identifier mounted on the slice number node, retrieve the corresponding full-slide digital image physical file and slice thumbnail physical file;
[0087] If the retrieved physical file does not exist, a file missing exception is recorded.
[0088] If the retrieved physical file exists, calculate the hash value of each retrieved physical file, and compare the calculated hash value with the corresponding first hash value and second hash value in the attribute data. If the comparison is inconsistent, record the file integrity as abnormal.
[0089] Specifically, the attribute data set not only includes file identifiers pointing to digital slides, but also pre-built with a first hash value corresponding to the digital image file identifier of the whole slide and a second hash value corresponding to the slide thumbnail file identifier. These hash values are summary feature values generated by the system performing a predetermined hash algorithm on the original physical file entity during the collection and storage of pathological data or the most recent archiving operation, and are persistently stored in the attribute data field of the slide number node as a trusted digital fingerprint of the file's complete state at that time.
[0090] When the layer-by-layer consistency verification process descends to the slice number node level, the verification engine, after completing the hierarchical structure verification and attribute cross-verification, further initiates a check on the existence and integrity of the physical file entities. The verification engine first reads the full-slide digital image file identifier and the slice thumbnail file identifier from the attribute data mounted on the current slice number node. Based on the specific storage path mapped or resolved by these two identifiers, it initiates a targeted file retrieval request to the underlying object storage system, image archiving server, or distributed file system to locate and attempt to obtain the corresponding full-slide digital image physical file and slice thumbnail physical file.
[0091] If the target physical file entity cannot be found at the specified storage path, i.e., the system returns a confirmation signal that the file was not found or the path is invalid, the verification engine determines that a file missing exception has occurred. At this time, the system will record the detailed information of the exception, clearly indicating the missing file identifier, the expected storage path, and the complete path of the slice node to which it belongs, and will treat this exception as one of the blocking conditions for the slice node not to be output.
[0092] If the retrieval operation successfully locates and retrieves the corresponding physical file entity, the verification engine immediately enters the file integrity verification stage. The system reads the complete byte content of the full-slide digital image physical file and the slice thumbnail physical file in streaming mode, and uses the same hash algorithm as when generating the first and second hash values to calculate the calculated hash value of the currently retrieved full-slide digital image physical file and the calculated hash value of the slice thumbnail physical file in real time. After calculation, the system compares the calculated hash value of the full-slide digital image physical file bit by bit with the first hash value pre-stored in the attribute data, and simultaneously compares the calculated hash value of the slice thumbnail physical file bit by bit with the second hash value pre-stored in the attribute data. If any pair of hash values does not match during the comparison, it indicates that the physical file may have been corrupted, accidentally tampered with, or incompletely replaced during storage, transmission, or archiving. The verification engine determines that a file integrity anomaly has occurred. The system also records detailed information about this anomaly, including the inconsistent file identifier, the stored expected hash value, and the actual calculated hash value. This anomaly will serve as clear evidence that the slice node data is unreliable, causing the slice node to be excluded from the output data set during the subsequent output preparation stage. This mechanism provides a robust integrity protection barrier for pathological digital images and thumbnail files through the unforgeability and collision prevention properties of hash verification.
[0093] In some embodiments of this application, in the multi-level index tree data structure, each slice number node is further attached with one or more layer number child nodes. The slice number node is the parent node and the layer number child nodes form a fourth-level node. Each layer number child node is attached with the corresponding staining type, the digital image file identifier of the whole slide, and the pre-stored hash value of the digital image file of the whole slide.
[0094] The layer-by-layer consistency check also includes:
[0095] Traverse the child nodes of the layer number and verify whether the reference pointer of the child node of the layer number to the parent node of the slice number is complete;
[0096] The physical file is retrieved based on the digital image file identifier of the whole glass slide mounted on the layer number sub-node. The existence of the retrieved physical file is verified, and the hash value of the retrieved physical file is calculated. The calculated hash value is then compared with the pre-stored hash value mounted on the layer number sub-node.
[0097] Specifically, in some embodiments of this application, the multi-level index tree data structure extends the three-level architecture—pathology number as the first-level node, paraffin block number as the second-level node, and slide number as the third-level node—further downwards to a fourth-level index hierarchy. Specifically, each slide number node also has one or more slice number sub-nodes, with the slice number node as the parent node, forming a fourth-level node. The background to this extended design is that when digital pathology scanning equipment scans the same physical slide, it may capture multi-slice images at different focal lengths, or generate multispectral, multi-channel slice data within the same scanning cycle. Each slice constitutes an independent digital image that can be viewed across the entire field of view. Therefore, using slice number sub-nodes as independent index units allows for the refined management of the differentiated information of multiple full-slide digital images under the same slide. Each layer number sub-node carries corresponding attribute data, including the staining type corresponding to that layer, the whole slide digital image file identifier used to directly locate and access the image of that layer, and the pre-stored whole slide digital image file hash value calculated and persistently stored by the system when the image file of that layer is archived into the database. This hash value serves as the integrity benchmark for the corresponding layer image file and is bound to the layer number sub-node along with its file identifier.
[0098] Based on the established four-level index structure, the scope of the layer-by-layer consistency verification will be extended to deeper levels, adding a verification step specifically for layer number child nodes. After the verification process traverses to the slice number node using a depth-first or breadth-first strategy and completes all verification items for that node, the verification engine will continue to check whether the slice number node contains lower-level layer number child nodes. If layer number child nodes exist, each layer number child node is traversed sequentially, and a hierarchical structure integrity verification is performed for the fourth-level node. The verification process first focuses on whether the reference pointer of the layer number child node to the slice number parent node is complete. That is, the verification engine reads the pointer field of the parent node stored in the layer number child node, checks whether the pointer is not null, and verifies whether the parent node identifier it points to is strictly consistent with the actual slice number parent node identifier in the current traversal path. If the pointer is null or points to the wrong node, the system determines that a node-level disconnection anomaly has occurred on the fourth-level node, immediately records the complete path information of the layer number child node, and triggers the corresponding anomaly blocking strategy.
[0099] After the hierarchical structure verification passes, the verification engine further performs dual verification of the existence and integrity of the physical file entity associated with the layer number sub-node. The system reads the full-slide digital image file identifier from the attribute data mounted on the layer number sub-node, and initiates a retrieval request to the underlying storage system according to the storage path indicated by the identifier to confirm whether the physical file of the layer image actually exists in the specified location. If the retrieval operation returns a conclusion that the file does not exist, the verification engine records a file missing anomaly for the layer number sub-node, clearly marking the missing file identifier and its complete hierarchical path. If the retrieved physical file exists, the system reads all bytes of the physical file of the layer image in a streaming manner, and calculates the current hash value of the physical file in real time using the same hash algorithm as when generating the pre-stored hash value. After the calculation is completed, the real-time calculated hash value is compared bit by bit with the pre-stored hash value of the full-slide digital image file mounted on the layer number sub-node. If two hash values match perfectly, it indicates that the image file for that layer has not undergone any content changes or corruption since archiving, and the integrity check passes. If the comparison results are inconsistent, it is determined that there is a file integrity anomaly for that layer's sub-node. The system records the specific file identifier, the pre-stored hash value, and the actual calculated hash value, and marks that layer's sub-node as unavailable for output. By extending the verification reach to the layer level within the slice, the system can perform atomic-level quality control on each independent layer digital image, thereby achieving finer-grained data screening and isolation in the output stage than at the slice level, ensuring that every whole-slide digital image ultimately obtained by the user has verifiable integrity and reliability.
[0100] In some embodiments of this application, when the user selects an output item that includes generating a slice index page, the step of generating the set of data to be output and performing the output operation includes:
[0101] Extract all node data that pass the layer-by-layer consistency check from the multi-level index tree data structure;
[0102] For the thumbnail image pointed to by the slice thumbnail file identifier, the resolution is adapted and scaled according to the thumbnail display area size of the preset template;
[0103] Using a layout algorithm, based on the number of slices under the same wax block number node, the layout coordinates of each slice thumbnail and the text label associated with the slice thumbnail in the page are calculated. The text label includes the slice number, coloring type, and sampling location.
[0104] When the number of slices under the same wax block number exceeds the single page capacity threshold, a pagination mark is inserted within the grouping area of the same wax block number;
[0105] The calculated page description data is sent to the print output module for rasterization.
[0106] Specifically, when the user selects an output item that includes generating a slice index page, the process of generating the set of data to be output and performing the output operation is implemented as an automated process that integrates data filtering, image processing, dynamic typesetting and printing output.
[0107] First, the system performs data extraction and filtering operations. The system traverses all nodes of the multi-level index tree data structure, precisely filtering out all node data marked as passed verification based on the pass / fail and exception records generated during the layer-by-layer consistency verification phase. Only nodes with complete hierarchical structures, consistent attribute cross-references, and whose physical files have passed existence and integrity verification are eligible to have their associated information included in the index page generation. Through this filtering mechanism, all slice number nodes or layer number child nodes with verification exceptions are pre-excluded, thus ensuring that every record presented in the index page is built on a reliable data foundation.
[0108] Secondly, the system preprocesses the thumbnail images required for the index page. The system extracts the slice thumbnail file identifier from the filtered node data and retrieves the corresponding slice thumbnail physical file from the storage system based on this identifier. To meet the uniform specifications of the index page layout template, the system reads the thumbnail display area size parameters defined in the preset template and performs a resolution adaptation scaling operation on each extracted thumbnail image. This scaling operation adjusts the image size to within the rectangular display area specified by the template while maintaining the original image's aspect ratio, and uses an anti-aliasing interpolation algorithm to ensure the visual recognizability of the thumbnails after scaling, preventing the loss of organizational details due to scaling.
[0109] Subsequently, the system initiates dynamic layout calculation based on a typesetting algorithm. This algorithm uses the wax block number as the core grouping criterion. Based on the number of slice nodes associated with the same wax block number node in the multi-level index tree data structure, it calculates the two-dimensional layout coordinates of each slice thumbnail and its associated text label within the index page for each group. The text label is composed of three fields: slice number, coloring type, and sampling location. Its content directly originates from the attribute data of the corresponding slice number node that has passed verification. The typesetting algorithm arranges the thumbnails within the same wax block number group sequentially, allocates non-overlapping grid cells or flow regions on the page, and calculates the precise anchor point coordinates of each thumbnail within its grid cell. Simultaneously, it calculates the relative offset position of the corresponding text label and the thumbnail, ensuring a clear and readable association between the text label and the image.
[0110] During the typesetting calculation process, the system introduces a single-page capacity threshold mechanism to handle situations where the number of slices within a wax block number group exceeds the single-page capacity. The single-page capacity threshold is the maximum number of thumbnail units that each page can accommodate, defined in a preset template. When the typesetting algorithm detects that the number of slice nodes under the same wax block number exceeds this threshold, the system automatically inserts a pagination marker after the slice unit whose page capacity has reached the threshold during the traversal of the slice sequence for that wax block number group. This pagination marker indicates that the remaining slice thumbnails belonging to the same wax block number should continue the layout from a new page, and the new page inherits the group identifier area of that wax block number, thus ensuring that although data under the same wax block number is displayed across pages, it still maintains the continuity of its histological origin.
[0111] Once all verified node data has undergone layout coordinate calculations and pagination processing, the system integrates complete page description data. This page description data includes the size definition for each page, background template, references and placement coordinates of each thumbnail image, string content, font style and placement coordinates of each text label, and page boundaries indicated by pagination marks. The system serializes this page description data into a page description language format recognizable by the printing output module and sends it to the printing output module. Upon receiving the page description data, the printing output module performs rasterization processing, converting the vector coordinates and image data into dot matrix data that can be directly imaged by the printing device, ultimately driving the printing device to output physical media containing sliced index pages.
[0112] Furthermore, the process of calculating the layout coordinates also includes:
[0113] Group all slice thumbnails belonging to the same wax block number secondary node into one rendering group;
[0114] When rendering the rendering group, the graphics drawing interface is called to draw closed border lines at the group boundary, and the wax block number is rendered as the group title text at a preset position on the border line to form a visual block grouped by wax block on the printed slice index page.
[0115] Specifically, when the layout algorithm traverses to a second-level node of a certain wax block number, the system first, based on the parent-child relationships in the multi-level index tree data structure, groups all slice thumbnails under that wax block number node that have passed the layer-by-layer consistency check into the same rendering group. This rendering group is a logical set used to uniformly manage the position, size, and visibility attributes of all thumbnail units to be layout under that wax block number.
[0116] After calculating the coordinates of each slice thumbnail and its associated text label within the rendering group, the system does not immediately move to the next group. Instead, it initiates the boundary drawing process for that group. The system reads the layout coordinates of all thumbnail units within the group on the page and determines the smallest bounding rectangle that can completely enclose all visual elements of the group through traversal calculations. Subsequently, the system calls the vector drawing instructions of the underlying graphics drawing application programming interface to draw a closed border line along the edge of the bounding rectangle. The color, line width, and line style of this border line all follow the style definition in the preset template to form a clear visual separation.
[0117] After drawing the border lines, the system further extracts the wax block number string from the second-level node corresponding to the rendered group and uses it as the group title text. Based on the positioning rules for group titles in the preset template, the system calculates the preset rendering position of the title text on the border lines. For example, it positions the lower left corner anchor point of the title text at a specified offset outside the top edge of the border line, or centers the title text at the top edge of the border line. After the coordinate calculation is complete, the system calls the text rendering command of the graphics drawing interface, using the font, size, and color specified in the template, to draw the wax block number group title text at that position.
[0118] After the printing module completes the rasterization process and outputs the physical media, the user's slice index page will display visual blocks divided by wax blocks. Each block is defined by a closed border line, and inside, thumbnails and text labels of the slices contained in that wax block are neatly arranged. The corresponding wax block number title is printed in a prominent position outside the border, thus realizing intuitive classification and rapid retrieval of the organized film information.
[0119] In some embodiments of this application, when the user-selected output item includes writing digital pathology slide files to an external storage medium, the process of generating the set of data to be output and performing the output operation may include:
[0120] Call the operating system interface to obtain the remaining storage space parameters of the external storage medium, and compare the remaining storage space parameters with the total size of the file to be written;
[0121] With sufficient remaining storage space, based on the pathology number, paraffin block number, and slide number node names in the multi-level index tree data structure, a corresponding hierarchical directory structure is created level by level on the external storage medium.
[0122] Multiple parallel writing threads are started to write the full slide digital image file, diagnostic report file and slice thumbnail file to the corresponding directories respectively, and each writing thread reports the writing byte progress to the main thread during the writing process.
[0123] After all write threads have finished, the written files are reread item by item and the write file checksum is calculated. The write file checksum is compared with the source file checksum stored in memory corresponding to the written file. If any of the comparisons are inconsistent, the separate write thread corresponding to the inconsistent file is rescheduled until the rewritten file checksum matches the source file checksum or the preset number of retries is reached.
[0124] Specifically, the system first performs a pre-check of the external storage media space. The system obtains the remaining storage space parameters of the currently mounted external storage media by calling the standard storage management interface provided by the host operating system. Simultaneously, the system iterates through the set of data to be output, accumulating the total byte size of all files to be written. These files include whole-slide digital image files, diagnostic report files, and slide thumbnail files. The system compares the obtained remaining storage space parameters with the total size of the files to be written. If the remaining space is insufficient to accommodate all the files to be written, the output process is terminated, and a clear message indicating insufficient space is returned to the user interface. Only when the remaining storage space is greater than or equal to the total size of the files to be written is the subsequent writing process allowed to start.
[0125] After the remaining storage space verification is successful, the system enters the directory structure reconstruction phase. Based on the hierarchical relationship between pathology numbers, paraffin block numbers, and slide numbers recorded in the multi-level index tree data structure, the system creates corresponding hierarchical directory structures level by level under the designated root directory of the external storage medium. Specifically, the system first creates a folder with the pathology number as the first-level directory name, then enters that pathology number directory and creates subfolders with each paraffin block number as the second-level directory name, and finally enters each paraffin block number directory and creates terminal folders with each slide number as the third-level directory name. Thus, a physical directory topology isomorphic to the index tree data structure is completely reproduced on the external storage medium, providing a standardized path framework for subsequent file classification and placement.
[0126] After the directory structure is created, the system initiates a multi-threaded parallel write process. Based on the type and quantity of files to be written, the system initializes a thread pool and starts multiple parallel write threads. Each write thread is assigned a specific write task, responsible for reading the whole slide digital image file, diagnostic report file, and slide thumbnail file from the source storage location and writing them to the corresponding third-level directory on the external storage medium. During the write process, each write thread periodically reports its current successfully written byte progress to the main thread. The main thread can then aggregate and calculate the overall write progress and update the progress indicator on the user interface as needed.
[0127] After all parallel write threads have completed their tasks and exited normally, the system enters the post-write verification and retry phase. The system no longer relies on the transport layer's verification mechanism during the write process, but instead initiates an independent verification process: for each written file, the system rereads all bytes of its content from the external storage medium and calculates the write file checksum in real time using the same hash algorithm as the source file checksum. Subsequently, the system compares the calculated write file checksum with the source file checksum, which was pre-calculated and saved in memory before writing. If the checksums of all written files match the corresponding source file checksums, the write operation is considered completely successful, and the output process enters the final stage. If any comparison shows a discrepancy, it indicates that silent data corruption occurred during the write process, and the system immediately schedules a new, separate write thread to rewrite the file with the discrepancy. After rewriting, the system again executes the file reading, checksum calculation, and verification process. This retry process can be repeated until the rewritten file checksum matches the source file checksum, or the cumulative number of retries reaches a preset retry threshold. If the preset number of retries is reached and the verification value is still inconsistent, the system records the write failure exception of the file and clearly marks it in the final output result for users to perform targeted manual verification and handling.
[0128] The following describes a pathological slide data output device provided in the embodiments of this application. The pathological slide data output device described below and the pathological slide data output method described above can be referred to and correspond to each other.
[0129] See Figure 2 , Figure 2 This is a schematic diagram of a pathological slide data output device disclosed in an embodiment of this application.
[0130] like Figure 2 As shown, the pathological slide data output device may include:
[0131] The data query module 110 is used to query the pathological data set from various pathological information systems based on the user's identity information and / or slide retrieval authorization code. The pathological data set includes the pathological number, as well as the paraffin block number, slide number, staining type, sampling site, whole slide digital image file identifier, slide thumbnail file identifier, diagnostic report identifier, and consultation data identifier that are hierarchically associated with the pathological number.
[0132] The index building module 120 is used to build a multi-level index tree data structure for the pathological data set. The pathology number is used as the first-level node, the paraffin block number is used as the second-level node, and the slide number is used as the third-level node. Under each slide number node, attribute data including staining type, sampling site, whole slide digital image file identifier, slide thumbnail file identifier, diagnostic report identifier, and consultation data identifier are attached. For multiple paraffin blocks under the same pathology number and multiple slides under the same paraffin block number, parent-child reference pointers between nodes are established in the multi-level index tree data structure.
[0133] The layer-by-layer verification module 130 is used to traverse the multi-level index tree data structure and perform layer-by-layer consistency verification on the pathological data set before generating the output task according to the output items selected by the user.
[0134] The data output module 140 is used to generate a set of data to be output and perform the output operation when all the layer-by-layer consistency checks pass.
[0135] As can be seen from the above technical solutions, the pathological slide data output method, apparatus, and device provided in this application first obtain a set of pathological data from various pathological information systems based on user identity information and / or slide retrieval authorization code. Then, a multi-level index tree is established with pathology number as the first-level node, paraffin block number as the second-level node, and slide number as the third-level node, and attribute data such as staining type, sampling site, and whole slide digital image file identifier are attached. Parent-child reference pointers are established for multiple paraffin blocks under the same pathology number and multiple slides under the same paraffin block number. Then, the index tree is traversed to perform layer-by-layer consistency verification. After all verifications pass, the data set to be output is generated and output.
[0136] This application utilizes a joint query mechanism based on user identity and slide retrieval authorization code to match a complete set of pathological data from the pathology information system. This achieves precise aggregation of multi-source data according to permissions, eliminating the need for manual cross-system searches. By constructing a multi-level index tree and explicitly establishing parent-child reference pointers between paraffin blocks and slide nodes, the natural hierarchical relationship of pathological data is transformed into a structured data association. This ensures that the attributes of each slide, such as images, reports, and consultation data, are uniquely attached to the correct node, achieving precise positioning of the output data's attribution and avoiding hierarchical errors. Furthermore, before output, the index tree is traversed to perform layer-by-layer consistency checks. Each node is checked to verify the existence and accessibility of the actual files, such as the full-slide digital images, thumbnails, diagnostic reports, and consultation data pointed to by each file identifier. This proactively intercepts any data readiness issues or missing associations at the output source, ensuring that only data that has passed all checks is included in the output set, thereby achieving the completeness and reliability of the output content. Ultimately, the verified set of data to be output can be naturally mapped into a hierarchical output directory using the index tree structure, which can be directly used for archiving or sharing. The entire process organically integrates query aggregation, hierarchical indexing, integrity verification and output execution, significantly improving the accuracy and efficiency of pathological slide data output.
[0137] Optionally, the parent-child reference pointer includes a pointer from the parent node to the child node and a pointer from the child node to the parent node;
[0138] The traversal of the multi-level index tree data structure and the performance of layer-by-layer consistency checks on the pathological data set include:
[0139] The depth-first traversal algorithm is used to access each level of the multi-level index tree data structure sequentially.
[0140] During the access process, it is verified whether the pointers of the child nodes to the parent nodes of the current node point to the correct parent node. If the pointers of the child nodes to the parent nodes are null or do not point to the correct parent node, it is determined that a node level disconnection anomaly has occurred, the abnormal node path information is recorded, and subsequent verification is terminated.
[0141] Optionally, when accessing the slice number node, the layer-by-layer consistency check further includes:
[0142] Read the coloring type and sampling location from the attribute data attached to the slice number node;
[0143] Based on the diagnostic report file pointed to by the diagnostic report identifier, parse the slice number and its corresponding staining type and sampling site recorded in the diagnostic report file, find the slice number record corresponding to the current slice number node, and obtain the corresponding staining type and sampling site;
[0144] The read staining type and sampling site are matched with the corresponding staining type and sampling site obtained from the diagnostic report file. If the match fails, an attribute inconsistency exception is recorded and the output corresponding to the slice number node is blocked.
[0145] Optionally, the attribute data may further include a first hash value corresponding to the digital image file identifier of the whole slide and a second hash value corresponding to the slice thumbnail file identifier;
[0146] When accessing the slice number node, the layer-by-layer consistency check also includes:
[0147] Based on the storage paths indicated by the full-slide digital image file identifier and the slice thumbnail file identifier mounted on the slice number node, retrieve the corresponding full-slide digital image physical file and slice thumbnail physical file;
[0148] If the retrieved physical file does not exist, a file missing exception is recorded.
[0149] If the retrieved physical file exists, calculate the hash value of each retrieved physical file, and compare the calculated hash value with the corresponding first hash value and second hash value in the attribute data. If the comparison is inconsistent, record the file integrity as abnormal.
[0150] Optionally, in the multi-level index tree data structure, each slice number node also has one or more layer number child nodes attached, forming a fourth-level node with the slice number node as the parent node and the layer number child nodes. Each layer number child node has the corresponding staining type, the digital image file identifier of the whole slide, and the pre-stored hash value of the digital image file of the whole slide attached.
[0151] The layer-by-layer consistency check also includes:
[0152] Traverse the child nodes of the layer number and verify whether the reference pointer of the child node of the layer number to the parent node of the slice number is complete;
[0153] The physical file is retrieved based on the digital image file identifier of the whole glass slide mounted on the layer number sub-node. The existence of the retrieved physical file is verified, and the hash value of the retrieved physical file is calculated. The calculated hash value is then compared with the pre-stored hash value mounted on the layer number sub-node.
[0154] Optionally, when the user selects an output item that includes generating a slice index page, generating the set of data to be output and performing the output operation includes:
[0155] Extract all node data that pass the layer-by-layer consistency check from the multi-level index tree data structure;
[0156] For the thumbnail image pointed to by the slice thumbnail file identifier, the resolution is adapted and scaled according to the thumbnail display area size of the preset template;
[0157] Using a layout algorithm, based on the number of slices under the same wax block number node, the layout coordinates of each slice thumbnail and the text label associated with the slice thumbnail in the page are calculated. The text label includes the slice number, coloring type, and sampling location.
[0158] When the number of slices under the same wax block number exceeds the single page capacity threshold, a pagination mark is inserted within the grouping area of the same wax block number;
[0159] The calculated page description data is sent to the print output module for rasterization.
[0160] Optionally, the process of calculating the layout coordinates also includes:
[0161] Group all slice thumbnails belonging to the same wax block number secondary node into one rendering group;
[0162] When rendering the rendering group, the graphics drawing interface is called to draw closed border lines at the group boundary, and the wax block number is rendered as the group title text at a preset position on the border line to form a visual block grouped by wax block on the printed slice index page.
[0163] Optionally, when the user-selected output item includes writing digital pathology slide files to an external storage medium, the step of generating the set of data to be output and performing the output operation includes:
[0164] Call the operating system interface to obtain the remaining storage space parameters of the external storage medium, and compare the remaining storage space parameters with the total size of the file to be written;
[0165] With sufficient remaining storage space, based on the pathology number, paraffin block number, and slide number node names in the multi-level index tree data structure, a corresponding hierarchical directory structure is created level by level on the external storage medium.
[0166] Multiple parallel writing threads are started to write the full slide digital image file, diagnostic report file and slice thumbnail file to the corresponding directories respectively, and each writing thread reports the writing byte progress to the main thread during the writing process.
[0167] After all write threads have finished, the written files are reread item by item and the write file checksum is calculated. The write file checksum is compared with the source file checksum stored in memory corresponding to the written file. If any of the comparisons are inconsistent, the separate write thread corresponding to the inconsistent file is rescheduled until the rewritten file checksum matches the source file checksum or the preset number of retries is reached.
[0168] The pathological slide data output device provided in this application embodiment can be applied to pathological slide data output equipment. Figure 3 The hardware structure block diagram of the pathology slide data output device is shown below. Figure 3 The hardware structure of a pathological slide data output device may include: at least one processor 1, at least one communication interface 2, at least one memory 3, and at least one communication bus 4.
[0169] In this embodiment of the application, the number of processor 1, communication interface 2, memory 3, and communication bus 4 is at least one, and processor 1, communication interface 2, and memory 3 communicate with each other through communication bus 4;
[0170] Processor 1 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present invention.
[0171] Memory 3 may include high-speed RAM, and may also include non-volatile memory, such as at least one disk storage device;
[0172] The memory stores a program, which the processor can call. The program is used for:
[0173] Based on the user's identity information and / or slide retrieval authorization code, the pathological data set is queried from each pathology information system. The pathological data set includes the pathology number, as well as the paraffin block number, slide number, staining type, sampling site, whole slide digital image file identifier, slide thumbnail file identifier, diagnostic report identifier, and consultation data identifier that are hierarchically associated with the pathology number.
[0174] A multi-level index tree data structure is established for the pathological data set, wherein the pathology number is used as the first-level node, the paraffin block number is used as the second-level node, and the slide number is used as the third-level node. Under each slide number node, attribute data including staining type, sampling site, whole slide digital image file identifier, slide thumbnail file identifier, diagnostic report identifier, and consultation data identifier are attached. For multiple paraffin blocks under the same pathology number and multiple slides under the same paraffin block number, parent-child reference pointers between nodes are established in the multi-level index tree data structure.
[0175] Before generating output tasks based on the output items selected by the user, the multi-level index tree data structure is traversed to perform a layer-by-layer consistency check on the pathological data set.
[0176] When all the layer-by-layer consistency checks pass, a set of data to be output is generated and the output operation is performed.
[0177] Optionally, the refined and extended functions of the program can be referred to the above description.
[0178] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0179] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0180] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for outputting pathological slide data, characterized in that, include: Based on the user's identity information and / or slide retrieval authorization code, the pathological data set is queried from each pathology information system. The pathological data set includes the pathology number, as well as the paraffin block number, slide number, staining type, sampling site, whole slide digital image file identifier, slide thumbnail file identifier, diagnostic report identifier, and consultation data identifier that are hierarchically associated with the pathology number. A multi-level index tree data structure is established for the pathological data set, wherein the pathology number is used as the first-level node, the paraffin block number is used as the second-level node, and the slide number is used as the third-level node. Under each slide number node, attribute data including staining type, sampling site, whole slide digital image file identifier, slide thumbnail file identifier, diagnostic report identifier, and consultation data identifier are attached. For multiple paraffin blocks under the same pathology number and multiple slides under the same paraffin block number, parent-child reference pointers between nodes are established in the multi-level index tree data structure. Before generating output tasks based on the output items selected by the user, the multi-level index tree data structure is traversed to perform a layer-by-layer consistency check on the pathological data set. When all the layer-by-layer consistency checks pass, a set of data to be output is generated and the output operation is performed.
2. The method according to claim 1, characterized in that, The parent-child reference pointers include pointers from the parent node to the child node and pointers from the child node to the parent node; The traversal of the multi-level index tree data structure and the performance of layer-by-layer consistency checks on the pathological data set include: The depth-first traversal algorithm is used to access each level of the multi-level index tree data structure sequentially. During the access process, it is verified whether the pointers of the child nodes to the parent nodes of the current node point to the correct parent node. If the pointers of the child nodes to the parent nodes are null or do not point to the correct parent node, it is determined that a node level disconnection anomaly has occurred, the abnormal node path information is recorded, and subsequent verification is terminated.
3. The method according to claim 2, characterized in that, When accessing the slice number node, the layer-by-layer consistency check also includes: Read the coloring type and sampling location from the attribute data attached to the slice number node; Based on the diagnostic report file pointed to by the diagnostic report identifier, parse the slice number and its corresponding staining type and sampling site recorded in the diagnostic report file, find the slice number record corresponding to the current slice number node, and obtain the corresponding staining type and sampling site; The read staining type and sampling site are matched with the corresponding staining type and sampling site obtained from the diagnostic report file. If the match fails, an attribute inconsistency exception is recorded and the output corresponding to the slice number node is blocked.
4. The method according to claim 2, characterized in that, The attribute data also includes a first hash value corresponding to the digital image file identifier of the whole glass slide and a second hash value corresponding to the slice thumbnail file identifier; When accessing the slice number node, the layer-by-layer consistency check also includes: Based on the storage paths indicated by the full-slide digital image file identifier and the slice thumbnail file identifier mounted on the slice number node, retrieve the corresponding full-slide digital image physical file and slice thumbnail physical file; If the retrieved physical file does not exist, a file missing exception is recorded. If the retrieved physical file exists, calculate the hash value of each retrieved physical file, and compare the calculated hash value with the corresponding first hash value and second hash value in the attribute data. If the comparison is inconsistent, record the file integrity as abnormal.
5. The method according to claim 1, characterized in that, In the multi-level index tree data structure, each slice number node also has one or more layer number child nodes attached. The slice number node is the parent node and the layer number child nodes form a fourth-level node. Each layer number child node is attached with the corresponding staining type, the digital image file identifier of the whole slide, and the pre-stored hash value of the digital image file of the whole slide. The layer-by-layer consistency check also includes: Traverse the child nodes of the layer number and verify whether the reference pointer of the child node of the layer number to the parent node of the slice number is complete; The physical file is retrieved based on the digital image file identifier of the whole glass slide mounted on the layer number sub-node. The existence of the retrieved physical file is verified, and the hash value of the retrieved physical file is calculated. The calculated hash value is then compared with the pre-stored hash value mounted on the layer number sub-node.
6. The method according to claim 1, characterized in that, When the user selects an output item that includes generating a slice index page, the process of generating the set of data to be output and performing the output operation includes: Extract all node data that pass the layer-by-layer consistency check from the multi-level index tree data structure; For the thumbnail image pointed to by the slice thumbnail file identifier, the resolution is adapted and scaled according to the thumbnail display area size of the preset template; Using a layout algorithm, based on the number of slices under the same wax block number node, the layout coordinates of each slice thumbnail and the text label associated with the slice thumbnail in the page are calculated. The text label includes the slice number, coloring type, and sampling location. When the number of slices under the same wax block number exceeds the single page capacity threshold, a pagination mark is inserted within the grouping area of the same wax block number; The calculated page description data is sent to the print output module for rasterization.
7. The method according to claim 6, characterized in that, The process of calculating the layout coordinates also includes: Group all slice thumbnails belonging to the same wax block number secondary node into one rendering group; When rendering the rendering group, the graphics drawing interface is called to draw closed border lines at the group boundary, and the wax block number is rendered as the group title text at a preset position on the border line to form a visual block grouped by wax block on the printed slice index page.
8. The method according to claim 1, characterized in that, When the user selects an output item that includes writing digital pathology slide files to an external storage medium, the process of generating the set of data to be output and performing the output operation includes: Call the operating system interface to obtain the remaining storage space parameters of the external storage medium, and compare the remaining storage space parameters with the total size of the file to be written; With sufficient remaining storage space, based on the pathology number, paraffin block number, and slide number node names in the multi-level index tree data structure, a corresponding hierarchical directory structure is created level by level on the external storage medium. Multiple parallel writing threads are started to write the full slide digital image file, diagnostic report file and slice thumbnail file to the corresponding directories respectively, and each writing thread reports the writing byte progress to the main thread during the writing process. After all write threads have finished, the written files are reread item by item and the write file checksum is calculated. The write file checksum is compared with the source file checksum stored in memory corresponding to the written file. If any of the comparisons are inconsistent, the separate write thread corresponding to the inconsistent file is rescheduled until the rewritten file checksum matches the source file checksum or the preset number of retries is reached.
9. A pathological slide data output device, characterized in that, include: The data query module is used to query the pathological data set from various pathological information systems based on the user's identity information and / or slide retrieval authorization code. The pathological data set includes the pathology number, as well as the paraffin block number, slide number, staining type, sampling site, whole slide digital image file identifier, slide thumbnail file identifier, diagnostic report identifier, and consultation data identifier that are hierarchically associated with the pathology number. The index building module is used to build a multi-level index tree data structure for the pathological data set. The pathology number is used as the first-level node, the paraffin block number as the second-level node, and the slide number as the third-level node. Each slide number node is equipped with attribute data including staining type, sampling site, whole slide digital image file identifier, slide thumbnail file identifier, diagnostic report identifier, and consultation data identifier. For multiple paraffin blocks under the same pathology number and multiple slides under the same paraffin block number, parent-child reference pointers between nodes are established in the multi-level index tree data structure. The layer-by-layer verification module is used to traverse the multi-level index tree data structure and perform layer-by-layer consistency verification on the pathological data set before generating the output task according to the output items selected by the user. The data output module is used to generate a set of data to be output and perform the output operation when all the layer-by-layer consistency checks pass.
10. A pathological slide data output device, characterized in that, Including memory and processor; The memory is used to store programs; The processor is used to execute the program to implement each step of the pathological slide data output method as described in any one of claims 1-8.
