A method for fusion cutting of cultural relics CT images and 3D shells based on VTK

By using a VTK-based method to register and fuse the two-dimensional CT image with the three-dimensional shell model, and perform virtual slicing and cutting, the problem of insufficient fusion in the existing technology is solved, and a three-dimensional visualization system for cultural relics is realized, which supports multi-view slice observation and precise positioning.

CN116523927BActive Publication Date: 2025-09-19BEIJING INST OF TECH +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310418472.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-19
Publication Date
2025-09-19
Estimated Expiration
2043-04-19

AI Technical Summary

Technical Problem

The existing CT data is not sufficient to meet the completeness and comprehensiveness of cultural relic research, and it is impossible to accurately fuse two-dimensional CT images with three-dimensional shell models, which makes it difficult to study structural details and color appearance.

Method used

A VTK-based method is used to register and fuse the two-dimensional CT image with the three-dimensional shell model in the same coordinate space, and the three-dimensional shell is cut through virtual slicing technology. Combined with volume rendering reconstruction and virtual slicing processing, the spatial relationship between the CT image and the shell is displayed in real time.

Benefits of technology

A three-dimensional visualization system for cultural relics has been realized, which supports slice observation from multiple perspectives and arbitrary directions. It can accurately display the structure, density and texture of cultural relics and provide intuitive overall display and positioning functions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116523927B_ABST
    Figure CN116523927B_ABST
Patent Text Reader

Abstract

This invention provides a VTK-based method for fusing and segmenting CT images of cultural relics with their 3D shells. This method achieves the fusion and segmentation of a cultural relic's 2D CT image and 3D shell. It includes real-time segmentation of the entire model (including the 3D color shell and CT volume rendering) at any angle and direction. The slices accurately display the CT images at corresponding locations, visually demonstrating the structure, density, and texture orientation of each part of the cultural relic. Furthermore, the system supports multi-view and slicing observations from any direction. Graphical interaction using a mouse and keyboard allows for scaling, translation, and rotation of the 3D image, as well as adjustment of grayscale parameters for slice sections.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the research field of multivariate data management and fusion display of cultural relics protection, and specifically belongs to a method for fusion cutting of cultural relics CT images and three-dimensional shells based on VTK. Background Art

[0002] Cultural relics are special, non-renewable, and non-shareable non-digital resources. Using information technology to reproduce and preserve cultural heritage not only allows for a global display of its vibrant cultural and artistic value through the integration of multimedia technology and system design methods, but also allows for the analysis of the internal shape, structure, and density of cultural relics, which plays a vital role in their production process, composition analysis, and dating.

[0003] Computed tomography (CT) technology, as a medical diagnostic tool, offers non-destructive testing advantages that effectively meet the need for exploring the internal structures of cultural relics. Its primary objectives are to accurately determine the relative positions of various tissue structures within a cultural relic, measure the structural dimensions of the object under examination, and perform density analysis. Furthermore, accurate 3D model data forms the foundation for subsequent digitization applications.

[0004] However, CT data alone is insufficient for complete and comprehensive cultural relic research. Unearthed cultural relics often face complex damage issues, including corrosion, deformation from compression, fragmentation, and incompleteness, as well as the possibility of large amounts of soil filling and compaction. Structural details cannot be discerned from CT grayscale images, necessitating a study that incorporates the artifact's color and appearance. Furthermore, the exterior surfaces of many artifacts, such as enamel, blue-and-white porcelain, and bronzes, possess a variety of colors and patterns. Their vibrant colors and appearance are essential for cultural relic research, making the fusion of 3D outer shells and 2D CT images essential.

[0005] Currently, 2D CT images are derived from sequential datasets obtained through computed tomography scans, while colored 3D shell models can be extracted through 3D laser scanning or photographic modeling. However, these two data sources and types differ, and they can be displayed in different windows. Therefore, it is necessary to first align and fuse the 2D CT image of the artifact with the 3D color shell model to accurately restore the artifact's appearance. Based on this, the entire artifact can be sliced ​​and observed from any angle, directly displaying the CT image of that location on the cut surface of the 3D shell. This facilitates displaying the spatial relationship between the two and achieves precise positioning. Summary of the Invention

[0006] In view of this, the purpose of the present invention is to provide a method for fusing and cutting CT images of cultural relics with three-dimensional shells based on VTK. After the two-dimensional CT image and the three-dimensional shell are placed in the same coordinate space for fusion and registration, unified virtual slice cutting and observation can be performed to complete the display of the whole, part and cross-section of the cultural relics at any angle.

