A cornerstone3D-based medical image segmentation ROI data conversion method and system

By converting the ROI data format in Cornerstone3D, the compatibility issues between 3D Slicer and Cornerstone3D were resolved, enabling seamless migration and efficient conversion of AI segmentation algorithms, and ensuring the spatial consistency and clinical application accuracy of the converted segmentation data.

CN121837018BActive Publication Date: 2026-06-26安徽福晴医疗装备有限公司
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
安徽福晴医疗装备有限公司
Filing Date
2026-03-16
Publication Date
2026-06-26

AI Technical Summary

Technical Problem

The existing ROI data format output by 3D Slicer has compatibility differences with Cornerstone3D's Labelmap format, resulting in high migration costs, low conversion efficiency, and loss of accuracy for AI segmentation algorithms, which affects clinical applications, especially in the processing of large-size 3D image data.

Method used

By acquiring target medical image data and its ROI data, multi-format recognition and parsing are performed to construct a standardized array of ROI objects. The data is then loaded using Cornerstone3D's image loading method, coordinate system transformation and voxel filling are performed, and Labelmap data is generated to ensure that the transformed segmented data is consistent with the original ROI in spatial location.

Benefits of technology

The AI ​​segmentation algorithm in 3D Slicer was seamlessly applied to Cornerstone3D's web imaging system, reducing development costs and meeting the accuracy requirements of clinical applications, ensuring that the converted segmented data is completely consistent with the original ROI in spatial location.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121837018B_ABST
    Figure CN121837018B_ABST
Patent Text Reader

Abstract

The application discloses a medical image segmentation ROI data conversion method and system based on Cornerstone3D, relates to the field of data conversion, and comprises the following steps: acquiring target medical image data and ROI data thereof; performing multi-format identification and analysis on the ROI data of the target medical image data to obtain a standardized ROI object array; acquiring a Cornerstone3D segmentation volume object of the target medical image data; performing coordinate system conversion and voxel filling on the ROI object array based on the Cornerstone3D segmentation volume object to obtain Labelmap data. The application can directly convert data from the ROI format of 3D Slicer to the Labelmap format of Cornerstone3D, and ensures that the converted segmentation data is completely consistent with the original ROI in spatial position, thereby meeting the accuracy requirements of clinical application.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of medical image data processing technology, and in particular to a method and system for converting ROI data of medical image segmentation based on Cornerstone3D. Background Technology

[0002] With the rapid development of artificial intelligence technology in the field of medical imaging, deep learning-based automatic segmentation algorithms have been widely used in clinical diagnosis. 3D Slicer, as an open-source medical image processing software, integrates a large number of mature AI segmentation algorithms (such as SegmentAnything, TotalSegmentator, etc.), which can realize the automatic identification and segmentation of anatomical structures such as organs and lesions.

[0003] However, with the development of web technology, more and more medical image viewing systems are migrating from traditional client software to browser environments. Cornerstone3D, as the most popular browser-based medical image rendering library, is widely used in online PACS systems and telemedicine platforms. However, there are significant differences between the ROI (Region of Interest) data format output by 3D Slicer and the Labelmap format of Cornerstone3D, making them incompatible.

[0004] To address this issue, some users need to redraw the ROI region using interactive segmentation tools (such as brushes and thresholding) within the Cornerstone3D environment. This method relies entirely on manual operation, cannot utilize the AI ​​algorithm capabilities of 3D Slicer, and results in high algorithm migration costs. Each time a new segmentation algorithm is desired, it needs to be reimplemented on the browser side, leading to long development cycles and high maintenance costs.

[0005] Some users export the segmentation results from 3D Slicer as intermediate formats such as DICOM Segmentation objects, and then import them into Cornerstone3D via a DICOM loader. However, this method involves multiple data encoding and decoding processes, resulting in low conversion efficiency. Especially for large-size 3D image data, the conversion process can take tens of seconds or even minutes. Furthermore, conversion through intermediate formats may introduce accuracy loss, particularly during coordinate system transformation and resampling, potentially leading to inaccurate segmentation boundaries and impacting clinical applications. In addition, the DICOM Segmentation-based method requires PACS server support, increasing system complexity and dependence on network conditions, making it unusable in offline or local application scenarios. Different versions of 3D Slicer may have different output formats, lacking a unified parsing and conversion mechanism, leading to system stability and compatibility issues. Summary of the Invention

