GPU-based rapid reconstruction imaging method

文档序号:9185 发布日期:2021-09-17 浏览:47次 中文

1. A rapid reconstruction imaging method based on GPU is characterized by comprising the following steps,

s01, setting an initial preset image;

s02, performing preliminary reconstruction on the obtained image, and comparing the reconstructed image with a preset image to obtain an image difference area;

s03, distributing threads according to the difference degree, and carrying out secondary image reconstruction;

s04, carrying out iterative reconstruction on the reconstructed image to obtain an accurate image;

in the process of image reconstruction, setting x parallel GPUs for image reconstruction, setting a CPU for data judgment and thread distribution, and setting a storage module for data storage; each GPU is divided into a1 st GPU, a 2 nd GPU and an … th xGPU according to a setting sequence, wherein x is more than or equal to 2;

the storage module is provided with preset images, each GPU carries out primary reconstruction on the images and transmits the reconstructed images to the CPU, and the CPU adjusts the space size of the reconstructed images to enable the space size to be equal to the size of the preset images;

the CPU splits the reconstructed image and the preset image into equal spatial blocks, and compares the spatial blocks corresponding to each group of positions separately to obtain the difference information of the spatial blocks;

the CPU integrates the difference degree information of each space block, and performs thread and calculation force distribution according to the difference degree so as to perform image iterative reconstruction;

and for the difference degree of the single space block, a difference degree evaluation parameter is arranged in the CPU, and when the difference degree of the single space block reaches the standard, the CPU does not distribute calculation force to the single space block.

2. A GPU-based fast reconstruction imaging method as claimed in claim 1, wherein in step S01, a preset image Kz is set in the storage module;

in the step S02, each GPU performs preliminary reconstruction on the received data to be reconstructed, generates a preliminary image K1, and transmits the generated image to the CPU, the CPU compares the preliminary image K1 with a preset image Kz once, and the CPU obtains a length L1, a width L2, and a height L3 of the preset image Kz;

the CPU adjusts the size of the preliminary image K1 so that the preliminary image K1 has a length L1, a width L2, and a height L3.

3. The GPU-based fast reconstruction imaging method according to claim 2, characterized in that a three-dimensional rectangular coordinate system is arranged in the CPU, the CPU puts the preliminary image K1 into the three-dimensional rectangular coordinate system so that the length direction of the preliminary image K1 coincides with the X-axis direction of the coordinate system, the width direction coincides with the Y-axis direction of the coordinate system, and the height direction coincides with the Z-axis direction of the coordinate system;

the CPU divides the preliminary image K1, divides the image K1 into n1 blocks along the X axis, n2 blocks along the Y axis, n3 blocks along the Z axis,

the CPU puts the preset image Kz into a three-dimensional rectangular coordinate system according to the putting method of the primary image K1, and performs same segmentation on the preset image Kz;

the CPU sorts the thrown preliminary images K1 to generate a preliminary image K1 space block matrix A1, for A1{ a1b1c1,a2b1c1,a3b1c1,…an1b1c1,an1b2c1,an1b3c1,…an1bn2c1,an1bn2c2,an1bn2c3,… an1bn2cn3For any space block a }ibjckA space block located at the ith along the X-axis direction, the jth along the Y-axis direction, and the kth along the Z-axis direction is represented, i =1, 2, 3 … n1, j =1, 2, 3 … n2, k =1, 2, 3 … n 3;

the CPU sorts the launched preset images Kz to generate a preliminary image K1 space block matrix Az, and for Az { p }1q1r1,p2q1r1,p3q1r1,…pn1q1r1,pn1q2r1,pn1q3r1,…pn1qn2r1,pn1qn2r2,pn1qn2r3,… pn1qn2rn3For an arbitrary space block piqjrkA space block located at ith in the X-axis direction, jth in the Y-axis direction, and kth in the Z-axis direction is shown.

4. A GPU-based fast reconstruction imaging method as claimed in claim 3, wherein said CPU selects the space block a from space block matrix a11b1c1Projecting it to obtain space block a1b1c1Projection Bx1 along X-axis direction, projection By1 along Y-axis direction, and projection Bz1 along Z-axis direction, and the CPU selects space block p from space block matrix Az1q1r1Projecting it to obtain space block p1q1r1Projection Cx1 along the X-axis, Cy1 along the Y-axis, and Cz1 along the Z-axis;

for the projection Bx1, the CPU acquires the position of the starting point and the position of the ending point of the image, wherein the starting point is positioned on the Y-Z plane, and the image is connected to generate a line segment Ex1;