[0007] A method for fusing and cutting two-dimensional cultural relic CT images and three-dimensional shells based on VTK, comprising the following steps:

[0008] Step S1, data acquisition: Scan the cultural relic using computed tomography technology to obtain CT sequence image data; then scan and measure the cultural relic to obtain a three-dimensional shell model;

[0009] Step S2, reading data: using the built-in class of Visualization Toolkit to read the cultural relic CT sequence image data and the three-dimensional shell data obtained in step S1 respectively;

[0010] Step S3, volume rendering reconstruction: using VTK to perform volume rendering on the CT sequence images read in step S2, and then obtain a three-dimensional solid model;

[0011] Step S4, registration and fusion: matching the 3D solid model obtained by volume rendering and reconstruction in step S3 with the 3D shell model read in step S1 in terms of size, position, and orientation, so as to fit the 3D shell onto the 3D solid model;

[0012] Step S5, virtual slicing: constructing a 3D cutting plane, performing cross-section slicing on the 3D solid model obtained by volume rendering, acquiring CT data on the slicing plane and outputting the data to the texture mapping pipeline to obtain a 2D CT map of the cross section;

[0013] Step S6, cutting the shell: use the vtkClipPolyData() class to define a clipper, send the 3D shell model to the clipper, set the cutting plane vtkPlane of the cutter, set the clipped model data as clippedData, put it into clipMapper and pass it to a clipActor;

[0014] Step S7: Setting a callback function to associate the shell cutting plane with the CT two-dimensional map in real time.

[0015] Preferably, the step S4 specifically includes the following steps:

[0016] (1) One of the three-dimensional solid model obtained by volume rendering reconstruction in step S3 and the three-dimensional shell model read in step S1 is used as the source point cloud, and the other is used as the target point cloud; a source point set P = {P i,i=0,1,2,…,k}, sample the target point cloud to obtain the target point set Q={Q i ,i=0,1,2,…,n}, k≥n;

[0017] (2) For each point in the target point set Q, find the corresponding point closest to the point in the source point set P, and update the point set P with these corresponding points to obtain {P i ,i=0,1,2,…,n};

[0018] (3) According to the coordinate information of the source point set P and the target point set Q, calculate the centroid of the two point sets respectively;

[0019] (4) Calculate the rotation matrix R and translation vector T between the two centers of gravity;

[0020] (5) According to the calculated rotation matrix R and translation vector T obtained in (4), a rigid transformation is performed on the midpoints of the source point set P. After the transformation, a new point set is obtained, which is defined as P′, where the elements are:

[0021] P i ′=R×P+T

[0022] (6) Calculate the error function E(E, T) from all points in the new point set P′ and the target point set Q; where the error function E(R, T) is defined as the sum of the points Q in the point set P′ and its corresponding target point set Q. i The square of the distance difference between them;

[0023] (7) Whether the iteration ends is determined based on the error function E(R, T) or the number of iterations. If the requirements are met, the iteration ends, the last calculated rotation matrix R and translation vector T are output, and the source point cloud is transformed to achieve registration. If the requirements are not met, the source point set P is updated with the point set P′, and the process returns to step (3) to continue the next registration.

[0024] Preferably, in step S4, the volume rendering reconstruction model stored in the vtkImageData data format in step S3 is first converted into mesh data vtkPolyData type using vtkDiscreteMarchingCubes;

[0025] Use the SetSource() and SetTarget() functions in the vtkIterativeClosestPointTransform class to set the source point set and target point set;

[0026] The SetMaximumNumberOfIterations() function is used to set the number of iterations; the StartByMatchingCentroidsOn() function is used to calculate the center of gravity; and the rotation matrix R and the translation vector T are obtained through the GetMatrix() function.

[0027] Preferably, in step S4, manual registration is performed, including:

[0028] S401: Place vtkPolyData into the Actor, drag the Actor to the correct position, obtain the displacement of the Actor, and then apply it to the vtkPolyData to obtain the displaced vtkPolyData data;

[0029] S402: Using vtkTransformPolyDataFilter to move, rotate, and translate the 3D shell model of the vtkPolyData data type, so as to manually align it with the volume rendering model obtained in step S3;

[0030] S403: Use vtkTransform.Scale to set the scaling size;

[0031] S404: Use vtkTransform.Rotate to set the rotation angles in the x, y, and z directions;

[0032] S405: Use vtkTransform.Translate to set the forward and backward movement distances of the spatial coordinates x, y, and z.