[0006] To address the technical problems existing in the background art, this invention proposes a method and system for medical image segmentation ROI data conversion based on Cornerstone3D.

[0007] In a first aspect, the present invention proposes a method for medical image segmentation ROI data conversion based on Cornerstone3D, comprising:

[0008] Acquire target medical imaging data and its ROI data;

[0009] The ROI data of the target medical imaging data is identified and parsed in multiple formats to obtain a standardized array of ROI objects;

[0010] The target medical image data is loaded using Cornerstone3D's image loading method to obtain a Cornerstone3D segmented volume object of the target medical image data.

[0011] Based on Cornerstone3D segmentation of volume objects, coordinate system transformation and voxel filling are performed on the ROI object array to obtain Labelmap data.

[0012] Preferably, the ROI object array includes key parameters for each ROI object, including center point coordinates, three-dimensional dimensions, and spatial orientation matrix.

[0013] Preferably, the Cornerstone3D segmentation volume object includes the three-dimensional dimensions of the target medical image data, the voxel spacing, the coordinates of the spatial origin, the index coordinates of the voxels, and the orientation matrix.

[0014] Preferably, based on Cornerstone 3D segmentation of volume objects, coordinate system transformation and voxel filling are performed on the ROI object array to obtain Labelmap data. Specifically, this includes: for each ROI object in the ROI object array, constructing a spatial transformation matrix based on the spatial direction matrix and the direction matrix, and calculating the inverse spatial transformation matrix of the spatial transformation matrix; and performing coordinate system transformation on each voxel in the ROI object based on the inverse spatial transformation matrix.

[0015] Based on the center point coordinates and 3D dimensions of the ROI object, calculate the minimum bounding box of the ROI object in the image space; for each voxel within the minimum bounding box, based on the coordinates of the voxel after coordinate system transformation, determine whether the voxel is within the predefined range of the ROI object; if so, determine that the voxel is within the predefined range of the ROI object, and fill the voxel value with the preset segmentation label index; if not, skip the voxel.

[0016] After traversing all voxels within the minimum bounding box of all ROI objects, the Labelmap data is obtained.

[0017] Preferably, the spatial transformation matrix is ​​constructed based on the spatial direction matrix and the direction matrix, specifically including: constructing a first transformation matrix based on the spatial origin coordinates, voxel spacing and the direction matrix to transform the index coordinates of voxels to world coordinates; constructing a second transformation matrix based on the center point coordinates and the spatial direction matrix to transform the world coordinates to the local coordinates of the ROI; multiplying the first transformation matrix and the second transformation matrix to obtain the spatial transformation matrix.

[0018] Preferably, a coordinate system transformation is performed on each voxel in the ROI object based on the inverse space transformation matrix, specifically including:

[0019] For each voxel in the ROI object, convert the voxel's index coordinates (i, j, k) to world coordinates (x, y, z) in physical space;

[0020] Translate the voxel's world coordinates to a world coordinate system with the center of the ROI object as the origin to obtain the voxel's relative center coordinates (△x, △y, △z);

[0021] The relative center coordinates of the voxel are transformed into the local coordinate system of the ROI object through the inverse space transformation matrix to obtain the ROI local coordinates (Ix, Iy, Iz) of the voxel.

[0022] Based on the voxel's local ROI coordinates (Ix, Iy, Iz), determine whether the voxel is within the predefined range of the ROI object.

[0023] Preferably, the world coordinates are worldCoord = origin + index × spacing;

[0024] In the formula, worldCoord is the world coordinate, origin is the world coordinate origin of the first voxel in the ROI object, index is the index coordinate, and spacing is the voxel spacing.

[0025] The relative center coordinates are localCoord1 = worldCoord - ROl.center;

[0026] In the formula, localCoord1 is the relative center coordinate, worldCoord is the world coordinate, and ROl.center is the center point coordinate of the ROI object;

[0027] Wherein, the local coordinates of the ROI are localCoord2 = inverse(orientationMatrix) ×localCoord1;