for the projection By1, the CPU acquires the position of the starting point and the position of the ending point of the image starting point on the X-Z plane, and connects the starting point and the ending point to generate a line segment Ey1;

for the projection Bz1, the CPU acquires the position of the starting point and the position of the ending point of the image starting point on an X-Y plane, and connects the starting point and the ending point to generate a line segment Ez1;

for the projection Cx1, the CPU acquires the position of the starting point and the position of the ending point of the image, wherein the starting point is positioned on the Y-Z plane, and the image is connected to generate a line segment Cx1;

for the projection Cy1, the CPU acquires the position of the image starting point at the starting point and the position of the image ending point on the X-Z plane, and connects the image starting point and the image ending point to generate a line segment Cy1;

for the projection Cz1, the CPU obtains the position of the image starting point at the starting point and the position of the image ending point on the X-Y plane, and connects the positions to generate a line segment Cz 1.

5. A GPU-based fast reconstruction imaging method as claimed in claim 4, characterized in that the CPU compares the line segment Ex1 with the line segment Cx1, the CPU has a contrast function f (d, e) inside it, when d = Ex1, e = Cx1, there is a contrast function f (d, e)

Wherein the angle theta x1 of the line segment Ex1 and the line segment Cx1 in a Y-Z plane is represented by the angle of the line segment Ex1 and the line segment Cx1, the horizontal distance alpha x1 of the line segment Ex1 and the line segment Cx1 in the Y-Z plane is represented by the angle/phi 1 and the angle Cx1, the vertical distance beta x1 of the line segment Ex1 and the line segment Cx1 in the Y-Z plane is represented by the angle of the line segment Ex1 and the line segment Cx1, and the length difference gamma x1 of the line segment Ex1 and the line segment Cx1 in the Y-Z plane is represented by the angle of the angle (Ex 1 and the angle of the line segment Cx 1);

the CPU calculates the difference Px1, Px1= theta x1 × R1+ alpha x1 × R2+ beta x1 × R3+ gamma x1 × R4 between the space block a1b1c1 and the space block p1q1R1 in a Y-Z plane, wherein R1 is a weight parameter calculated by theta x1 for the difference Px1, R2 is a weight parameter calculated by alpha x1 for the difference Px1, R3 is a weight parameter calculated by beta x1 for the difference Px1, and R4 is a weight parameter calculated by gamma x1 for the difference Px 1.

6. GPU-based rapid reconstruction as recited in claim 5Image method, characterized in that said CPU calculates a space block a as described above1b1c1And space block p1q1r1The space block a is calculated by means of the difference Px1 in the Y-Z plane1b1c1And space block p1q1r1The degree of difference Py1 in the X-Z plane and the space block a1b1c1And space block p1q1r1The degree of difference Pz1 in the X-Y plane.

7. A GPU-based fast reconstruction imaging method as claimed in claim 6, characterized in that the CPU computes the spatial block a1b1c1And space block p1q1r1Q111, Q111= Px1 × s1+ Py1 × s2+ Pz1 × s3, wherein s1 is an evaluation parameter of Px1 to the overall difference Q111, s2 is an evaluation parameter of Py1 to the overall difference Q111, and s3 is an evaluation parameter of Pz1 to the overall difference Q111.

8. A GPU-based fast reconstruction imaging method according to claim 7, characterized in that a first difference evaluation parameter Qz1 is set in the CPU, the CPU compares the overall difference Q111 with the evaluation parameter Qz1,

when Q111 ≧ Qz1, the CPU determines space block a1b1c1And space block p1q1r1Too large difference, enlarging the space block a during the secondary reconstruction1b1c1The computing thread of (2);

when Q111 < Qz1, the CPU determines that the spatial block a1b1c1 and the spatial block p1Q1r1 are too different, and does not reconstruct the spatial block a1b1c1 at the time of secondary reconstruction.

9. A GPU-based fast reconstruction imaging method as claimed in claim 8, wherein said CPU computes the spatial block a as described above1b1c1And space block p1q1r1The overall difference Q111 method calculates the difference of other space blocks and generates a difference matrixQ0,Q0(Q111,Q211,Q311,…Qn1n2n3);

The CPU sorts the matrix Q0 from large to small, counts the quantity N required to be reconstructed in the matrix Q0, selects the data of the first 30% N in the matrix Q0, and equally divides the calculation power of 60% of the total number of GPU threads to carry out secondary reconstruction.