[0033] Preferably, in step S2, the cultural relic is measured by three-dimensional laser scanning or camera photography to obtain the three-dimensional coordinates, reflectivity, and color data information of the surface of the measured object, and a 1:1 three-dimensional shell model is reconstructed.

[0034] Preferably, in step S2, vtkDICOMImageReaderv is used to read CT sequence image data in Dicom format, vtkPNGReader is used to read two-dimensional CT slice data in PNG format, and SetDirectoryName is set to read sequence slices.

[0035] Preferably, in step S2, vtkOBJReader is used to read the three-dimensional shell data in obj format, vtkTexture is set to read the shell color image, and the SetTexture method of vtkActor geometric data rendering is used for mapping to obtain a three-dimensional color shell.

[0036] Preferably, in step S3, the volume rendering reconstruction is implemented by using a ray casting algorithm, a shearing-deformation algorithm, a frequency domain volume rendering algorithm or a snowballing algorithm.

[0037] Preferably, in step S5, the virtual slicing method includes: obtaining a CT two-dimensional map of the cross section of the volume rendering model through a 3D interactive component vtkImagePlaneWidget.

[0038] Preferably, the step S6 includes:

[0039] Step S601: define a clipper using the vtkClipPolyData() class and transmit the 3D shell data to the clipper;

[0040] Step S602: Use vtkPlane to construct a cutting tool;

[0041] Step S603: Set an implicit function through vtkClipPolyData, GetClippedOutputPort is used to obtain the data portion left by clipping;

[0042] Step S604: Set the clipped model data as clippedData and put it into clipMapper and pass it to a clipActor;

[0043] The step S7 specifically includes:

[0044] Set the interactor vtkImagePlaneWidget in the callback function. Whenever the widget's spatial position is changed, the function is triggered to set the vtkplane position and normal vector of the shell cutting plane to the same state as the plane of the section map in step S5. At the same time, the clipped model after cutting is passed to clipedMapper to refresh the clipped model in real time.

[0045] The present invention has the following beneficial effects:

[0046] This invention provides a VTK-based method for fusing and segmenting CT images of cultural relics with their 3D shells. This method achieves the fusion and segmentation of a cultural relic's 2D CT image and 3D shell. It includes real-time segmentation of the entire model (including the 3D color shell and CT volume rendering) at any angle and direction. The slices accurately display the CT images at corresponding locations, visually demonstrating the structure, density, and texture orientation of each part of the cultural relic. Furthermore, the system supports multi-view and slicing observations from any direction. Graphical interaction using a mouse and keyboard allows for scaling, translation, and rotation of the 3D image, as well as adjustment of grayscale parameters for slice sections. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] Figure 1 This is a flowchart of the fusion registration of two-dimensional CT images and three-dimensional color shell models based on VTK in an embodiment of the present invention;

[0048] Figure 2 This is a pipeline flow chart of geometric data rendering and volume rendering using VTK in an embodiment of the present invention;

[0049] Figure 3 The volume rendering model and the three-dimensional color shell in the same space when no registration is performed in the embodiment of the present invention;

[0050] Figure 4 The volume rendering model and the three-dimensional color shell in the same space after registration according to the embodiment of the present invention;

[0051] Figure 5 is the vtkImagePlaneWidget style used in the embodiment of the present invention;

[0052] Figure 6 It is a cross-sectional image display of volume data obtained from the registered and fused model without shell cutting;

[0053] Figure 7 This is a diagram showing the effect of applying the method proposed in the present invention. DETAILED DESCRIPTION

[0054] The present invention is described in detail below with reference to the accompanying drawings and embodiments.

[0055] Explanation of terms

[0056] VTK: Visualization Toolkit (VTK) is an open source, cross-platform, parallel processing graphics application library used for 3D computer graphics, image processing, and visualization.

[0057] Among them, VTKImageReslice, vtkDiscreteMarchingCubes, vtkClipPolyData and vtkplane are all available class names.

[0058] The vtkImageReslice class can slice a planar image from a point in volume data along different directions; vtkImageReslice is the Swiss Army knife of image geometry filters: it can rotate, flip, scale, resample, deform, and fill image data with reasonable efficiency.

[0059] VTK's rendering pipeline consists of two parts: the visualization pipeline and the rendering engine. The visualization pipeline is responsible for reading and generating data, and the rendering engine renders the obtained data into objects in the window.

[0060] The rendering engine includes vtkActor, vtkRender, and vtkRenderWindow.