[0028] In the formula, localCoord2 is the local coordinate of the ROI, and inverse(orientationMatrix) is the inverse spatial transformation matrix.

[0029] Preferably, based on the coordinates of the voxel after coordinate system transformation, it is determined whether each voxel is within the predefined range of the ROI object, specifically including:

[0030] Based on the voxel's local ROI coordinates (Ix, Iy, Iz), determine whether the voxel is within the predefined range of the ROI object;

[0031] If the local coordinates (Ix, Iy, Iz) of the ROI of the voxel meet the preset conditions, then the voxel is determined to be within the predefined range of the ROI object; otherwise, the voxel is determined to be outside the predefined range of the ROI object.

[0032] The preset conditions are [Ix] ≤ size.x / 2 and [Iy] ≤ size.y / 2 and [Iz] ≤ size.z / 2; where size.x, size.y, and size.z are the side lengths of the ROI object in the x, y, and z directions of the ROI local coordinate system, i.e., the three-dimensional dimensions; [Ix], [Iy], and [Iz] are the absolute values ​​of the coordinates of the voxel in the x, y, and z directions of the ROI local coordinate system, respectively.

[0033] Preferably, the traversal and voxel filling process adopts a batch asynchronous processing mechanism.

[0034] Secondly, this invention also proposes a medical image segmentation ROI data conversion system based on Cornerstone3D, comprising:

[0035] The acquisition module is used to acquire target medical image data and its ROI data;

[0036] The ROI data parsing module is used to identify and parse the ROI data of the target medical image data in multiple formats, and obtain a standardized array of ROI objects.

[0037] The processing module is used to load the target medical image data using Cornerstone3D's image loading method, obtain the Cornerstone3D segmented volume object of the target medical image data, and perform coordinate system transformation and voxel filling on the ROI object array based on the Cornerstone3D segmented volume object to obtain Labelmap data.

[0038] Preferably, the ROI object array includes key parameters for each ROI object, including center point coordinates, three-dimensional dimensions, and spatial orientation matrix.

[0039] Preferably, the processing module includes:

[0040] Labelmap fill units are used to load target medical image data using Cornerstone3D's image loading method to obtain a Cornerstone3D segmented volume object of the target medical image data. The Cornerstone3D segmented volume object includes the three-dimensional dimensions of the target medical image data, voxel spacing, voxel index coordinates, spatial origin coordinates, and orientation matrix.

[0041] The coordinate transformation calculation unit is used to construct a spatial transformation matrix for each ROI object in the ROI object array based on the spatial direction matrix and the direction matrix, and to calculate the inverse spatial transformation matrix of the spatial transformation matrix; and to perform coordinate system transformation on each voxel in the ROI object based on the inverse spatial transformation matrix.

[0042] The spatial determination unit is used to calculate the minimum bounding box of the ROI object in the image space based on the center point coordinates and three-dimensional dimensions of the ROI object; for each voxel within the minimum bounding box, it determines whether the voxel is within the predefined range of the ROI object based on the coordinates of the voxel after coordinate system transformation.

[0043] The Labelmap filling unit is also used to fill the voxel value with a preset segmentation label index when it is determined that the voxel is within the predefined range of the ROI object;

[0044] After traversing all voxels within the minimum bounding box of all ROI objects, the Labelmap data is obtained.

[0045] The proposed method and system for converting ROI data in medical image segmentation based on Cornerstone3D can directly convert data from the ROI format of 3D Slicer to the Labelmap format of Cornerstone3D, enabling the seamless application of AI segmentation algorithms in 3D Slicer to WEB imaging systems based on Cornerstone3D, thus reducing development costs. Moreover, through coordinate system transformation and voxel filling, it ensures that the converted segmented data is completely consistent with the original ROI in spatial location, meeting the accuracy requirements of clinical applications. Attached Figure Description

[0046] Figure 1 This is a flowchart illustrating a Cornerstone3D-based method for converting ROI data in medical image segmentation according to one embodiment of the present invention. Detailed Implementation

[0047] It should be noted that, unless otherwise specified, the embodiments and features described in the present invention can be combined with each other. The present invention will now be described in detail with reference to the accompanying drawings and embodiments.