10. A GPU-based fast reconstruction imaging method according to claim 9, characterized in that the CPU compares the number N of required reconstructions with the total number Nz of generated global degree of difference, Nz = N1 x N2 x N3,

when N is less than or equal to 0.2Nz, the CPU judges that the evaluation is qualified under the first difference evaluation parameter Qz 1;

when N is greater than 0.2Nz, the CPU judges that the judgment is unqualified under the first difference degree evaluation parameter Qz 1;

when the CPU judges that the image is unqualified under the first difference evaluation parameter Qz1, the CPU controls the GPU to carry out iterative reconstruction on the image until N is less than or equal to 0.2 Nz;

when the CPU judges that the judgment is qualified under the first difference evaluation parameter Qz1, the CPU compares the overall difference of each space block with a second difference evaluation parameter Qz2, and repeats the iterative reconstruction operation until N is less than or equal to 0.2Nz under the condition of the second difference evaluation parameter Qz2, and the CPU judges that the image reconstruction is finished, wherein Qz1 is more than Qz 2.

Background

As one of ten technologies affecting the development of human beings in the twenty-first century, the computed tomography technology is an imaging technology for reversely obtaining the density distribution of an object by using projection information obtained by penetrating the object with X-rays at various angles. The main theory of the technology is mathematics and nuclear physics, and a plurality of subjects such as an automatic control technology, a computer technology, a detector technology and the like are integrated on the basis of the mathematics and the nuclear physics, and the technology is widely applied to various important fields such as biological research, medical diagnosis, public safety, industrial detection, national defense construction and the like, and is particularly applied to clinical diagnosis as an optimal means for acquiring internal structure information of a human body. However, in the current image reconstruction technology, the complexity of an image reconstruction algorithm is high, the reconstruction time is long, and the requirement of real-time reconstruction cannot be met.

Disclosure of Invention

Therefore, the invention provides a rapid reconstruction imaging method based on a GPU (graphics processing unit), which is used for solving the problem of long reconstruction time caused by high complexity of an image reconstruction algorithm in the prior art.

To achieve the above object, the present invention provides a GPU-based fast reconstruction imaging method, comprising,

s01, setting an initial preset image;

s02, performing preliminary reconstruction on the obtained image, and comparing the reconstructed image with a preset image to obtain an image difference area;

s03, distributing threads according to the difference degree, and carrying out secondary image reconstruction;

s04, carrying out iterative reconstruction on the reconstructed image to obtain an accurate image;

in the process of image reconstruction, setting x parallel GPUs for image reconstruction, setting a CPU for data judgment and thread distribution, and setting a storage module for data storage; each GPU is divided into a1 st GPU, a 2 nd GPU and an … th xGPU according to a setting sequence, wherein x is more than or equal to 2;

the storage module is provided with preset images, each GPU carries out primary reconstruction on the images and transmits the reconstructed images to the CPU, and the CPU adjusts the space size of the reconstructed images to enable the space size to be equal to the size of the preset images;

the CPU splits the reconstructed image and the preset image into equal spatial blocks, and compares the spatial blocks corresponding to each group of positions separately to obtain the difference information of the spatial blocks;

the CPU integrates the difference degree information of each space block, and performs thread and calculation force distribution according to the difference degree so as to perform image iterative reconstruction;

and for the difference degree of the single space block, a difference degree evaluation parameter is arranged in the CPU, and when the difference degree of the single space block reaches the standard, the CPU does not distribute calculation force to the single space block.

Further, in the step S01, a preset image Kz is set in the storage module;

in the step S02, each GPU performs preliminary reconstruction on the received data to be reconstructed, generates a preliminary image K1, and transmits the generated image to the CPU, the CPU compares the preliminary image K1 with a preset image Kz once, and the CPU obtains a length L1, a width L2, and a height L3 of the preset image Kz;

the CPU adjusts the size of the preliminary image K1 so that the preliminary image K1 has a length L1, a width L2, and a height L3.

Further, a three-dimensional rectangular coordinate system is arranged in the CPU, the CPU puts the preliminary image K1 into the three-dimensional rectangular coordinate system, so that the length direction of the preliminary image K1 coincides with the X-axis direction of the coordinate system, the width direction coincides with the Y-axis direction of the coordinate system, and the height direction coincides with the Z-axis direction of the coordinate system;

the CPU divides the preliminary image K1, divides the image K1 into n1 blocks along the X axis, n2 blocks along the Y axis, n3 blocks along the Z axis,