[0061] vtkImageActor inherits from vtkActor and is used to display images;

[0062] vtkRenderWindow is responsible for managing the window creation and rendering process. vtkRenderWindow contains the vtkRender collection, rendering parameters, etc.

[0063] vtkRender is responsible for managing the rendering process of the scene. The objects that make up the scene, including vtkActor, camera (VTKCamera), and lighting (vtkLight), are all integrated into a vtkRender object. There can be multiple vtkRender objects in a vtkRenderwindow.

[0064] Example 1

[0065] As a preferred embodiment of the present invention, Figure 1 As shown, this embodiment provides a method for fusing and cutting a two-dimensional cultural relic CT image and a three-dimensional color shell based on VTK, the method comprising the following steps:

[0066] Step S1: Data acquisition. The cultural relic is scanned using computed tomography (CT) technology to obtain a CT image. High-speed laser scanning and measurement are then performed using technologies such as 3D laser scanning. The 3D coordinates, reflectivity, color, and other data of the measured object's surface are quickly acquired over a large area and at high resolution, and a 1:1 3D shell model is reconstructed.

[0067] The three-dimensional laser scanning to obtain the shell model is only one of the methods. In addition, there are other methods such as camera photography and three-dimensional modeling.

[0068] Step S2: Read data. The CT image sequence data and 3D shell data obtained in step S1 are read using the built-in classes of the Visualization Toolkit (VTK).

[0069] The CT sequence images are usually stored in Dicom format of vtkImageData data type (or in Nifti format, PNG format, etc.), the three-dimensional shell is usually stored in obj format of vtkpolydata data type, and the color information is stored in material library file mtl and color file bmp.

[0070] Step S3: Volume rendering reconstruction. VTK is used to perform volume rendering on the CT sequence images. All volume data is processed through methods such as raycasting to obtain a 3D solid model, which clearly expresses the relationship between the internal information of the image and the 3D model.

[0071] Step S4: Registration and fusion. The 3D solid model reconstructed by volume rendering in step S3 is completely matched with the 3D color shell read in step 1 in terms of size, position, and orientation. The 3D color shell is precisely placed on the 3D solid model, and the two are combined into one.

[0072] Step S5: Virtual Slicing. A 3D cutting plane is constructed and used to slice the 3D model generated by volume rendering. The slicing plane acquires CT data and outputs the data to the texture mapping pipeline to obtain a CT map of the section. The position and orientation of the cutting plane can be controlled by dragging the plane or rotating its border.

[0073] Step S6: Cut the shell. Use the vtkClipPolyData() class to define a clipper, feed the 3D color shell (polydata) to the clipper, set the cutting plane vtkPlane for the clipper, set the clipped model data as clippedData, put it into clipMapper, and pass it to a clipActor.

[0074] Step S7: Set a callback function to associate the shell cutting plane with the CT 2D map in real time. Whenever the virtual slice spatial position in step S5 is changed, the function is triggered to set the position and normal vector of the shell cutting plane to the same state as the plane of the virtual slice cross-section map. At the same time, the cut model is transferred and refreshed in real time.

[0075] Example 2

[0076] As a preferred embodiment of the present invention, this embodiment provides an automatic registration implementation for step S4 in the above embodiment 1, and the steps are as follows:

[0077] S401: In order to achieve fusion registration of 2D CT and 3D shell, the volume rendering reconstruction model stored in the vtkImageData data format in step S3 needs to be converted into mesh data vtkPolyData type using vtkDiscreteMarchingCubes.

[0078] S402: Automatic registration is performed using the Iterative Closest Points (ICP) algorithm. In Vtk, the vtkIterativeClosestPointTransform class can be called. The ICP algorithm is an iterative process. In each iteration, the closest point in the target point set Q is found for a source data point P. The transformation matrices R and T are then solved using the least squares principle. The point set registration is completed by continuous iteration until convergence.

[0079] Among them, the SetSource() and SetTarget() functions in the vtkIterativeClosestPointTransform class are used to set the source point set and the target point set.

[0080] The SetMaximumNumberOfIterations() function is used to set the number of iterations of the ICP algorithm, and the StartByMatchingCentroidsOn() function is used to calculate the centroids of the two point sets before setting the registration, and translate the source point set so that the centroids of the two coincide.

[0081] After configuration, you can use the GetMatrix() function to get the corresponding transformation matrix.

[0082] Furthermore, in step S402, an iterative closest point algorithm (ICP) is used to perform data registration.