[0048] Firstly, such as Figure 1 As shown, the present invention proposes a method for medical image segmentation ROI data conversion based on Cornerstone3D, comprising:

[0049] Acquire target medical imaging data and its ROI data;

[0050] The target ROI data is identified and parsed in multiple formats to obtain a standardized array of ROI objects;

[0051] The target medical image data is loaded using Cornerstone3D's image loading method to obtain a Cornerstone3D segmented volume object of the target medical image data.

[0052] Based on the segmented volume objects in Cornerstone3D, coordinate system transformation and voxel filling are performed on the ROI object array to obtain Labelmap data that Cornerstone3D can render.

[0053] This invention can directly convert data from the ROI format output by 3D Slicer to the Labelmap format of Cornerstone3D, enabling the AI ​​segmentation algorithm in 3D Slicer to be seamlessly applied to the WEB imaging system based on Cornerstone3D, reducing development costs. Moreover, through coordinate system transformation and voxel filling, it ensures that the converted segmented data is completely consistent with the original ROI in spatial location, meeting the accuracy requirements of clinical applications.

[0054] In this embodiment, the standardized ROI object array includes key parameters for each ROI object, including center point coordinates, three-dimensional dimensions, and spatial orientation matrix.

[0055] It is important to understand that the spatial orientation matrix describes the orientation of the segmentation and labeling results.

[0056] During the file format type identification process, the target ROI data can be in the following file formats: 3D Slicer Markups standard format, simple array format, single ROI object format, etc.

[0057] During the process of obtaining the Cornerstone3D segmentation volume object, the target medical image data is loaded using Cornerstone3D's image loading method. If the Cornerstone3D segmentation volume object corresponding to the target medical image data already exists, its data is cleared first, and then a new Cornerstone3D segmentation volume object is created for the target medical image data through the volume loader, and its voxel manager object is obtained for subsequent operations. If it does not exist, a new Cornerstone3D segmentation volume object is created directly for the target medical image data through the volume loader.

[0058] In this embodiment, the Cornerstone3D segmentation volume object inherits all spatial parameters of the target medical image data, including three-dimensional dimensions, voxel spacing, voxel index coordinates, spatial origin coordinates, and orientation matrix, ensuring that the segmentation data is completely aligned with the original image in space.

[0059] It is important to understand that the spatial origin coordinates are the coordinates of the first voxel in the upper left corner of the image in physical space, while the orientation matrix describes the orientation of the target medical image data itself.

[0060] In this embodiment, based on Cornerstone 3D segmentation of volume objects, coordinate system transformation and voxel filling are performed on the ROI object array to obtain Labelmap data, specifically including:

[0061] For each ROI object in the array of ROI objects, construct a spatial transformation matrix based on the spatial direction matrix and the direction matrix, and calculate the inverse spatial transformation matrix; perform coordinate system transformation on each voxel in the ROI object based on the inverse spatial transformation matrix;

[0062] Based on the center point coordinates and 3D dimensions of the ROI object, calculate the minimum bounding box of the ROI object in the image space; for each voxel within the minimum bounding box, based on the coordinates of the voxel after coordinate system transformation, determine whether the voxel is within the predefined range of the ROI object; if so, determine that the voxel is within the predefined range of the ROI object, and fill the voxel value with the preset segmentation label index; if not, skip the voxel.

[0063] After traversing all voxels within the minimum bounding box of all ROI objects, the Labelmap data is obtained.

[0064] It's important to understand that medical imaging involves multiple coordinate systems (image coordinate system, patient coordinate system, device coordinate system), and ensuring accurate coordinate transformations under various conditions is the biggest challenge. This is especially true when dealing with ROIs with arbitrary rotation angles, requiring the correct application of orientation matrices and inverse transformations.

[0065] For each ROI object in the array of ROI objects, a spatial transformation matrix needs to be constructed from the voxel index space to the ROI local coordinate space. This transformation process consists of three stages: the first stage is to construct a first transformation matrix based on the coordinates of the origin, the voxel spacing, and the orientation matrix to transform the voxel index coordinates to world coordinates; the second stage is to construct a second transformation matrix based on the center point coordinates and the spatial orientation matrix to transform the world coordinates to the ROI local coordinates; and the third stage is to construct the spatial transformation matrix based on the first and second transformation matrices.