the CPU puts the preset image Kz into a three-dimensional rectangular coordinate system according to the putting method of the primary image K1, and performs same segmentation on the preset image Kz;

the CPU sorts the thrown preliminary images K1 to generate a preliminary image K1 space block matrix A1, for A1{ a1b1c1,a2b1c1,a3b1c1,…an1b1c1,an1b2c1,an1b3c1,…an1bn2c1,an1bn2c2,an1bn2c3,… an1bn2cn3For any space block a }ibjckA space block located at the ith along the X-axis direction, the jth along the Y-axis direction, and the kth along the Z-axis direction is represented, i =1, 2, 3 … n1, j =1, 2, 3 … n2, k =1, 2, 3 … n 3;

the CPU sorts the launched preset images Kz to generate a preliminary image K1 space block matrix Az, and for Az { p }1q1r1,p2q1r1,p3q1r1,…pn1q1r1,pn1q2r1,pn1q3r1,…pn1qn2r1,pn1qn2r2,pn1qn2r3,… pn1qn2rn3For an arbitrary space block piqjrkA space block located at ith in the X-axis direction, jth in the Y-axis direction, and kth in the Z-axis direction is shown.

Further, the CPU selects a space block a from a space block matrix A11b1c1Projecting it to obtain space block a1b1c1Projection Bx1 along X-axis direction, projection By1 along Y-axis direction, and projection Bz1 along Z-axis direction, and the CPU selects space block p from space block matrix Az1q1r1Projecting it to obtain space block p1q1r1Projection Cx1 along the X-axis, Cy1 along the Y-axis, and Cz1 along the Z-axis;

for the projection Bx1, the CPU acquires the position of the starting point and the position of the ending point of the image, wherein the starting point is positioned on the Y-Z plane, and the image is connected to generate a line segment Ex1;

for the projection By1, the CPU acquires the position of the starting point and the position of the ending point of the image starting point on the X-Z plane, and connects the starting point and the ending point to generate a line segment Ey1;

for the projection Bz1, the CPU acquires the position of the starting point and the position of the ending point of the image starting point on an X-Y plane, and connects the starting point and the ending point to generate a line segment Ez1;

for the projection Cx1, the CPU acquires the position of the starting point and the position of the ending point of the image, wherein the starting point is positioned on the Y-Z plane, and the image is connected to generate a line segment Cx1;

for the projection Cy1, the CPU acquires the position of the image starting point at the starting point and the position of the image ending point on the X-Z plane, and connects the image starting point and the image ending point to generate a line segment Cy1;

for the projection Cz1, the CPU obtains the position of the image starting point at the starting point and the position of the image ending point on the X-Y plane, and connects the positions to generate a line segment Cz 1.

Further, the CPU compares the line segment Ex1 with the line segment Cx1, and a comparison function f (d, e) is provided in the CPU, and when d = Ex1 and e = Cx1, there is

Wherein the angle theta x1 of the line segment Ex1 and the line segment Cx1 in a Y-Z plane is represented by the angle of the line segment Ex1 and the line segment Cx1, the horizontal distance alpha x1 of the line segment Ex1 and the line segment Cx1 in the Y-Z plane is represented by the angle/phi 1 and the angle Cx1, the vertical distance beta x1 of the line segment Ex1 and the line segment Cx1 in the Y-Z plane is represented by the angle of the line segment Ex1 and the line segment Cx1, and the length difference gamma x1 of the line segment Ex1 and the line segment Cx1 in the Y-Z plane is represented by the angle of the angle (Ex 1 and the angle of the line segment Cx 1);

the CPU calculates the space block a1b1c1And space block p1q1r1The difference in the Y-Z plane Px1, Px1= θ x1 × R1+ α x1 × R2+ β x1 × R3+ γ x1 × R4, where R1 is a weight parameter calculated by θ x1 for the difference Px1, R2 is a weight parameter calculated by α x1 for the difference Px1, R3 is a weight parameter calculated by β x1 for the difference Px1, and R4 is a weight parameter calculated by γ x1 for the difference Px 1.

Further, the CPU calculates the space block a as described above1b1c1And space block p1q1r1The space block a is calculated by means of the difference Px1 in the Y-Z plane1b1c1And space block p1q1r1The degree of difference Py1 in the X-Z plane and the space block a1b1c1And space block p1q1r1The degree of difference Pz1 in the X-Y plane.