[0083] The core of the ICP algorithm is to continuously iterate and perform rotation and translation through point-to-point registration. Its measurement standard is based on the least squares method, and the distance between points must be within a certain threshold range. The principle of the point cloud registration process is as follows: suppose there are two point clouds P and Q to be registered. Select any point in the point cloud P and denote it as p. i , find a point with the shortest Euclidean distance from the point cloud Q (you can use kdtree for proximity search), recorded as q i .p i and q i For the corresponding points, the transformation matrix is ​​obtained. After multiple iterations, the most ideal transformation matrix is ​​finally obtained to make the two point clouds coincide.

[0084] At this point, you also need to set a condition to stop the iteration. The formula is as follows:

[0085]

[0086] Here, R represents the rotation transformation matrix, T represents the translation transformation matrix, and min is the minimum threshold set. With the iterative conditions, the optimal transformation matrix can be obtained to make the two point clouds coincide.

[0087] The following are the steps of the ICP algorithm registration process:

[0088] (1) One of the 3D solid model reconstructed by volume rendering in step S3 and the 3D shell model read in step S1 is used as the source point cloud P, and the other is used as the target point cloud Q; a point set P = {P i , i=0,1,2,…,k}, sample the target point cloud Q to obtain the point set Q={Q i ,i=0,1,2,…,n}, then there is no one-to-one correspondence between the elements of Q and P, and the number of elements is also different, so let k≥n.

[0089] (2) Calculate the nearest point, that is, for each point in the set Q, find the corresponding point closest to the point in the set P, and update the point set P with these corresponding points to obtain {P i , i=0,1,2,…,n}, satisfying that the Euclidean distance between each corresponding point is the smallest, and finally two new point sets are obtained, that is, points without corresponding points and erroneous points are removed.

[0090] (3) According to the coordinate information of the source point set P and the target point set, calculate the centroid of the two point sets respectively.

[0091] (4) After obtaining the center of gravity, calculate the rotation matrix R and translation vector T between the two centers of gravity;

[0092] (5) According to the calculated rotation matrix R and translation vector T obtained in (4), a rigid transformation is performed on the midpoints of the source point set P. After the transformation, a new point set is obtained, which is defined as P′, where the elements are:

[0093] P i ′=R×P+T

[0094] (6) Calculate the error function E(R, T) from all the points in the new point set P′ and the target point set Q. Specifically, the error function E(R, T) is defined as the sum of the points Q in the point set P′ and its corresponding target point set Q. i The square of the distance difference between:

[0095]

[0096] (7) Determine whether the iteration is complete based on the error function E(R, T) obtained from the above formula. If the pre-set threshold or number of iterations is reached, the iteration is complete; otherwise, the source point set P is updated with the point set P′ and the process returns to step (3). For example, if E(R, T) is greater than the pre-set threshold τ or the pre-set number of iterations k is not reached, the process returns to step (3) and recalculates the centroid of the point set until the condition is met; if E(R, T) is less than the pre-set threshold τ or the pre-set number of iterations k is met, the algorithm is determined to have converged and the iteration is terminated.

[0097] Example 3

[0098] As a preferred embodiment of the present invention, this embodiment provides a manual registration implementation for step S4 in the above embodiment 1. The operation steps are as follows:

[0099] S401: Place vtkPolyData into the Actor, drag the Actor to the correct position, obtain the displacement of the Actor, and then apply it to the vtkPolyData to obtain the displaced vtkPolyData data;

[0100] S402: Using vtkTransformPolyDataFilter to move, rotate, and translate the 3D shell model of the vtkPolyData data type, so as to manually align it with the volume rendering model obtained in step S3;

[0101] S403: Use vtkTransform.Scale to set the scaling size;

[0102] S404: Use vtkTransform.Rotate to set the rotation angles in the x, y, and z directions;

[0103] S405: Use vtkTransform.Translate to set the forward and backward movement distances of the spatial coordinates x, y, and z.

[0104] Example 4

[0105] As a preferred embodiment of the present invention, Figure 1 As shown, this embodiment provides a specific implementation method of a method for fusing and cutting two-dimensional cultural relic CT images and three-dimensional color shells based on VTK, including the following steps:

[0106] Step S1: Data Acquisition. Computed tomography (CT) is used to scan the artifact to obtain a series of CT images, which are then reconstructed using 3D laser scanning to create a 1:1 3D color shell model.

[0107] Step S2: Read data. The artifact CT sequence image data and 3D color shell data obtained in step S1 are read using the built-in classes of the Visualization Toolkit (VTK).