[0066] In the first stage, spatial parameters are first obtained from the Cornerstone3D segmented volume object, including the coordinates of the spatial origin, the voxel spacing, and the orientation matrix; among them, the orientation matrix is ​​a 3×3 rotation matrix that describes the directional relationship of the voxel coordinate axes relative to the world coordinate axes.

[0067] Then, each column of the direction matrix is ​​multiplied by the corresponding voxel spacing to obtain the scaled direction vector. This vector is then combined with the coordinates of the origin to construct a 4×4 first transformation matrix M1. The first three columns of this matrix M1 are the scaled direction vectors, the fourth column is the origin coordinates, and the last row is [0, 0, 0, 1]. This matrix can be used to convert voxel indices (i,j, k) into world coordinates (x, y, z) in the world coordinate system.

[0068] In the second stage, the center point coordinates and spatial orientation matrix are extracted from the ROI object. The spatial orientation matrix of the ROI is also a 3×3 matrix, which defines the orientation of the ROI local coordinate axes in the world coordinate system. The inverse of this spatial orientation matrix is ​​calculated and used to rotate the vectors in the world coordinate system to the ROI local coordinate system. A translation matrix is ​​constructed to move the origin of the coordinate system to the negative direction of the center point of the ROI object. The inverse orientation matrix is ​​multiplied by the translation matrix to obtain the second transformation matrix M2 from the world coordinates to the ROI local coordinates.

[0069] In the third stage, M2 is multiplied by M1 to obtain the spatial transformation matrix; where M = M2 × M1. This matrix can complete the transformation from voxel indices to ROI local coordinates in one step. The inverse matrix M of the spatial transformation matrix M is... -1 , used for inverse transformation.

[0070] In practical applications, for each voxel coordinate (i, j, k) in the volume, it is represented as homogeneous coordinates [i, j, k, 1]. T Multiplying this by the spatial transformation matrix M yields the local coordinates of the ROI: [u, v, w, 1]. T Determine if |u| ≤ size_x / 2, |v| ≤ size_y / 2, and |w| ≤ size_z / 2 are all true simultaneously. If they are true, the voxel is located inside the ROI object and is marked as the target segmentation index value; otherwise, skip the voxel.

[0071] This matrix transformation-based method can accurately process ROI and volume data in any direction without assuming axis alignment conditions, thus supporting ROI transformation in complex scenarios such as oblique scanning and image reconstruction.

[0072] This embodiment ensures that the transformed segmented data is completely consistent with the original ROI in spatial location through precise coordinate transformation and voxel filling algorithm, meeting the accuracy requirements of clinical applications.

[0073] In a further embodiment, a coordinate system transformation is performed on each voxel in the ROI object based on the inverse space transformation matrix, specifically including:

[0074] For each voxel in the ROI object, convert the voxel's index coordinates (i, j, k) to world coordinates (x, y, z) in physical space;

[0075] Translate the voxel's world coordinates to a world coordinate system with the center of the ROI object as the origin to obtain the voxel's relative center coordinates (△x, △y, △z);

[0076] The relative center coordinates of the voxel are transformed into the local coordinate system of the ROI object through the inverse space transformation matrix to obtain the ROI local coordinates (Ix, Iy, Iz) of the voxel.

[0077] Wherein, world coordinates are worldCoord = origin + index × spacing;

[0078] In the formula, worldCoord is the world coordinate, origin is the coordinate of the spatial origin, index is the index coordinate, and spacing is the voxel spacing.

[0079] The relative center coordinates are localCoord1 = worldCoord - ROl.center;

[0080] In the formula, localCoord1 is the relative center coordinate (△x, △y, △z), worldCoord is the world coordinate, and ROl.center is the center point coordinate of the ROI object.

[0081] Wherein, the local coordinates of the ROI are localCoord2 = inverse(orientationMatrix) × localCoord1;

[0082] In the formula, localCoord2 represents the local coordinates of the ROI, and inverse(orientationMatrix) represents the inverse spatial transformation matrix.