Further, the CPU calculates the space block a1b1c1And space block p1q1r1Q111, Q111= Px1 × s1+ Py1 × s2+ Pz1 × s3, wherein s1 is Px1 versus Q111, s2 is Py1 evaluation parameter for the overall difference Q111, and s3 is Pz1 evaluation parameter for the overall difference Q111.

Furthermore, a first difference degree evaluation parameter Qz1 is arranged in the CPU, the CPU compares the overall difference degree Q111 with an evaluation parameter Qz1,

when Q111 ≧ Qz1, the CPU determines space block a1b1c1And space block p1q1r1Too large difference, enlarging the space block a during the secondary reconstruction1b1c1The computing thread of (2);

when Q111 < Qz1, the CPU determines the space block a1b1c1And space block p1q1r1Too small a difference, no alignment to the space block a in the second reconstruction1b1c1And (4) reconstructing.

Further, the CPU calculates the space block a as described above1b1c1And space block p1q1r1The overall difference Q111 method of (1) calculates the difference of each other spatial block and generates difference matrices Q0, Q0(Q111, Q211, Q311, … Qn1n2n 3);

the CPU sorts the matrix Q0 from large to small, counts the quantity N required to be reconstructed in the matrix Q0, selects the data of the first 30% N in the matrix Q0, and equally divides the calculation power of 60% of the total number of GPU threads to carry out secondary reconstruction.

Further, the CPU compares the number N of reconstructions required with the total number Nz of the generated overall difference degrees, Nz = N1 × N2 × N3,

when N is less than or equal to 0.2Nz, the CPU judges that the evaluation is qualified under the first difference evaluation parameter Qz 1;

when N is greater than 0.2Nz, the CPU judges that the judgment is unqualified under the first difference degree evaluation parameter Qz 1;

when the CPU judges that the image is unqualified under the first difference evaluation parameter Qz1, the CPU controls the GPU to carry out iterative reconstruction on the image until N is less than or equal to 0.2 Nz;

when the CPU judges that the judgment is qualified under the first difference evaluation parameter Qz1, the CPU compares the overall difference of each space block with a second difference evaluation parameter Qz2, and repeats the iterative reconstruction operation until N is less than or equal to 0.2Nz under the condition of the second difference evaluation parameter Qz2, and the CPU judges that the image reconstruction is finished, wherein Qz1 is more than Qz 2.

Compared with the prior art, the method has the advantages that the storage module is provided with the preset images, each GPU carries out primary reconstruction on the images and transmits the reconstructed images to the CPU, and the CPU adjusts the space size of the reconstructed images to be equal to the size of the preset images; the CPU splits the reconstructed image and the preset image into equal spatial blocks, and compares the spatial blocks corresponding to each group of positions separately to obtain the difference information of the spatial blocks; the CPU integrates the difference degree information of each space block, and performs thread and calculation force distribution according to the difference degree so as to perform image iterative reconstruction; the preset images are set for comparison, so that the judging speed of the images is increased, and the reconstruction speed is increased.

Particularly, the CPU divides the preliminary image K1, divides the image K1 into n1 blocks along the X axis, divides the image K1 into n2 blocks along the Y axis, divides the image K1 into n3 blocks along the Z axis, splits the generated images, carries out regional comparison and accurate comparison, and further accelerates the improvement of reconstruction speed.

Further, the CPU calculates the space block a1b1c1And space block p1q1r1The difference in the Y-Z plane Px1, Px1= θ x1 × R1+ α x1 × R2+ β x1 × R3+ γ x1 × R4, wherein R1 is a weight parameter calculated by θ x1 for the difference Px1, R2 is a weight parameter calculated by α x1 for the difference Px1, R3 is a weight parameter calculated by β x1 for the difference Px1, and R4 is a weight parameter calculated by γ x1 for the difference Px 1; the difference degree of the plane is calculated through the space projection of a single space block, so that the calculation precision of the difference degree is improved, and the image reconstruction time is reduced;

further, the CPU calculates the space block a in the above-described manner1b1c1And space block p1q1r1The space block a is calculated by means of the difference Px1 in the Y-Z plane1b1c1And space withBlock p1q1r1The degree of difference Py1 in the X-Z plane and the space block a1b1c1And space block p1q1r1A degree of difference Pz1 in the X-Y plane; the CPU calculates the space block a1b1c1And space block p1q1r1Q111, Q111= Px1 × s1+ Py1 × s2+ Pz1 × s3, wherein s1 is an evaluation parameter of Px1 to the overall difference Q111, s2 is an evaluation parameter of Py1 to the overall difference Q111, and s3 is an evaluation parameter of Pz1 to the overall difference Q111. Different weight parameters are given to different planes, so that the calculation accuracy of the difference is improved, and the image reconstruction time is reduced.