[0108] Step S201: Use vtkDICOMImageReaderv to read the two-dimensional CT slice data in Dicom format, use vtkPNGReader to read the two-dimensional CT slice data in PNG format, and set SetDirectoryName to read the serial slices.

[0109] Step S202: Use vtkOBJReader to read the three-dimensional shell in obj format, set vtkTexture to read the shell color image (with mtl information), and use the SetTexture method of vtkActor geometric data rendering to map and obtain the three-dimensional color shell.

[0110] Step S3: Volume rendering reconstruction. Taking the Dicom format as an example, CT sequence images are volume rendered using VTK. The vtkFixedPointVolumeRayCastMapper ray projection method is used to render the CT sequence images, and the transparency and color are adjusted to obtain a 3D solid model.

[0111] like Figure 2 As shown, the left side is the method of rendering geometric data (3D color shell), and the right side is the method of rendering volume data.

[0112] Step S301: Available volume rendering algorithms include: ray-casting, shear-warp, frequency domain, and splatting.

[0113] Step S4: Registration and fusion: Convert the volume rendering model into mesh data of vtkPolyData type and register it with the obj format shell of the same polydata data.

[0114] Step S401: The volume rendering reconstruction model stored in the vtkImageData data format in step S3 is subjected to isosurface extraction using the vtkDiscreteMarchingCubes algorithm to generate a mesh model, i.e., the vtkpolydata data format.

[0115] Furthermore, the isosurface is processed by processing all voxels one by one, comparing the values ​​at each vertex of the voxel with a given threshold, first finding the voxels that intersect with the isosurface, then finding the intersection of the isosurface and the edges of the voxels by interpolation, and connecting each intersection into triangles to form an isosurface patch. The set of triangles in all voxels constitutes the isosurface.

[0116] Step S402: Use the Iterative Closest Points (ICP) algorithm to perform data registration.

[0117] The best matching point set in the ICP iteration is calculated using a vtkLandmarkTransform pointer defined within vtkIterativeClosestPointTransform. This is obtained using the GetLandmarkTransform() function, and the corresponding transformation type is set using the vtkLandmarkTransform pointer.

[0118] The SetMaximumNumberOfIterations() function is used to set the number of iterations of the ICP algorithm, and the StartByMatchingCentroidsOn() function is used to calculate the centroids of the two point sets before setting the registration, and translate the source point set so that the centroids of the two coincide.

[0119] Get the corresponding transformation matrix through the GetMatrix() function.

[0120] like Figure 3 The figure shows the volume rendering model and the 3D color shell in the same space without registration. The left side shows the 3D color shell model, and the right side shows the volume rendering model. The two have different positions, orientations, and tilt angles.

[0121] like Figure 4 The figure shows the volume rendering model and the 3D color shell in the same space after registration. The volume rendering model is completely placed in the shell, and the position, orientation, and tilt angle of the two are exactly the same.

[0122] Step S5: Virtual Slice: Obtain the CT map of the cross section of the volume rendering model through the 3D interactive component vtkImagePlaneWidget.

[0123] Step S501: Set the 3D interactive component VTKImagePlaneWidget to re-cut image data.

[0124] Step S502: As an interactive component, the interactor must be set by calling the SetInteractor() function before use. The renderer can also be set by calling SetCurrentRenderer(). By default, the renderer will be obtained from the set interactor.

[0125] Step S503: The core function of this component is provided by the vtkImageReslice class. The data obtained from this class is output to the texture mapping pipeline to obtain the texture map of its section.

[0126] like Figure 5 The vtkImagePlaneWidget style is shown. You can control the position of the plane by dragging the center of the plane, or control the direction of the cutting plane by rotating the plane border (where the numbers 1234 are located in the figure).

[0127] like Figure 6 The figure shows the effect of adding virtual slices to the fusion model without shell cutting. The CT images at any cross-section can be viewed.

[0128] Step S6: Cutting the outer shell: Based on the volume data slices obtained in any direction in S5, the outer shell is cut at the same time, and the overall slice data is directly observed on the cut surface.

[0129] Step S601: define a clipper using the vtkClipPolyData() class and deliver the three-dimensional color shell (polydata data) to the clipper.

[0130] Step S602: Construct a cutting tool using vtkPlane. Any subclass of vtkImplicitFunction in the vtkClipPolyData() class takes scalar data as input and clips polygon data. Clipping means it actually "cuts" the cells of the dataset, returning everything within the specified implicit function (or greater than the scalar value), including the "fragment" of the cell. Subclasses that inherit from the vtkImplicitFunction class can be used as implicit functions, such as vtkPlane used in this example.