[0083] Specifically, based on the coordinates of the voxel after coordinate system transformation, it is determined whether each voxel is within the predefined range of the ROI object, including:

[0084] Based on the voxel's local ROI coordinates (Ix, Iy, Iz), determine whether the voxel is within the predefined range of the ROI object;

[0085] If the local coordinates (Ix, Iy, Iz) of the ROI of the voxel meet the preset conditions, then the voxel is determined to be within the predefined range of the ROI object; otherwise, the voxel is determined to be outside the predefined range of the ROI object.

[0086] The preset conditions are [Ix] ≤ size.x / 2 and [Iy] ≤ size.y / 2 and [Iz] ≤ size.z / 2; where size.x, size.y, and size.z are the side lengths of the ROI object in the x, y, and z directions of the ROI local coordinate system, i.e., the three-dimensional dimensions; [Ix], [Iy], and [Iz] are the absolute values ​​of the coordinates of the voxel in the x, y, and z directions of the ROI local coordinate system, respectively.

[0087] It is important to understand that, in order to ensure a smooth response of the browser interface, this embodiment adopts a batch asynchronous processing mechanism throughout the traversal and filling process. After processing a certain number of voxels, the UI thread control is actively released, and the current processing progress is reported to the user interface through a progress callback function, allowing users to interrupt the operation at any time.

[0088] With this configuration, this embodiment can achieve efficient processing while ensuring accuracy, avoiding browser lag and improving the user experience of the browser environment.

[0089] In this embodiment, after obtaining the Labelmap data, the following steps are also included:

[0090] Register the segmentation objects in the Labelmap data to Cornerstone3D's global segmentation state manager, configure their representation type as Labelmap, and associate them with the corresponding volume data identifier; then add the segmentation representation to all relevant viewports, including axial, sagittal, and coronal views; finally, trigger a segmentation data modification event to notify the Cornerstone3D rendering engine to redraw all viewports so that the transformed segmentation results are immediately displayed on the user interface.

[0091] Secondly, the present invention proposes a medical image segmentation ROI data conversion system based on Cornerstone3D, comprising:

[0092] The acquisition module is used to acquire target medical image data and its ROI data;

[0093] The ROI data parsing module is used to identify and parse the ROI data of the target medical image data in multiple formats, and obtain a standardized array of ROI objects.

[0094] The processing module is used to load the target medical image data using Cornerstone3D's image loading method, obtain the Cornerstone3D segmented volume object of the target medical image data, and perform coordinate system transformation and voxel filling on the ROI object array based on the Cornerstone3D segmented volume object to obtain Labelmap data.

[0095] Specifically, the ROI data parsing module in this embodiment is responsible for parsing various formats of ROI data output by the 3D Slicer, converting them into a unified internal data structure. It supports Markups JSON format parsing (a standard format containing markups arrays), simple array format parsing (a direct array of ROI objects), single ROI object format parsing, custom ROI attribute format parsing, extraction of ROI center point, size, orientation matrix, color, name, and other attributes, data format validation, and error handling. The input to the ROI data parsing module is a JSON string or file content, and the output is a standardized array of SlicerROI objects.

[0096] The present invention proposes a Cornerstone3D-based medical image segmentation ROI data conversion system to implement the Cornerstone3D-based medical image segmentation ROI data conversion method described in any one of the first aspects.

[0097] In this embodiment, the processing module includes:

[0098] The coordinate transformation calculation unit is used to construct a spatial transformation matrix for each ROI object in the ROI object array based on the spatial direction matrix and the direction matrix, and to calculate the inverse spatial transformation matrix of the spatial transformation matrix; and to perform coordinate system transformation on each voxel in the ROI object based on the inverse spatial transformation matrix.

[0099] The spatial determination unit is used to calculate the minimum bounding box of the ROI object in the image space based on the center point coordinates and three-dimensional dimensions of the ROI object; for each voxel within the minimum bounding box, it determines whether the voxel is within the predefined range of the ROI object based on the coordinates of the voxel after coordinate system transformation.

[0100] The Labelmap filling unit is used to fill the voxel value with a preset segmentation label index when the voxel is determined to be within the predefined range of the ROI object; after traversing all voxels within the minimum bounding box range of all ROI objects, the Labelmap data is obtained.