Furthermore, a first difference evaluation parameter Qz1 is arranged in the CPU, the CPU compares the overall difference Q111 with an evaluation parameter Qz1, and when Q111 is more than or equal to Qz1, the CPU judges the space block a1b1c1And space block p1q1r1Too large difference, enlarging the space block a during the secondary reconstruction1b1c1The computing thread of (2); when Q111 < Qz1, the CPU determines the space block a1b1c1And space block p1q1r1Too small a difference, no alignment to the space block a in the second reconstruction1b1c1Rebuilding; when the difference of a single space block is too small, iterative reconstruction is not carried out on the single space block, the calculation force during iteration is reduced, and larger calculation force is provided for the space block with large difference, so that the image reconstruction time is reduced.

Particularly, the CPU sorts the matrix Q0 from large to small, counts the quantity N required to be reconstructed in the matrix Q0, selects the data of the first 30% N in the matrix Q0, and equally divides the calculation power of 60% of the total number of GPU threads to carry out secondary reconstruction. And performing the gravity calculation force distribution on the data to be reconstructed, thereby reducing the image reconstruction time.

Furthermore, when the CPU judges that the judgment is qualified under the first difference evaluation parameter Qz1, the CPU compares the overall difference of each space block with the second difference evaluation parameter Qz2, and repeats the iterative reconstruction operation until N is less than or equal to 0.2Nz under the condition of the second difference evaluation parameter Qz2, the CPU judges that the image reconstruction is finished, and Qz1 is more than Qz 2. And when the difference degrees of most of the space blocks reach the standard, reducing the numerical value of the evaluation parameter and improving the reconstruction capability.

Drawings

Fig. 1 is a flowchart of a GPU-based fast reconstruction imaging method according to the present invention.

Detailed Description

In order that the objects and advantages of the invention will be more clearly understood, the invention is further described below with reference to examples; it should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

Preferred embodiments of the present invention are described below with reference to the accompanying drawings. It should be understood by those skilled in the art that these embodiments are only for explaining the technical principle of the present invention, and do not limit the scope of the present invention.

It should be noted that in the description of the present invention, the terms of direction or positional relationship indicated by the terms "upper", "lower", "left", "right", "inner", "outer", etc. are based on the directions or positional relationships shown in the drawings, which are only for convenience of description, and do not indicate or imply that the device or element must have a specific orientation, be constructed in a specific orientation, and be operated, and thus, should not be construed as limiting the present invention.

Furthermore, it should be noted that, in the description of the present invention, unless otherwise explicitly specified or limited, the terms "mounted," "connected," and "connected" are to be construed broadly, and may be, for example, fixedly connected, detachably connected, or integrally connected; can be mechanically or electrically connected; they may be connected directly or indirectly through intervening media, or they may be interconnected between two elements. The specific meanings of the above terms in the present invention can be understood by those skilled in the art according to specific situations.

Fig. 1 is a flowchart illustrating a GPU-based fast reconstruction imaging method according to the present invention.

The invention discloses a rapid reconstruction imaging method based on a GPU, which comprises the following steps,

s01, setting an initial preset image;

s02, performing preliminary reconstruction on the obtained image, and comparing the reconstructed image with a preset image to obtain an image difference area;

s03, distributing threads according to the difference degree, and carrying out secondary image reconstruction;

s04, carrying out iterative reconstruction on the reconstructed image to obtain an accurate image;

in the process of image reconstruction, setting x parallel GPUs for image reconstruction, setting a CPU for data judgment and thread distribution, and setting a storage module for data storage; each GPU is divided into a1 st GPU, a 2 nd GPU and an … th xGPU according to a setting sequence, wherein x is more than or equal to 2;

the preset images are set for comparison, so that the judging speed of the images is increased, and the reconstruction speed is increased.

In the step S01, setting a preset image Kz in the storage module;

in the step S02, each GPU performs preliminary reconstruction on the received data to be reconstructed, generates a preliminary image K1, and transmits the generated image to the CPU, the CPU compares the preliminary image K1 with a preset image Kz once, and the CPU obtains a length L1, a width L2, and a height L3 of the preset image Kz;