[0131] Step S603: Set an implicit function through vtkClipPolyData, GetClippedOutputPort to obtain the data portion left after clipping.

[0132] Step S604: Set the clipped model data as clippedData, put it into clipMapper and pass it to a clipActor.

[0133] Step S7: Set a callback function to associate the volume data slice with the shell cutting plane.

[0134] Step S701: Get the normal vector and coordinates of the widget through GetNormal and GetOrigin.

[0135] Step S702: Assign the normal vector and coordinates of the widget to the cutting plane through SetNormal and SetOrigin.

[0136] Step S703: Whenever the volume data slice widget is changed, the callback function is triggered.

[0137] Step S704: The vtkClipPolyData filter is updated in real time, and the clipped model is assigned to the clippedMapper.

[0138] like Figure 7 The figure shows the method of fusing and cutting the cultural relic CT image and the three-dimensional texture shell proposed by the present invention. The cutting can be performed in any direction and angle, and the section is a display effect diagram of the volume data section.

[0139] The present invention provides a VTK-based method for fusing and cutting CT images of cultural relics with a 3D color shell. While there are numerous methods and approaches for implementing this technical solution, the above-described preferred embodiments of the present invention are merely exemplary. It should be noted that those skilled in the art may make various improvements and modifications without departing from the principles of the present invention, and such improvements and modifications are also within the scope of protection of the present invention. Any components not specified in this embodiment may be implemented using existing technologies.

Claims

1. A method for fusing and cutting two-dimensional cultural relic CT images and three-dimensional shells based on VTK, characterized in that: The following steps are involved: Step S1, data acquisition: Scan the cultural relic using computed tomography technology to obtain CT sequence image data; then scan and measure the cultural relic to obtain a three-dimensional shell model; Step S2, reading data: using the built-in class of Visualization Toolkit to read the cultural relic CT sequence image data and the three-dimensional shell data obtained in step S1 respectively; Step S3, volume rendering reconstruction: using VTK to perform volume rendering on the CT sequence images read in step S2, and then obtain a three-dimensional solid model; Step S4, registration and fusion: matching the 3D solid model obtained by volume rendering and reconstruction in step S3 with the 3D shell model read in step S1 in terms of size, position, and orientation, so as to fit the 3D shell onto the 3D solid model; Step S5, virtual slicing: constructing a 3D cutting plane, performing cross-sectional slicing on the 3D solid model obtained by volume rendering, acquiring CT data on the slicing plane and outputting the data to the texture mapping pipeline to obtain a 2D CT map of the cross section; Step S6, cutting the shell: use the vtkClipPolyData() class to define a clipper, send the 3D shell model to the clipper, set the cutting plane vtkPlane of the cutter, set the clipped model data as clippedData, put it into clipMapper and pass it to a clipActor; Step S7: Setting a callback function to associate the shell cutting plane with the CT two-dimensional map in real time.

2. The method for fusion cutting of two-dimensional cultural relic CT images and three-dimensional shells based on VTK as claimed in claim 1, characterized in that: The step S4 specifically includes the following steps: (1) One of the three-dimensional solid model reconstructed by volume rendering in step S3 and the three-dimensional shell model read in step S1 is used as the source point cloud, and the other is used as the target point cloud; Sampling from the source point cloud yields a source point set P = {P i ,i=0,1,2,…,k}, sample the target point cloud to obtain the target point set Q={Q i ,i=0,1,2,…,n}, k≥n; (2) For each point in the target point set Q, find the corresponding point closest to the point in the source point set P, and update the point set P with these corresponding points to obtain {P i ,i=0,1,2,…,n}; (3) According to the coordinate information of the source point set P and the target point set Q, calculate the centroid of the two point sets respectively; (4) Calculate the rotation matrix R and translation vector T between the two centers of gravity; (5) According to the calculated rotation matrix R and translation vector T obtained in (4), a rigid transformation is performed on the midpoints of the source point set P. After the transformation, a new point set is obtained, which is defined as P′, where the elements are: P i ′=R×P+T (6) Calculate the error function E(R, T) from all points in the new point set P′ and the target point set Q; where the error function E(R, T) is defined as the sum of the points Q in the point set P′ and its corresponding target point set Q. i The square of the distance difference between them; (7) Whether the iteration ends is determined based on the error function E(R, T) or the number of iterations. If the requirements are met, the iteration ends, the last calculated rotation matrix R and translation vector T are output, and the source point cloud is transformed to achieve registration. If the requirements are not met, the source point set P is updated with the point set P′, and the process returns to step (3) to continue the next registration.