[0101] Specifically, the coordinate transformation calculation unit is used to perform conversion calculations between different coordinate systems. The coordinate transformation calculation unit has functions such as constructing a 4×4 homogeneous transformation matrix (extending the 3×3 direction matrix into a 4×4 matrix), calculating the inverse matrix of the direction matrix, converting from world coordinates to local coordinates, converting from voxel index to world coordinates, and calculating the physical space coordinates of voxels based on the image origin, spacing, and dimensions.

[0102] The input to the coordinate transformation calculation unit is the key parameters of the ROI object (including the center point coordinates and spatial orientation matrix), the spatial origin coordinates, the index coordinates of the voxels, the voxel spacing, and the orientation matrix in the Cornerstone3D segmented volume object, and the output is the coordinate values ​​of the voxels after transformation.

[0103] Specifically, the spatial judgment unit in this embodiment is used to determine whether a point (voxel) in space is located inside the predefined region of the ROI object, that is, to perform cuboid boundary judgment in the local coordinate system, and supports ROI judgment with arbitrary rotation angles. The input of the spatial judgment unit is the transformed world coordinates of the voxel and the key parameters of the ROI object, and the output is a Boolean value (whether it is inside the ROI).

[0104] Specifically, the Labelmap fill unit is mainly used to convert ROI regions into Cornerstone3D's Labelmap data structure. The Labelmap fill unit obtains metadata (dimensions, spacing, origin) of the target segmentation volume, calculates the optimized minimum bounding box for traversal, reduces unnecessary judgments, batch processes voxel data to avoid UI blocking, performs asynchronous fill processing, supports progress callbacks, updates the VTK data array and image data, and triggers Cornerstone3D's data modification events.

[0105] The standardized ROI object array also includes the segmentation volume ID, segmentation index, and color. The input to the Labelmap filling unit is the ROI object, name, segmentation label index, and color, and the output is the filled Labelmap volume.

[0106] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.

Claims

1. A method for converting ROI data from medical image segmentation based on Cornerstone 3D, characterized in that, include: Acquire target medical imaging data and its ROI data; The ROI data is subjected to multi-format identification and parsing to obtain a standardized array of ROI objects. The array of ROI objects includes key parameters for each ROI object, including center point coordinates, three-dimensional dimensions, spatial orientation matrix, name, and color. The target medical image data is loaded using Cornerstone3D's image loading method to obtain a Cornerstone3D segmented volume object of the target medical image data. The Cornerstone3D segmented volume object includes the three-dimensional dimensions of the target medical image data, the spatial origin coordinates, the voxel index coordinates, the voxel spacing, and the orientation matrix. For each ROI object in the array of ROI objects, construct a spatial transformation matrix based on the spatial direction matrix and the direction matrix, and calculate the inverse spatial transformation matrix; perform coordinate system transformation on each voxel in the ROI object based on the inverse spatial transformation matrix; Based on the center point coordinates and 3D dimensions of the ROI object, calculate the minimum bounding box of the ROI object in the image space; for each voxel within the minimum bounding box, based on the coordinates of the voxel after coordinate system transformation, determine whether the voxel is within the predefined range of the ROI object; if yes, fill the voxel value of the voxel with the preset segmentation label index; if no, skip the voxel. After traversing all voxels within the minimum bounding box of all ROI objects, Labelmap data is obtained; the traversal and voxel filling process adopts a batch asynchronous processing mechanism.

2. The method for converting ROI data for medical image segmentation based on Cornerstone3D according to claim 1, characterized in that, The spatial transformation matrix is ​​constructed based on the spatial orientation matrix and the orientation matrix. Specifically, it includes: constructing a first transformation matrix based on the coordinates of the spatial origin, the voxel spacing, and the orientation matrix to transform the index coordinates of the voxels to world coordinates; constructing a second transformation matrix based on the coordinates of the center point and the spatial orientation matrix to transform the world coordinates to the local coordinates of the ROI; and multiplying the first transformation matrix and the second transformation matrix to obtain the spatial transformation matrix.