the CPU adjusts the size of the preliminary image K1 so that the length of the preliminary image K1 is L1, the width of the preliminary image K2 is L2, and the height of the preliminary image K3 is L3;

a three-dimensional rectangular coordinate system is arranged in the CPU, the CPU puts the preliminary image K1 into the three-dimensional rectangular coordinate system to enable the length direction of the preliminary image K1 to coincide with the X-axis direction of the coordinate system, the width direction to coincide with the Y-axis direction of the coordinate system, and the height direction to coincide with the Z-axis direction of the coordinate system;

the CPU divides the preliminary image K1, divides the image K1 into n1 blocks along the X axis, n2 blocks along the Y axis, and n3 blocks along the Z axis.

And splitting the generated image, performing regional comparison and accurate comparison, and further accelerating the reconstruction speed.

Specifically, the CPU puts the preset image Kz into a three-dimensional rectangular coordinate system according to the putting method of the preliminary image K1, and performs the same segmentation on the preset image Kz;

the CPU sorts the thrown preliminary images K1 to generate a preliminary image K1 space block matrix A1, for A1{ a1b1c1,a2b1c1,a3b1c1,…an1b1c1,an1b2c1,an1b3c1,…an1bn2c1,an1bn2c2,an1bn2c3,… an1bn2cn3For any space block a }ibjckA space block located at the ith along the X-axis direction, the jth along the Y-axis direction, and the kth along the Z-axis direction is represented, i =1, 2, 3 … n1, j =1, 2, 3 … n2, k =1, 2, 3 … n 3;

the CPU sorts the launched preset images Kz to generate a preliminary image K1 space block matrix Az, and for Az { p }1q1r1,p2q1r1,p3q1r1,…pn1q1r1,pn1q2r1,pn1q3r1,…pn1qn2r1,pn1qn2r2,pn1qn2r3,… pn1qn2rn3For an arbitrary space block piqjrkA space block located at ith in the X-axis direction, jth in the Y-axis direction, and kth in the Z-axis direction is shown.

Specifically, the CPU selects a space block a from a space block matrix a11b1c1Projecting it to obtain space block a1b1c1Projection Bx1 along X-axis direction, projection By1 along Y-axis direction, and projection Bz1 along Z-axis direction, and the CPU selects space block p from space block matrix Az1q1r1Projecting it to obtain space block p1q1r1Projection Cx1 along the X-axis, Cy1 along the Y-axis, and Cz1 along the Z-axis;

for the projection Bx1, the CPU acquires the position of the starting point and the position of the ending point of the image, wherein the starting point is positioned on the Y-Z plane, and the image is connected to generate a line segment Ex1;

for the projection By1, the CPU acquires the position of the starting point and the position of the ending point of the image starting point on the X-Z plane, and connects the starting point and the ending point to generate a line segment Ey1;

for the projection Bz1, the CPU acquires the position of the starting point and the position of the ending point of the image starting point on an X-Y plane, and connects the starting point and the ending point to generate a line segment Ez1;

for the projection Cx1, the CPU acquires the position of the starting point and the position of the ending point of the image, wherein the starting point is positioned on the Y-Z plane, and the image is connected to generate a line segment Cx1;

for the projection Cy1, the CPU acquires the position of the image starting point at the starting point and the position of the image ending point on the X-Z plane, and connects the image starting point and the image ending point to generate a line segment Cy1;

for the projection Cz1, the CPU acquires the position of the starting point and the position of the ending point of the image, wherein the starting point is positioned on an X-Y plane, and the image is connected to generate a line segment Cz1;

the CPU compares the line segment Ex1 with the line segment Cx1, and a comparison function f (d, e) is arranged in the CPU, and when d = Ex1 and e = Cx1, the comparison function f (d, e) is used for comparing the line segment Ex1 with the line segment Cx1

Wherein the angle theta x1 of the line segment Ex1 and the line segment Cx1 in a Y-Z plane is represented by the angle of the line segment Ex1 and the line segment Cx1, the horizontal distance alpha x1 of the line segment Ex1 and the line segment Cx1 in the Y-Z plane is represented by the angle/phi 1 and the angle Cx1, the vertical distance beta x1 of the line segment Ex1 and the line segment Cx1 in the Y-Z plane is represented by the angle of the line segment Ex1 and the line segment Cx1, and the length difference gamma x1 of the line segment Ex1 and the line segment Cx1 in the Y-Z plane is represented by the angle of the angle (Ex 1 and the angle of the line segment Cx 1);