3. The method for fusion cutting of two-dimensional cultural relic CT images and three-dimensional shells based on VTK as claimed in claim 2, characterized in that: In step S4, the volume rendering reconstruction model stored in the vtkImageData data format in step S3 is first converted into mesh data vtkPolyData type using vtkDiscreteMarchingCubes; Use the SetSource() and SetTarget() functions in the vtkIterativeClosestPointTransform class to set the source point set and target point set; The SetMaximumNumberOfIterations() function is used to set the number of iterations; the StartByMatchingCentroidsOn() function is used to calculate the center of gravity; and the rotation matrix R and the translation vector T are obtained through the GetMatrix() function.

4. The method for fusion cutting of two-dimensional cultural relic CT images and three-dimensional shells based on VTK as claimed in claim 1, characterized in that: In step S4, manual registration is performed, including: S401: Place vtkPolyData into the Actor, drag the Actor to the correct position, obtain the displacement of the Actor, and then apply it to the vtkPolyData to obtain the displaced vtkPolyData data; S402: Using vtkTransformPolyDataFilter to move, rotate, and translate the 3D shell model of the vtkPolyData data type, so as to manually align it with the volume rendering model obtained in step S3; S403: Use vtkTransform.Scale to set the scaling size; S404: Use vtkTransform.Rotate to set the rotation angles in the x, y, and z directions; S405: Use vtkTransform.Translate to set the forward and backward movement distances of the spatial coordinates x, y, and z.

5. The method for fusion cutting of two-dimensional cultural relic CT images and three-dimensional shells based on VTK according to claim 1 or 2, characterized in that: In step S2, the cultural relic is measured by three-dimensional laser scanning or camera photography to obtain the three-dimensional coordinates, reflectivity, and color data information of the surface of the measured object, and a 1:1 three-dimensional shell model is reconstructed.

6. The method for fusion cutting of two-dimensional cultural relic CT images and three-dimensional shells based on VTK as claimed in claim 1 or 2, characterized in that: In step S2, vtkDICOMImageReaderv is used to read CT sequence image data in Dicom format, vtkPNGReader is used to read two-dimensional CT slice data in PNG format, and SetDirectoryName is set to read sequence slices.

7. The method for fusion cutting of two-dimensional cultural relic CT images and three-dimensional shells based on VTK according to claim 1 or 2, characterized in that: In step S2, vtkOBJReader is used to read the three-dimensional shell data in obj format, vtkTexture is set to read the shell color image, and the SetTexture method of vtkActor geometric data rendering is used to perform mapping to obtain a three-dimensional color shell.

8. The method for fusing and cutting two-dimensional cultural relic CT images and three-dimensional shells based on VTK as claimed in claim 1 or 2, characterized in that: In step S3, the volume rendering reconstruction is implemented by using a ray casting algorithm, a shearing-deformation algorithm, a frequency domain volume rendering algorithm, or a snowballing algorithm.

9. The method for fusing and cutting two-dimensional cultural relic CT images and three-dimensional shells based on VTK as claimed in claim 1 or 2, characterized in that: In step S5, the virtual slicing method includes: obtaining a CT two-dimensional map of the cross section of the volume rendering model through the 3D interactive component vtkImagePlaneWidget.

10. The method for fusing and cutting two-dimensional cultural relic CT images and three-dimensional shells based on VTK according to claim 1 or 2, characterized in that: The step S6 comprises: Step S601: define a clipper using the vtkClipPolyData() class and transmit the 3D shell data to the clipper; Step S602: Use vtkPlane to construct a cutting tool; Step S603: Set an implicit function through vtkClipPolyData, GetClippedOutputPort is used to obtain the data portion left by clipping; Step S604: Set the clipped model data as clippedData and put it into clipMapper and pass it to a clipActor; The step S7 specifically includes: Set the interactor vtkImagePlaneWidget in the callback function. Whenever the widget's spatial position is changed, the function is triggered to set the vtkplane position and normal vector of the shell cutting plane to the same state as the plane of the section map in step S5. At the same time, the clipped model after cutting is passed to clipedMapper to refresh the clipped model in real time.

Citation Information

Patent Citations

  • Holographic augmented reality assisted human-machine interaction diagnosis and treatment system in surgical operation

    CN113256791A

  • Finite-element analysis augmented reality system and method

    WO2018156087A1