Summary of the invention
The technical problem to be solved in the present invention provides a kind of multi-sequence image method of location automatically, overcomes the defective that wastes time and energy when the prior art utilization is manually carried out synchronized positioning to multi-sequence image.
The present invention solves the problems of the technologies described above the technical scheme that is adopted to be:
A kind of multi-sequence image is the method for location automatically, comprises step:
A1, in unified coordinate system, set up the plane equation of each width of cloth image in each image sequence;
An impact point in A2, the selected a certain image sequence on certain width of cloth image is determined the point coordinate of described impact point;
A3, the described point coordinate of calculating arrive the distance value of all images of other image sequence;
A4, the described distance value in the same image sequence is sorted;
A5, determine each the ordering in the pairing target image of minimum value;
A6, the described point coordinate of calculating arrive the normal equation of each described target image;
A7, calculate the intersection point of the plane equation of each described normal equation and respective objects image;
The intersection point sequence that obtains promptly is to locate desired point automatically.
A kind of multi-sequence image is the method for location automatically, comprises step:
B1, in unified coordinate system, set up the plane equation of each width of cloth image in each image sequence;
B2, basis are obtained the spacing distance of each width of cloth image in each image sequence and are determined minimum threshold of distance;
An impact point in B3, the selected a certain image sequence on certain width of cloth image is determined the point coordinate of described impact point;
B4, calculate the distance value of described point coordinate successively to the image of other image sequence;
B5, described distance value and described minimum threshold of distance are compared, if described distance value is less than described minimum threshold of distance, then stop the distance value of the image of described point coordinate in the present image sequence is calculated, the image of determining described distance value correspondence is a target image;
B6, repeated execution of steps B4, B5 are up to the target image of determining all other image sequences;
B7, the described point coordinate of calculating arrive the normal equation of each described target image;
B8, calculate the intersection point of the plane equation of each described normal equation and respective objects image;
The intersection point sequence that obtains promptly is to locate desired point automatically.
Described multi-sequence image is the method for location automatically, and wherein said multi-sequence image is the digital picture of medical domain and the image of communication dicom standard.
Described multi-sequence image is the method for location automatically, wherein determines to set up the parameter of the plane equation of each width of cloth image in each image sequence according to the label TAG value in the view data of the digital picture of medical domain and communication dicom standard.
Described multi-sequence image is the method for location automatically, wherein takes out label TAG value in the view data of arbitrary selected digital image and determine relevant parameter from each image sequence:
Take out TAG (0018,5100) value, determine the direction of unified coordinate system;
Take out TAG (0020,0032) value, determine the D coordinates value of the first pixel of described selected digital image in described unified coordinate system;
Take out TAG (0020,0037) value, determine capable vector sum unit of the unit column vector of described selected digital image, the cross product of calculating capable vector sum unit of described unit column vector obtains the unit normal vector of described selected digital image;
Take out image TAG (0028,0030) value, determine the actual physics width and the actual physics height of the pixel of described selected digital image;
Take out TAG (0028,0010) value, determine the height of described selected digital image;
Take out TAG (0028,0011) value, determine the width of described selected digital image.
Described multi-sequence image is the method for location automatically, wherein determines the plane equation of described selected digital image in described unified coordinate system according to the D coordinates value and the described unit normal vector of described first pixel.
Described multi-sequence image is the method for location automatically, the screen two-dimensional coordinate of wherein establishing described impact point be P (x, y), according to formula
Calculate the side-play amount of described impact point in the plane, place, wherein Δ X is the side-play amount of described impact point along described unified coordinate system X-direction, and Δ Y is the side-play amount of described impact point along described unified coordinate system Y direction, s
1wBe the actual physics width of pixel, s
1hIt is the actual physics height of pixel.
Described multi-sequence image is the method for location automatically, wherein determines the three-dimensional coordinate of described impact point in described unified coordinate system according to side-play amount in the plane, place of the plane equation on plane, described impact point place, described impact point, capable vector sum unit of the unit column vector on plane, described impact point place.
Beneficial effect of the present invention is: the method for using multi-sequence image of the present invention to locate automatically can realize the quick synchronized positioning of multi-sequence image, significantly reduced labor workload, the multi-sequence image of the present invention method of location automatically can be used in different fields, not only can use at medical domain, at geological exploration field, the method for utilizing multi-sequence image of the present invention to locate automatically can be determined the geologic feature of certain area-of-interest of crust depth equally easily.
Embodiment
With embodiment the present invention is described in further detail with reference to the accompanying drawings below:
Suppose to have two image sequences, total N in first image sequence
1Width of cloth image, the note image is respectively Q in the plane at place in three-dimensional system of coordinate
1, Q
2..., Q
N1Total N in second image sequence
2Width of cloth image, the note image is respectively R in the plane at place in three-dimensional system of coordinate
1, R
2..., R
N2Because the image in each sequence all carries out imaging along same direction, so each image sequence has unique normal, the normal of remembering first image sequence is n
q(A
q, B
q, C
q), the normal of second image sequence is n
r(A
r, B
r, C
r).Fig. 1 and Fig. 2 are respectively the synoptic diagram of two image sequences in rectangular coordinate system in space, and Fig. 3 is the synoptic diagram of two image sequences in unified world coordinate system.
If the plane Q at first image sequence place
1, Q
2..., Q
N1The plane equation at place is respectively suc as formula shown in (1-1):
If the plane R at second image sequence place
1, R
2..., R
N2The plane equation at place is respectively suc as formula shown in (1-2):
Automatically synchronized positioning is exactly the point-of-interest to a certain width of cloth image in the image sequence, orient in another image sequence with this point-of-interest apart from the anchor point on the piece image of minimum, can stipulate that in some applications this distance is less than the minimum threshold of distance of setting.Be known array with two above-mentioned image sequences below, provide location process and method.
Under these conditions, the problem of location just transforms for following such problem automatically: the m (1≤m≤N of known first image sequence
1) some P (x in the width of cloth image
m, y
m, z
m), in second image sequence, obtain with the minimum plane of this some distance on another point, also promptly obtain and this P (x
m, y
m, z
m) apart from a picture element in the minimum image.So, utilize the range formula of point, can obtain the distance on each plane, image place in some P to the second image sequence easily to the plane; Compare then and obtain minimum distance, and find out the minimum corresponding image of distance.The anchor point of the correspondence on the image of determining again to find, thus automatic location process finished.
Point P (x
m, y
m, z
m) to the plane R at the i width of cloth image place of second image sequence
iApart from d (x
m, y
m, z
mR
i) expression formula suc as formula shown in (1-3):
Traversal d (x
m, y
m, z
mR
i), therefrom find out minimum value and value d
Min(suppose it is to k width of cloth image place plane R
kDistance).For given distance threshold d
ThIf, d
Min≤ d
Th, the plane R of second image sequence so
kBe and a P (x
m, y
m, z
m) nearest, and think plane R
kThe middle existence and some P (x
m, y
m, z
m) identical point-of-interest P ' (x
m', y
m', z
m').Point P ' (x
m', y
m', z
m') be a P (x
m, y
m, z
m) at k image place plane R
kIn subpoint, will solve a P ' (x below so
m', y
m', z
m') coordinate.
Find the solution plane R
kIn exist with a P (x
m, y
m, z
m) identical point-of-interest P ' (x
m', y
m', z
m').
According to known condition, i.e. plane R
kEquation
A
rx+B
ry+C
rz+D
rk=0 (1-4)
Can at first obtain some P (x
m, y
m, z
m) and plane R
kVertical straight-line equation is suc as formula shown in (1-5):
Can obtain a P ' (x by formula (1-4) and formula (1-5)
m', y
m', z
m') value, shown in (1-6):
So just finished all processes of automatic synchronized positioning.
Provide the embodiment that the inventive method is used at medical domain below:
Because the automatic synchronized positioning of a plurality of image sequences is repeatedly to calculate according to the principle of two automatic synchronized positioning of image sequence to carry out, therefore, in order to narrate more succinct and conveniently, only to be elaborated with regard to how carrying out automatic synchronized positioning between two image sequences.Just can provide the example of the automatic synchronized positioning between a plurality of image sequences according to this principle.Picture format is decided to be the general image of following dicom standard approximately, that is to say, each width of cloth image all is the image of the DICOM form of a width of cloth standard.Arrange at two image sequences: comprise N altogether in the individual image sequence of i (value 1,2)
iWidth of cloth image.Arrange at each image sequence: the 1st row (row increase progressively direction) represented vector of unit length of any piece image in the individual image sequence of i (value 1,2) is
Arrange at each image sequence: represented vector of unit length of the 1st row (row increases progressively direction) of any piece image in the individual image sequence of i (value 1,2) is
Arrange at each image sequence: the unit normal vector of the individual image sequence of i (value 1,2) is
Arrange at two image sequences: the k of the j width of cloth image of the individual image sequence of i (value 1,2) (sequence number of pixel is calculated according to the row major of computing machine definition) pixel is expressed as P
Ijk(x
Ijk, y
Ijk, z
Ijk).Arrange at two image sequences: the actual physics identical length of each pixel representative of all images together in the same image sequence; The actual physics width (increasing progressively direction along row) of the single pixel representative in the individual image sequence of i (value 1,2) on any piece image is s
IwThe actual physics height (increasing progressively direction along row) of the single pixel representative in the individual image sequence of i (value 1,2) on any piece image is s
IhThe actual physics width of single pixel representative and be unit highly all with actual physical length millimeter (mm).Arrange in two image sequences: to the image in the same image sequence, they all have identical width and picture altitude; The width of any piece image is defined as W in the individual image sequence of i (value 1,2)
i, highly be defined as H
iPicture traverse and highly all be unit with the pixel.
In order to carry out automatic synchronized positioning, the space plane equation of each width of cloth image of employed each image sequence in the automatic synchronized positioning need be known, corresponding with it point in other each image sequence could be provided to certain pixel on certain width of cloth image in certain given sequence like this.Therefore in preprocessing process, just need some specific parameters to determine the space plane at the every width of cloth image place in each image sequence, and then could automatic synchronized positioning.The table 1 pair parameter that automatic synchronized positioning is required is stipulated.
Table 1
The DICOM content of image files is made up of two parts: file header (Header) and figure point data (Pixel Data) that bag is deposited parameter information.
DICOM file header (DICOM File Meta Information) has comprised the relevant information of identification data set.Each DICOM file all must comprise this document head.Beginning most of file header is the file preface, and it is made up of 128 a bytes 00H, next is the DICOM prefix, and it is the character string " DICM " that a length is 4 bytes, can be worth according to this to judge that a file is the DICOM file.Also comprise some other very Useful Information in the file header, as the transformat of file, the application program of generation this document etc.The figure point data is then described the brightness value of each point of image.DICOM comprises 4 content level: 1.Patient (patient); (2.Study check); (3.Series series); (4.Image image).Although which floor content of front is identical in a lot of images, they have in each image file.Each layer is an information entity (Information Entity); Each layer is subdivided into module (Module) again; The minimum unit of each module (Module) the inside is called an attribute (Attribute) or data element (Element).In the DICOM file, the position of each data element is all left fixing position in, as long as therefore know the first address that this document is deposited in internal memory, just can find corresponding data element according to the side-play amount of deposit position.And also one by one data element just of TAG value among those DICOM.
The value of taking out the TAG (0018,5100) of image has just been determined the direction of unified coordinate system, and promptly each parameter of all images sequence is all being calculated provide (according to the standard of DICOM 3.0) with reference to this unified coordinate system.
The value of taking out the TAG (0020,0032) of image has just been determined the coordinate X on the first pixel of this image (" upper left side "), Y, Z value.The value of it and TAG (0020,0037) can be determined the volume coordinate of being had a few of entire image.
The value of taking out the TAG (0020,0037) of image can be determined capable vector sum unit of the unit column vector of image, and both appositions (cross product) are exactly unit normal vector, therefore can obtain 3 vector of unit length from TAG (0020,0037).
The value of taking out the TAG (0028,0030) of image can be determined the actual physics width of each pixel representative of image and the actual physics height of representative.
The value of taking out the TAG (0028,0010) of image can be determined the height of image.
The value of taking out the TAG (0028,0011) of image can be determined the width of image.
Required all parameters (seeing Table 1) of two image sequences in the present embodiment have all been obtained except parameter " the 1st image sequence unit normal vector " and parameter " the 2nd image sequence unit normal vector " and have been finished.
Calculate the unit normal vector of each image sequence
Because
Result of calculation is suc as formula shown in (3-1):
Can get the unit normal vector of the 1st image sequence and the 2nd image sequence by formula (3-1), respectively suc as formula shown in (3-2) and the formula (3-3):
At parameter required in the table 1, can obtain result suc as formula (3-4) and formula (3-5):
Determine the plane equation of every width of cloth image in two image sequences
Because for the image in the 1st image sequence, the coordinate position of the first pixel of each width of cloth image has all been known and has been P
1i1(x
1i1, y
1i1, z
1i1) (the first pixel coordinate of i width of cloth image).Therefore the plane equation at all images place just can calculate in the 1st sequence, and result calculated is suc as formula shown in (3-6):
In like manner, for the 2nd image sequence, the N that it comprises
2The plane equation at individual image place is suc as formula shown in (3-7):
Determine the two-dimensional coordinate of the impact point on a certain width of cloth image of sequence image
In view pre-determined bit process, at first determine the coordinate of the point-of-interest of a certain width of cloth image in the 1st image sequence, calculate the distance that this point-of-interest arrives each plane, width of cloth image place in other (the 2nd) sequences then.
As shown in Figure 4, in order to calculate the distance on the 1st given image sequence mid point plane at each width of cloth image place in the another one image sequence, at first the screen two-dimensional coordinate of the 1st image set point to be converted to the three-dimensional coordinate in the unified coordinate system of image sequence place.Could under unified three dimensional space coordinate system, calculate the distance on each plane then.
If (x y), is the k width of cloth image of the 1st image sequence to the two dimensional surface coordinate of set point (being the row at image place and the capable coordinate of forming at place, is the coordinate of unit with the pixel) for P.Given two-dimensional coordinate point is converted to the coordinate under the unified coordinate system in space
At two dimensional surface coordinate P (x y), at first calculates this line displacement amount Δ X on the k width of cloth image of space and line skew amount Δ Y (with the millimeter<mm of physical length〉be unit) and is respectively:
The plane equation at the k width of cloth image place of the 1st image sequence is suc as formula shown in (4-2):
a
1x+b
1y+c
1z=a
1x
1k1+b
1y
1k1+c
1z
1k1 (4-2)
By the capable vector of unit of formula (4-1), formula (4-2), image sequence, the unit column vector of image sequence and the coordinate P that the rotation of coordinate formula can get corresponding spatial point (shown in figure (4-1))
1km(x
1km, y
1km, z
1km), wherein,
Subscript m=(x-1) * W
1+ y (4-3)
Calculate the minor increment of another image sequence by the three-dimensional coordinate of impact point
See that by the range formula that all images of the 2nd image sequence is seen formula (3-7) and put the plane at the plane equation in space formula (1-3) can calculate a P
1km(x
1km, y
1km, z
1km) to the i width of cloth image place plane π of the 2nd image sequence
1Apart from d (x
1km, y
1km, z
1kmπ
1) be:
Traversal is d (x relatively
1km, y
1km, z
1kmπ
i), 1≤i≤N wherein
2, can draw a minimum distance.Also promptly can obtain the 2nd piece image in the image sequence, make P by formula (4-5)
1km(x
1km, y
1km, z
1km) minimum to the distance of this width of cloth image.Might as well establish the n width of cloth that this image is arranged in the 2nd image sequence, and suppose that this is apart from d (x
1km, y
1km, z
1kmπ
n) less than set distance threshold d
Th(distance threshold is got 10mm in this example).
Determine the plane at anchor point place
The image at anchor point place is the n width of cloth image of the 2nd image sequence.And the equation on plane, n width of cloth image place is:
a
2x+b
2y+c
2z=a
2x
2n1+b
2y
2n1+c
2z
2n1 (5-1)
Determine the volume coordinate of anchor point
At first calculate set point P
1km(x
1km, y
1km, z
1km) to the vertical line equation on the described plane of formula (5-1), shown in (5-2):
Can obtain positioning point coordinate by formula (5-1) and formula (5-2) with reference to formula (1-6) then.
And in fact,, therefore can use a P owing to think that the three dimensional space coordinate of impact point and set point is identical
1km(x
1km, y
1km, z
1km) coordinate use as the coordinate of impact point.Can there be certain error like this, but be in the allowed band, no longer carry out the straight line of formula (5-2) in the therefore actual operation and find the solution.This point be between theory and the practical operation not with.
Therefore, the volume coordinate of synchronized positioning impact point is automatically: P
1km(x
1km, y
1km, z
1km).Determine its pixel coordinate by the volume coordinate of anchor point in two dimension
As shown in Figure 7, the conversion from volume coordinate to the two dimensional surface coordinate as can be seen, carry out following operation:
Determine the physical deflection amount of anchor point on its plane, place
Coordinate P by extraterrestrial target point place corresponding to the first pixel on the plane in the 2nd image sequence
2n1(x
2n1, y
2n1, z
2n1) can get:
Wherein Δ x is that Δ y is the side-play amount along column vector direction along the side-play amount of row vector direction, and unit is physical unit millimeter (mm).
Calculate coordinate on the plane by the physical deflection amount in space
Actual physics width and height parameter s by formula (5-3) and pixel representative
2wAnd s
2hCan get:
Load several image sequences
Be loaded into a plurality of image sequences of certain patient in the internal memory and be presented on the computer screen, the implementation procedure of Load Images sequence as shown in Figure 6.
Open the file at image sequence (DICOM file) place, use the standard A PI function LoadFile or the ReadFile that provide among the VC that the DICOM file is loaded in the internal memory.Then first width of cloth image of four image sequences in front is shown to four viewing areas on the screen, each viewing area shows first width of cloth image in the sequence respectively.
In internal memory, the information of each width of cloth image is read in given parameter (parameter that automatic location will the use) variable.Such as the information that will from the DICOM file, obtain TAG (0018,5100) patient position, then the pointer of file is moved on to the position of TAG (0018,5100), read 16 bytes depositing continuously, can obtain the information of patient position.The parameter that other need use obtain similar with TAG (0018,5100).
For the realization of the automatic synchronized positioning of explanation more intuitively, selected the 1st, the 2nd, the 11st and the 12nd image sequence to show.
Determine the 1st the focus point in the image sequence
The automatic synchronized positioning function button of mouse-click, this moment, the synchronized positioning function was opened automatically.Load 4 image sequences (certainly 13 image sequences of this patient all being loaded) afterwards, clicking the automatic synchronized positioning button of the conventional toolbar that is positioned at the below, promptly opening the function of automatic synchronized positioning.Opening under the situation of this function, the display window of 1 image sequence of rolling mouse to the, the zone at that width of cloth place in the upper left corner of four width of cloth images, the left button of clicking the mouse has just provided the point that will carry out synchronized positioning of appointment.Pin the position that left mouse button and rolling mouse just can change set point this moment, after opening the function of automatic synchronized positioning, system just responds " OnMouseDown " message, as long as click left mouse button down, just begins to carry out the whole calculating process of automatic synchronized positioning.Such as under situation shown in Figure 6, be to have clicked left mouse button, system responses " OnMouseDown " message so, at this moment, the screen coordinate position at mouse place is captured, and being converted into the planimetric coordinates position at image place of first width of cloth reality of the 1st image sequence, this planimetric coordinates position is transformed into the three-dimensional coordinate of the 1st image sequence first width of cloth image place actual physics space plane through conversion then; Calculate after the corresponding three-dimensional coordinate, just begin, calculate this and put all the other 3 planes that the image sequence middle distance is nearest, and corresponding flat in all the other 3 image sequences is shown on the screen according to the range formula of putting the plane; Find out line displacement amount and the line skew amount of this three-dimensional coordinate point on the plane at other three width of cloth image place by the three-dimensional coordinate of correspondence then; Be transformed into coordinate on the screen picture again by line displacement amount that calculates and line skew amount, and its mark is come out just to have realized automatic synchronized positioning.
After left mouse button is pressed, system responses " OnMouseMove " message, promptly in the process of rolling mouse position, the coordinate of given point constantly changes, and locatees automatically so constantly repeat said process.
As shown in Figure 7, through series of computation, the image at the anchor point of other final sequence image and place thereof is presented in the window of sequence under it, image corresponding to impact point in other each sequence is presented on the screen, and the anchor point on the image is presented on the corresponding image with the cruciform Green Marker.
Those skilled in the art do not break away from essence of the present invention and spirit, can there be the various deformation scheme to realize the present invention, the above only is the preferable feasible embodiment of the present invention, be not so limit to interest field of the present invention, the equivalent structure that all utilizations instructions of the present invention and accompanying drawing content are done changes, and all is contained within the interest field of the present invention.