specifically, the CPU calculates the space block a1b1c1And space block p1q1r1The difference Px1 in the Y-Z plane is Px1= theta x1 × R1+ alpha x1 × R2+ beta x1 × R3+ gamma x1 × R4, wherein R1 is a weight parameter calculated by theta x1 for the difference Px1R2 is a weight parameter calculated by α x1 for the difference Px1, R3 is a weight parameter calculated by β x1 for the difference Px1, and R4 is a weight parameter calculated by γ x1 for the difference Px 1;

the difference degree of the plane is calculated through the space projection of a single space block, so that the calculation precision of the difference degree is improved, and the image reconstruction time is reduced;

specifically, the CPU calculates the space block a as described above1b1c1And space block p1q1r1The space block a is calculated by means of the difference Px1 in the Y-Z plane1b1c1And space block p1q1r1The degree of difference Py1 in the X-Z plane and the space block a1b1c1And space block p1q1r1A degree of difference Pz1 in the X-Y plane;

the CPU calculates the space block a1b1c1And space block p1q1r1Q111, Q111= Px1 × s1+ Py1 × s2+ Pz1 × s3, wherein s1 is an evaluation parameter of Px1 to the overall difference Q111, s2 is an evaluation parameter of Py1 to the overall difference Q111, and s3 is an evaluation parameter of Pz1 to the overall difference Q111.

Different weight parameters are given to different planes, so that the calculation accuracy of the difference is improved, and the image reconstruction time is reduced.

The CPU is internally provided with a first difference evaluation parameter Qz1, the CPU compares the overall difference Q111 with an evaluation parameter Qz1,

when Q111 ≧ Qz1, the CPU determines space block a1b1c1And space block p1q1r1Too large difference, enlarging the space block a during the secondary reconstruction1b1c1The computing thread of (2);

when Q111 < Qz1, the CPU determines the space block a1b1c1And space block p1q1r1Too small a difference, no alignment to the space block a in the second reconstruction1b1c1Rebuilding;

when the difference of a single space block is too small, iterative reconstruction is not carried out on the single space block, the calculation force during iteration is reduced, and larger calculation force is provided for the space block with large difference, so that the image reconstruction time is reduced;

specifically, the CPU calculates the space block a as described above1b1c1And space block p1q1r1The overall difference Q111 method of (1) calculates the difference of each other spatial block and generates difference matrices Q0, Q0(Q111, Q211, Q311, … Qn1n2n 3);

the CPU sorts the matrix Q0 from large to small, counts the quantity N required to be reconstructed in the matrix Q0, selects the data of the first 30% N in the matrix Q0, and equally divides the calculation power of 60% of the total number of GPU threads to carry out secondary reconstruction.

And performing the gravity calculation force distribution on the data to be reconstructed, thereby reducing the image reconstruction time.

Specifically, the CPU compares the number N of reconstructions required with the total number Nz of the generated overall difference degrees, Nz = N1 × N2 × N3,

when N is less than or equal to 0.2Nz, the CPU judges that the evaluation is qualified under the first difference evaluation parameter Qz 1;

when N is greater than 0.2Nz, the CPU judges that the judgment is unqualified under the first difference degree evaluation parameter Qz 1;

specifically, when the CPU judges that the image is unqualified under the first difference evaluation parameter Qz1, the CPU controls the GPU to carry out iterative reconstruction on the image until N is less than or equal to 0.2 Nz;

when the CPU judges that the judgment is qualified under the first difference evaluation parameter Qz1, the CPU compares the overall difference of each space block with the second difference evaluation parameter Qz2, and repeats the iterative reconstruction operation until N is less than or equal to 0.2Nz under the condition of the second difference evaluation parameter Qz2, the CPU judges that the image reconstruction is finished, and Qz1 is more than Qz 2.

And when the difference degrees of most of the space blocks reach the standard, reducing the numerical value of the evaluation parameter and improving the reconstruction capability.

So far, the technical solutions of the present invention have been described in connection with the preferred embodiments shown in the drawings, but it is easily understood by those skilled in the art that the scope of the present invention is obviously not limited to these specific embodiments. Equivalent changes or substitutions of related technical features can be made by those skilled in the art without departing from the principle of the invention, and the technical scheme after the changes or substitutions can fall into the protection scope of the invention.

The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention; various modifications and alterations to this invention will become apparent to those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

完整详细技术资料下载
上一篇:石墨接头机器人自动装卡簧、装栓机
下一篇:一种基于十六元数极谐-傅里叶矩的彩色图像描述方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!