3. The method for converting ROI data for medical image segmentation based on Cornerstone3D according to claim 1, characterized in that, Based on the inverse space transformation matrix, coordinate system transformation is performed on each voxel in the ROI object, specifically including: For each voxel in the ROI object, convert the voxel's index coordinates (i, j, k) to world coordinates (x, y, z) in physical space; Translate the voxel's world coordinates to a world coordinate system with the center of the ROI object as the origin to obtain the voxel's relative center coordinates (△x, △y, △z); The relative center coordinates of the voxel are transformed into the local coordinate system of the ROI object through the inverse space transformation matrix to obtain the ROI local coordinates (Ix, Iy, Iz) of the voxel.

4. The method for converting ROI data for medical image segmentation based on Cornerstone3D according to claim 3, characterized in that, The world coordinates of each voxel are worldCoord = origin + index × spacing; In the formula, worldCoord is the world coordinate, origin is the spatial origin coordinate of the ROI object, index is the index coordinate of the voxel, and spacing is the voxel spacing. The relative center coordinates of each voxel are localCoord1 = worldCoord - ROl.center; In the formula, localCoord1 is the relative center coordinate, worldCoord is the world coordinate, and ROl.center is the center point coordinate of the ROI object; The ROI local coordinates of each voxel are localCoord2 = inverse(orientationMatrix) × localCoord1; In the formula, localCoord2 is the local coordinate of the ROI, and inverse(orientationMatrix) is the inverse spatial transformation matrix.

5. The method for converting ROI data for medical image segmentation based on Cornerstone3D according to claim 3, characterized in that, Based on the coordinates of the voxel after coordinate system transformation, determine whether each voxel is within the predefined range of the ROI object, specifically including: Based on the voxel's local ROI coordinates (Ix, Iy, Iz), determine whether the voxel is within the predefined range of the ROI object; If the local coordinates (Ix, Iy, Iz) of the ROI of the voxel meet the preset conditions, then the voxel is determined to be within the predefined range of the ROI object; otherwise, the voxel is determined to be outside the predefined range of the ROI object. The preset conditions are [Ix] ≤ size.x / 2 and [Iy] ≤ size.y / 2 and [Iz] ≤ size.z / 2; where size.x, size.y, and size.z are the side lengths of the ROI object in the x, y, and z directions of the ROI local coordinate system, i.e., the three-dimensional dimensions; [Ix], [Iy], and [Iz] are the absolute values ​​of the coordinates of the voxel in the x, y, and z directions of the ROI local coordinate system, respectively.

6. A medical image segmentation ROI data conversion system based on Cornerstone 3D, characterized in that, include: The acquisition module is used to acquire target medical image data and its ROI data; The ROI data parsing module is used to identify and parse the ROI data of the target medical image data in multiple formats to obtain a standardized array of ROI objects. The ROI object array includes the key parameters of each ROI object, including the center point coordinates, three-dimensional dimensions, and spatial orientation matrix. The processing module includes: Labelmap fill units are used to load target medical image data using Cornerstone3D's image loading method, resulting in a Cornerstone3D segmented volume object of the target medical image data. The Cornerstone3D segmented volume object includes the three-dimensional dimensions of the target medical image data, the spatial origin coordinates, the voxel index coordinates, the voxel spacing, and the orientation matrix. The coordinate transformation calculation unit is used to construct a spatial transformation matrix for each ROI object in the ROI object array based on the spatial direction matrix and the direction matrix, and to calculate the inverse spatial transformation matrix of the spatial transformation matrix; and to perform coordinate system transformation on each voxel in the ROI object based on the inverse spatial transformation matrix. The spatial determination unit is used to calculate the minimum bounding box of the ROI object in the image space based on the center point coordinates and three-dimensional dimensions of the ROI object; for each voxel within the minimum bounding box, it determines whether the voxel is within the predefined range of the ROI object based on the coordinates of the voxel after coordinate system transformation. The Labelmap filling unit is also used to fill the voxel value with a preset segmentation label index when it is determined that the voxel is within the predefined range of the ROI object; After traversing all voxels within the minimum bounding box of all ROI objects, Labelmap data is obtained; the traversal and voxel filling process adopts a batch asynchronous processing mechanism.

Citation Information

Patent Citations

  • Liver focus three-dimensional modeling method

    CN120318427A