Method and system for calibration

11179134 · 2021-11-23

Assignee

Inventors

Cpc classification

International classification

Abstract

A method of calibrating a positioning system in a radiation therapy system which includes a radiation therapy unit having a fixed radiation focus, includes irradiating a calibration tool having at least one reference object, capturing at least one two-dimensional image including cross-sectional representations of reference objects of the calibration tool and determining image coordinates of the representation of each reference object. Based on the reference objects' image coordinates, positions of the reference objects in the stereotactic coordinate system relative to an origin of the calibration tool and the position of the origin of the calibration tool relative to the imaging unit, a position difference between the position of the calibration tool in the stereotactic coordinate system and a position of the calibration tool in an imaging system coordinate system including a translational and rotational position difference is calculated.

Claims

1. A method for calibrating an imaging system capturing images of a patient in relation to a radiation therapy system, which comprises a radiation therapy unit having a fixed radiation focus, and a positioning system configured to position the patient in relation to the fixed radiation focus in the radiation therapy unit, the method comprising steps of: irradiating a calibration tool comprising a plurality of reference objects with ionizing radiation during an image scanning procedure using a radiation unit of the imaging system, wherein the calibration tool and the plurality of reference objects have known positions in a stereotactic coordinate system; capturing at least one two-dimensional image including cross-sectional representations of the plurality of reference objects of the calibration tool using a detector of the imaging system during the image scanning procedure; determining image coordinates, d.sub.xy, of the cross-sectional representation of each of the plurality of reference objects in the captured at least one two-dimensional images; obtaining a vector, r.sub.so, from an origin or center point, o, of the calibration tool to an imaging unit in the stereotactic coordinate system and obtaining a vector r.sub.o′b from an origin, o′, of the calibration tool in an imaging system coordinate system to each of the plurality of reference objects; and calculating a transformation between a 3D position of the calibration tool in the stereotactic coordinate system and a 3D position of the calibration tool in the imaging system coordinate system, wherein the calculation of the transformation uses the image coordinates, d.sub.xy, a known vector, r.sub.ob, from each of the plurality of reference objects in the stereotactic coordinate system to the origin, o, of the calibration tool in the stereotactic coordinate system, the vector, r.sub.so, and a vector r.sub.sb from each of the plurality of reference objects to the imaging unit, and the vector r.sub.sb is calculated by
r.sub.sb=r.sub.so+r.sub.ob+=r.sub.so+r.sub.o,o′+r.sub.o′b, wherein r.sub.o,o′ is a vector from the origin, o, of the calibration tool in the stereotactic coordinate system to the origin, o′, of the calibration tool in the imaging system coordinate system; and determining a relation between coordinates or vectors in the stereotactic coordinate system and the imaging system coordinate system using a Rodrigues rotation formula for vector rotation in space.

2. The method according to claim 1, wherein the step of obtaining the vector, r.sub.so, from the origin, o, of the calibration tool to the imaging unit includes calculating the vector, r.sub.so, of the origin, o, of the calibration tool to the imaging unit.

3. The method according to claim 2, further comprising: determining a vector, r.sub.sd, from each of the plurality of reference objects to the imaging unit based on the image coordinates, d.sub.xy, and a vector from the detector to the imaging unit; and calculating the transformation using a vector, r.sub.sd, from each of the plurality of reference objects to the imaging unit, a vector, r.sub.o′b, from each of the plurality of reference objects to the origin, o′, of the calibration tool in the imaging system coordinate system, and a vector, r.sub.so, from the calibration tool to the imaging unit.

4. The method according to claim 1, further comprising steps of: determining vector, r.sub.sd, from each of the plurality of reference objects to the imaging unit from the image coordinates, d.sub.xy, and a vector from the detector to the imaging unit; and calculating the transformation using a vector, r.sub.sd, from each of the plurality of reference objects relative to the imaging unit, vectors, r.sub.o′b, from the plurality of reference objects to the origin, o′, of the imaging system coordinate system, and a vector, r.sub.so, from the calibration tool to the imaging unit.

5. The method according to claim 1, wherein the calculation of the transformation is further using a known source to detector distance, SDD, between the imaging unit and the detector and a detector rotation between a position of the detector in the stereotactic coordinate system and a position of the detector in the imaging system coordinate system.

6. The method according to claim 1, further comprising steps of: determining vectors, r.sub.sb, between the plurality of reference objects' positions and the position of the imaging unit based on the respective image coordinates, d.sub.xy, given that the vectors, r.sub.sb, between the plurality of reference objects' positions and the position of the imaging unit are parallel, for respective reference objects, with vectors between positions of the image coordinates, d.sub.xy, and the imaging unit; and using the relation between vectors between the plurality of reference objects' positions and the position of the imaging unit and vectors between the positions of the image coordinates, d.sub.xy, and the imaging unit in calculating the transformation.

7. The method according to claim 6, further comprising steps of: defining the relation between vectors, r.sub.sd, for the image coordinates, d.sub.xy, relative to the imaging unit and the vectors, r.sub.sb, of the plurality of reference objects' positions relative to the imaging unit as a scalar; and determining a value of the scalar based on a vector from each of the plurality of reference objects to the imaging unit, a vector, r.sub.o′b, from each of the plurality of reference objects to the origin, o′, of the imaging system coordinate system, and a vector, r.sub.so, from the calibration tool to the imaging unit.

8. The method according to claim 1, further comprising steps of: calculating vectors, r.sub.o′b′, from each of the plurality of reference objects to the origin, o, of the calibration tool in the imaging system coordinate system based on the vectors, r.sub.ob, from each of the plurality of reference objects to the origin, o, of the calibration tool in the stereotactic coordinate system; and calculating the transformation using the image coordinates, d.sub.xy, the coordinates, r.sub.o′b′, of the plurality of reference objects in the imaging system coordinate system and coordinates, r.sub.so, of the calibration tool relative to the imaging unit.

9. The method according to claim 1, wherein each relation between coordinates of a position of a reference object of a plurality of reference objects in the stereotactic coordinate system and coordinates of a position of that reference object in the imaging system coordinate system is calculated as a vector defining a translational and rotational transformation using a vector-related method.

10. The method according to claim 1, wherein the positioning system includes a fixation arrangement configured to releasably and firmly engage a stereotactic fixation unit for immobilizing at least a part of the patient in relation to the positioning system.

11. A system for calibrating an imaging system for capturing images of a patient in relation to a radiation therapy system, which comprises a radiation therapy unit having a fixed radiation focus, and a positioning system configured to position the patient in relation to the fixed radiation focus in the radiation therapy unit, wherein: the imaging system is configured to irradiate a calibration tool comprising a plurality of reference objects with ionizing radiation during an image scanning procedure using a radiation unit, wherein the calibration tool and the plurality of reference objects have known positions in a stereotactic coordinate system; the imaging system is configured to capture at least one two-dimensional image including cross-sectional representations of the plurality of reference objects of the calibration tool using a detector during the image scanning procedure; a processor is configured to: determine image coordinates, d.sub.xy, of the cross-sectional representation of each reference object in the captured at least one two-dimensional images; obtain a vector, r.sub.so, from an origin or center point, o, of the calibration tool to an imaging unit in the stereotactic coordinate system and obtain a vector r.sub.o′b from an origin, o′, of the calibration tool in the imaging system coordinate system to each of the plurality of reference objects; and calculate a transformation between a 3D position of the calibration tool in the stereotactic coordinate system and a 3D position of the calibration tool in an imaging system coordinate system, wherein the calculation of the transformation uses the image coordinates, d.sub.xy, a known vector, r.sub.ob, from each of the plurality of reference objects in the stereotactic coordinate system to the origin, o, of the calibration tool in the stereotactic coordinate system, the vector, r.sub.so, and a vector r.sub.sb from each of the plurality of reference objects to the imaging unit, and the vector r.sub.sb is calculated by
r.sub.sb=r.sub.so+r.sub.ob=r.sub.so+r.sub.o,o′+r.sub.o′b, wherein r.sub.oo′ is a vector from the origin, o, of the calibration tool in the stereotactic coordinate system to the origin, o′, of the calibration tool in the imaging system coordinate system; and determine a relation between coordinates or vectors in the stereotactic coordinate system and the imaging system coordinate system using a Rodrigues rotation formula for vector rotation in space.

12. The system according to claim 11, wherein the processor is further configured to calculate the vector r.sub.so from the origin, o, of the calibration tool to the imaging unit.

13. The system according to claim 12, wherein the processor is further configured to: determine a vector, r.sub.sd, from each of the plurality of reference objects to the imaging unit based on the image coordinates, d.sub.xy, and a a vector from the detector to the imaging unit; and calculate the transformation using a vector, r.sub.sd, from each of the plurality of reference objects to the imaging unit, a vector, r.sub.o′b, from each of the plurality of reference objects in the imaging system coordinate system, and a vector, r.sub.so, from the calibration tool to the imaging unit.

14. The system according to claim 11, wherein the processor is further configured to: determine a vector, r.sub.sd, from each of the plurality of reference objects to the imaging unit based on the image coordinates, d.sub.xy, and a vector from the detector to the imaging unit; and calculate the transformation based on a vector, r.sub.sd, from each of the plurality of reference objects to the imaging unit, a vector, r.sub.o′b, from each of the plurality of reference objects in the imaging system coordinate system, and a vector, r.sub.so, from the calibration tool to the imaging unit.

15. The system according to claim 11, wherein the processor is further configured to calculate the transformation using a known source to detect distance, SDD, between the imaging unit and the detector and a detector rotation between a position of the detector in the stereotactic coordinate system and a position of the detector in the imaging system coordinate system.

16. The system according to claim 11, wherein the processor is Further configured to: determine vectors, r.sub.sb, between the plurality of reference objects' positions and the position of the imaging unit based on the respective image coordinates, d.sub.xy, given that the vectors, r.sub.sb, between the plurality of reference objects' positions and the position of the imaging unit are parallel, for respective reference objects, with vectors between positions of the image coordinates, d.sub.xy, and the imaging unit; and using the relation between vectors between the plurality of reference objects' positions and the position of the imaging unit and vectors between the positions of the image coordinates, d.sub.xy, and the imaging unit in calculating the transformation.

17. The system according to claim 16, wherein the processor is further configured to: define the relation between vectors, r.sub.sd, for the image coordinates, d.sub.xy, relative to the imaging unit and the vectors, r.sub.sb, of the plurality of reference objects' positions relative to the imaging unit as a scalar; and determine a value of the scalar based on a vector from each of the plurality of reference objects to the imaging unit, a vector, r.sub.o′b, from each of the plurality of reference objects to the origin, o′, of the imaging system coordinate system and a vector, r.sub.so, from the calibration tool to the imaging unit.

18. The system according to claim 11, wherein the processor is further configured to: calculate a vector, r.sub.o′b′, from each of the plurality of reference objects to the origin, o, of the calibration tool in the imaging system coordinate system based on the a vector, r.sub.ob, from each of the plurality of reference objects to the origin, o, of the calibration tool in the stereotactic coordinate system; and calculate the transformation using the image coordinates, d.sub.xy, the vector, r.sub.o′b′, of from each of the plurality of reference objects in the imaging system coordinate system and a vector, r.sub.so, of the calibration tool relative to the imaging unit.

19. The system according to claim 11, wherein each relation between coordinates of a position of a reference object of a plurality of reference objects in the stereotactic coordinate system and coordinates of a position of that reference object in the imaging system coordinate system is calculated as a vector defining a translational and rotational transformation using a vector-related method.

20. The system according to claim 11, wherein the positioning system includes a fixation arrangement configured to releasably and firmly engage a stereotactic fixation unit for immobilizing at least a part the patient in relation to the positioning system.

Description

BRIEF DESCRIPTION OF THE DRAWINGS

(1) Preferred embodiments of the invention will now be described in greater detail with reference to the accompanying drawings, in which

(2) FIG. 1 schematically illustrates the general principle of a radiation therapy system suitable for calibration using the present invention;

(3) FIG. 2 schematically illustrates an embodiment of the system according to present invention implemented in the radiation therapy system of FIG. 1;

(4) FIG. 3 schematically illustrates an embodiment of the calibration tool according to the present invention;

(5) FIG. 4 schematically illustrates the geometry seen from the front of the radiation unit of FIG. 1 in a counter-direction to the direction of the z-axis of the stereotactic coordinate system;

(6) FIG. 5 schematically illustrates an enlarged view of the geometry seen from the front of the radiation unit of FIG. 1 in a counter-direction to the direction of the z-axis;

(7) FIG. 6 illustrates detector rotation compared to the stereotactic coordinate system;

(8) FIG. 7 is a flow chart illustrating the overall steps of the method according to the present invention;

(9) FIG. 8 is a flow chart illustrating the steps of the method according to an embodiment of the present invention; and

(10) FIG. 9 is a flow chart illustrating the steps of the method according to an embodiment of the present invention.

DESCRIPTION OF PREFERRED EMBODIMENTS

(11) With reference to FIG. 1, a radiation therapy system 1 for which the present invention is applicable comprises a radiation unit 10 and a patient positioning unit 20. In the radiation unit 10, there are provided radioactive sources, radioactive source holders, a collimator body, and external shielding elements. The collimator body comprises a large number of collimator channels directed towards a common focus, in a manner as is commonly known in the art.

(12) The collimator body also acts as a radiation shield preventing radiation from reaching the patient other than through the collimator channels. Examples of collimator arrangements in radiation therapy systems applicable to the present invention can be found in WO 2004/06269 A1, which is hereby incorporated by reference.

(13) The patient positioning unit 20 comprises a rigid framework 22, a slidable or movable carriage 24, and motors (not shown) for moving the carriage 24 in relation to the framework 22. The carriage 24 is further provided with a patient bed (not shown) for carrying and moving the entire patient. At one end of the carriage 24, there is provided a fixation arrangement 28 for receiving and fixing a stereotactic fixation unit (not show), either directly or via an adapter unit (not shown), and thereby preventing the stereotactic fixation unit from translational or rotational movement in relation to the movable carriage 24. The patient can be translated using the patient positioning unit 20 in the coordinate system of the radiation therapy system 1 or the patient positioning unit 20, along at least in the three orthogonal axes x, y, and z shown in FIG. 1. The patient can, in some embodiments, also be translated along, for example, a rotational axis.

(14) An imaging system 50 for capturing images of a patient, for example, in connection with treatment planning or treatment is arranged or located at the radiation unit 10, for example, a cone beam computed tomography (CBCT) system.

(15) The imaging system 50 includes an X-ray source 51 and a detector 52. The X-ray source 51 and detector 52 are arranged to rotate around a rotation axis c (see FIG. 1) of a coordinate system (a, b, c) of the imaging system 50 to capture images of a patient located on the patient bed 26 at different angles. Ideally, the X-ray source 51 and the detector 52 rotate around the z-axis of the patient positioning unit 20, which is aligned with the rotation axis c of the imaging system 50. However, in practice, there are, for example, alignments errors due manufacturing tolerances leading to a misalignment between the coordinate system of the patient positioning unit 20 and the imaging system 50 and accordingly the c-axis is not aligned with the z-axis.

(16) In computed tomography, a three-dimensional image is generated by rotating the imaging system around the object in very small steps (e.g. <1°) around a single axis of rotation while taking a series of two-dimensional X-ray images. In other applications, the object is rotated around the imaging in small steps. Normally, the imaging device or the object is rotated, for example, 180° or 360° around the object or imaging device, respectively. Afterwards, a final three-dimensional image can be numerically reconstructed based on the two-dimensional images and can be displayed either as a series of sectional images or a three-dimensional image.

(17) As can be understood from FIG. 1, the described embodiment concerns a radiation therapy system for providing gamma radiation therapy to a target volume in the head of human patient. Such therapy is often referred to as stereotactic surgery. During therapy, the patient head is fixed in a stereotactic fixation unit, for example, using a bite-block and a fixation unit in the form of a stereotactic head frame, which comprises engagement points adapted for engagement with the fixation arrangement 28 of the radiation therapy system. Thus, during the stereotactic surgery, the head of the patient is fixed in the stereotactic frame, which in turn is fixedly attached to the patient positioning system via the fixation arrangement 28. During movement of the treatment volume in the head of the patient in relation to the radiation focus, e.g. along the three axes x, y, and z shown in FIG. 1, the entire patient is moved. Thus, there is no relative to movement between the head frame and the carriage 24 of the patient positioning system 20.

(18) Turning now to FIG. 2, an embodiment of the system according to the present invention will be discussed. In FIG. 2, the system 1 according to the present invention is schematically shown together with a schematically illustrated radiation unit 10 and an imaging system 50. The system 1 according to the present invention comprises on the general level a calibration tool 110 arranged to be releasably and firmly attached to the fixation arrangement 28 of the radiation therapy system and processing unit 120, for example, a personal computer (PC). In FIG. 3, a more detailed view of an embodiment of the calibration tool 110 is shown.

(19) The calibration tool 110 is arranged to be easily aligned and positioned exactly in the stereotactic fixation unit coordinate system. By attaching the calibration tool 110 firmly by means of attachment means 118 without any possibility to movement of the calibration tool 110 relative to the patient positioning unit 20, it can be secured that the calibration tool is located at a defined and predetermined position, x.sub.cal.tool, y.sub.cal.tool, and z.sub.cal.tool, in the stereotactic fixation unit coordinate system and that it is kept still during image acquisition.

(20) Preferably, the calibration tool 110 comprises at least one reference object or mark 112 having predetermined or known positions, respectively, in the stereotactic fixation unit coordinate system when the tool 110 is attached to the fixation arrangement 28. That is, positions of the reference objects or marks 112 relative to the predetermined position of the calibration tool 110 are known and thus have predetermined coordinates in the stereotactic fixation unit coordinate system. The reference objects 112 are made of a material and are arranged and shaped such that they can be identified in the two-dimensional images captured by the detector 52 of the imaging system 50.

(21) In the embodiment of the calibration tool 110 shown in FIGS. 2 and 3, the calibration tool 110 comprises four reference objects 112 each including a rod 116 provided with a steel ball 115 attached on a plate 119. Each reference object 112 has a predetermined position in the stereotactic fixation unit coordinate system when the calibration tool 110 is attached to the fixation arrangement 28.

(22) In order to allow an identification of the reference objects in the two-dimensional images captured by the detector 52, the reference objects 112 are made of a material that attenuates the X-ray radiation emanating from the imagining unit or X-ray source 51 such as steel. The X-rays are attenuated by the reference objects 112 which entails that a representation of each reference object is captured by the detector and that a representation, as a shadow, can be seen in each image. The procedure for identifying each reference object representation will be described below.

(23) A processing unit 120 is connectable to the imaging system 50 such two-way communications is allowed, for example, wirelessly using, for example, Bluetooth or WLAN. Thereby, the processing unit 120 may, for example, obtain image information from the imaging system 50 and send instructions to imaging system 50 to initiate an image scanning procedure.

(24) On a general level, the processing unit 120 is configured to calculate a transformation or a translational and rotational position difference between the position of the calibration tool 110 in the stereotactic coordinate system and a position of the calibration tool 110 in the imaging system coordinate system. The coordinate system of the stereotactic fixation unit (as defined by the axes x, y, and z) in which the calibration tool 110 is positioned is not aligned with the coordinate system of the imaging system (defined by the axes a, b, and c) due to, for example, manufacturing tolerances.

(25) Thus, the processing unit 120 determines the position, a.sub.cal.tool, b.sub.cal.tool, and c.sub.cal.tool, of the calibration tool 110 in the coordinate system of the imaging system 50 or rather the positions of the reference objects, i.e. a set of coordinates is obtained where each reference object is associated with three coordinates. Preferably, the coordinates of each reference object 114 are determined resulting in an array of position coordinates.

(26) Furthermore, the processing unit 120 is configured to calculate a transformation between the determined position of the calibration tool in the coordinate system related to the imaging system, a.sub.cal.tool, b.sub.cal.tool, and c.sub.cal.tool, and a position of the calibration tool in the stereotactic fixation unit coordinate system, x.sub.cal.tool, y.sub.cal.tool, and z.sub.cal.tool, to determine a relationship between the coordinate system related to the imaging system and the position of the calibration tool in the stereotactic fixation unit coordinate system. Preferably, the transformation between the known positions of the reference marks in the stereotactic fixation unit coordinate system and the determined positions of the calibration tool in the coordinate system related to the imaging system are determined.

(27) The calculation is based on the reference objects image coordinates d.sub.xy, positions r.sub.ob of the reference objects 112 in the stereotactic coordinate system relative to an origin, o, of the calibration tool 110 and a position r.sub.so of the origin, o, of the calibration tool 110 relative to the imaging unit 51.

(28) In embodiments of the present invention, the calculation of the transformation is based positions r.sub.sd of the reference objects relative to the imaging unit 51, the positions r.sub.o′b of the reference objects in the imaging coordinate system and positions r.sub.so of the calibration tool relative to the imaging unit 51.

(29) In embodiments of the present invention, the calculation of the transformation is further based on a distance SDD (see FIG. 4) between the imaging unit 51 and the detector 52 and a detector rotation between a position of the detector in the stereotactic coordinate system and a position of the detector in the imaging unit coordinate system. With reference to FIG. 6, the vector rotation is defined in three parameters, where q and w are out-of-plane rotation angles and n is the in-plane rotation angle. The detector plane is aligned such that the v axis is parallel to the z axis and the u axis is parallel to the y axis. The rotation angle of the detector plane along the axis of u=u.sub.0 is q, the rotation angle of the detector plane along the axis of v=v.sub.0 is w, and the rotation angle of the detector plane along the point of (u.sub.0, v.sub.0) is n. The axis x, y, z relate to the stereotactic coordinate system (see FIG. 1) and u and v relate to the detector plane.

(30) In embodiments of the present invention, vectors r.sub.sb between the reference objects positions and the position of the imaging unit 51 is determined based on the respective reference objects image coordinates d.sub.xy and an assumption that the vectors r.sub.sb between the reference objects positions and the position of the imaging unit 51 are parallel, for respective reference objects 112, with vectors r.sub.sd between positions the reference objects image coordinates d.sub.xy and the imaging unit 51 and using the relation between the vectors r.sub.sd between the reference objects positions and the position of the imaging unit 51 and the vectors r.sub.sb between positions the reference objects image coordinates d.sub.xy and the imaging unit 51 in calculating the transformation.

(31) According to embodiments of the present invention, positions r.sub.o′b′ of the reference objects 112 relative to the origin o of the calibration tool 110 in the imaging system coordinate system is calculated based on the positions r.sub.ob of the reference objects relative to the origin o of the calibration tool 110 in the stereotactic coordinate system and the transformation is calculated based on the reference objects image coordinates d.sub.xy, the coordinates r.sub.o′b′ of the reference objects in the imaging coordinate system and coordinates r.sub.so of the calibration tool relative to the imaging unit 51.

(32) With reference now to FIGS. 4-9, the method according to the present invention for calibrating an imaging system 50 for capturing images of a patient in connection with treatment planning or treatment in a radiation therapy system will be described. The method may, for example, be performed in a system as described in FIG. 2. FIGS. 4-6 schematically show geometries during the imaging procedure and FIGS. 7-9 show flow charts of embodiments of the method according to the present invention.

(33) With reference to FIGS. 4 and 5, the geometry is schematically illustrated seen from front of the radiation unit 10, in this embodiment a Gamma knife, i.e. in a counter-direction to the direction of the z-axis of the stereotactic coordinate system shown in FIG. 1. The X-ray source 51, at position s (i.e. at coordinates a.sub.s, b.sub.s, c.sub.s of the imaging system coordinate system), emits radiation which is attenuated by a reference object 112, at position b (i.e. at coordinates x.sub.b, y.sub.b, z.sub.b in the stereotactic coordinate system). A clearly distinguishable shadow can then be detected on the detector 52 at position d (d.sub.x, d.sub.y). Based on the images, the position of the representation of each reference object, d, in space, i.e. x.sub.d, y.sub.d, z.sub.d in the stereotactic coordinate system. The calibration tool 110 is located at point o, i.e. a reference point of the calibration tool 110 is located at point x.sub.o, y.sub.o, z.sub.o in the stereotactic coordinate system. The position of the calibration tool 110 in the imaging system 50 is o′, i.e. a.sub.o′, b.sub.o′, c.sub.o′.

(34) The vector r.sub.sb is the vector from point s to point b, i.e. the vector from the X-ray source 51 to respective reference object 112. The vector r.sub.ob is the vector from point o to point b, i.e. the vector from the center point of the calibration tool 110 to respective reference object 112. This vector r.sub.ob is known. The vector r.sub.so is the vector from point s to point o, i.e. the vector from the X-ray source 51 to the calibration tool 110. The vector r.sub.o. SDD is the “Source to Detector Distance”, i.e. the distance between the X-ray source 51 to the detector 52.

(35) The gantry angle, β, defines the angle between a current position, s, of the X-ray source 51 and the y-axis. The angle α defines the rotation for which correction is required, thus, the position, o′, of the calibration tool 110 in the coordinate system of the imaging system 50 and compared to the position, o, of the calibration tool 110 in the stereotactic coordinate system. FIG. 5 is a more detailed view of the geometry shown in FIG. 4.

(36) With reference to FIG. 4, the vector r.sub.sb can be expressed as:
r.sub.sb=r.sub.so+r.sub.ob=r.sub.so+r.sub.oo′+r.sub.o′b  (1)
where the notation r.sub.sb, as mentioned above, denotes the vector from point s (the X-ray source 51) to point b (the respective reference object 112). It is assumed that the position of the reference objects 112 relative to the center point, o, of the calibration tool 110 is known. The relation between the coordinates in the stereotactic coordinate system and the coordinates in the rotated coordinate system, i.e. the coordinate system of the imaging system, can be determined by using an algorithm for vector rotation in space, for example, Rodrigues rotation formula, given an axis ^k and an angle of rotation α:
R(r,^k,α)=r cos α+(^k×r)sin α+^k(^k.Math.r)(1−cos α)  (2)

(37) Since the rotation axis is a unit vector it can be expressed with two parameters, θ and ϕ, as
^k(θ,ϕ)=(cos ϕ sin θ, sin ϕ sin θ, cos θ)  (3)

(38) The gantry rotation is taken into account. Assuming a static frame of reference as defined in FIG. 4 this can be done by applying equation (2) with ^k=^z and α=β to r.sub.so(β=0) and r.sub.sd(β=0):
r.sub.so=R(r.sub.so(β=0),^z,β)=(y.sub.s sin β−x.sub.s cos β,−y.sub.s cos β−x.sub.s sin β,−z.sub.s)  (4)
r.sub.sd=R(r.sub.sd(β=0),),^z,β)=(x.sub.d cos β−y.sub.d sin β,y.sub.d cos β+x.sub.d sin β,^z.sub.d)  (5)

(39) The vector r.sub.sd=(x.sub.d, y.sub.d, z.sub.d) can be calculated from the images for example by center of mass calculation. Each representation of a reference object 112 will occupy a region on the detector surface (i.e. in the image) larger than a pixel. According to embodiments of the present invention, one point or pixel, in on the detector surface is selected for each reference object that accurately represents its projection. Based on the selected points d.sub.x and d.sub.y on the detector surface, the vector r.sub.sd (x.sub.d, y.sub.d, z.sub.d) can be determined. The reference objects 112 have a high contrast against the background and thresholding is therefore an efficient method for identifying or determining the projections. The calibration tool 110 and the reference objects 112 are preferably designed such that no overlaps, either horizontally or vertically, between different projections arise in the images. According to preferred embodiments, a region of interest is determined for each projection and the point that is determined to accurately represent the projection is selected from that region of interest, for example, using a center of mass calculation.

(40) Since the vector r.sub.sb is parallel with r.sub.sd the following applies: where λ is a scalar. The value of this scalar can be extressed by applying the cosine formula to the triangle shown in FIG. 5 which yields:
r.sub.sb∥.sup.2=∥r.sub.sb∥.sup.2+∥r.sub.sb∥.sup.2−2∥r.sub.sb∥∥r.sub.sb∥cosy   (7)
Combining equation (7) with equation (6) and expressing the lengths as scalar products yields the following:

(41) λ = 1 .Math. r sd .Math. r so .Math. r so + r ob .Math. r ob + 2 r so .Math. r ob ( 8 ) λ = .Math. r so + r ob .Math. .Math. r sd .Math. ( 9 )
Based on equations (8) and (9), equation (1) can be expressed as:

(42) r sd .Math. r sd .Math. = r so + r oo + r o b .Math. r so + r oo + r o b .Math. ( 10 )
The degrees of freedom are the translation r.sub.oo′=(x.sub.0, y.sub.0, z.sub.0) and the rotation, determined by θ, ϕ, α, of the calibration tool and the source-to-axis distance (SAD). Equation (10) is solved for each reference object in each image. In preferred embodiments, three reference objects are used and 300 images are captured during an imaging session. Further, equation (10) may, according to preferred embodiments, be solved numerically, in a least-squares sense.

(43) Below, an example of a numerical solution of equation (10) employing the Gauss-Newton algorithm will be illustrated. To simply notation, the following are introduced:

(44) x = ( R SAD , x 0 , y 0 , z 0 , θ , ϕ , α ) ( 11 ) y i = r sd ( β ) i .Math. r sd .Math. ( 12 ) r so ( R SAD , β ) = R SAD .Math. ( - sin β , - cos β , 0 ) ( 13 ) v ( x ) = r so ( R SAD , β ) + r oo ( x 0 , y 0 , z 0 ) + r o b ( θ , ϕ , α ) ( 14 ) u ( x ) = v .Math. v ( 15 ) F i = v i u ( x ) ( 16 )
where an appropriate indexing over both the vector components and the reference objects is understood. R.sub.SAD is the distance from the source, i.e. the X-ray source 51, to the axis through origin of the calibration tool 110, i.e. the position of the calibration tool 110. Next, the residuals v.sub.i are considered when solving equation (10):
v.sub.i=y.sub.i−F.sub.i(x)  (17)
for which the Gauss-Newton algorithm strives to minimize the sum of squares. Starting with an initial guess x.sup.0, the algorithm iteratively updates the solution according to:
x.sup.n+1=x.sup.n+Δ  (18)
where Δ is a small step determined by solving the normal equations:
(J.sup.TJ)Δ=J.sup.Tv  (19)
and J in turn is the Jacobian of F with respect to x, i.e.:

(45) J ij ( x n ) = F i x j | x = x n ( 20 )
The normal equations may be solved in one step using Cholesky decomposition or QR factorization of J. For large systems, an iterative method, such as the conjugate gradient method, may be more efficient. Then, an analytical expression of J(x) can be computed:

(46) J = ( F 1 F 2 .Math. ) = v i u - v i 2 u 3 / 2 .Math. u ( 21 )
Since v(x)=r.sub.so(R.sub.SAD, β)+r.sub.oo′(x.sub.0, y.sub.0, z.sub.0)+r.sub.o′b(θ, ϕ, α), the following applies:

(47) v R SAD = r so R SAD = ( - sin β , - cos β , 0 ) ( 22 ) v x 0 = r oo x 0 = ( 1 , 0 , 0 ) ( 23 ) v y 0 = r oo y 0 = ( 0 , 1 , 0 ) ( 24 ) v z 0 = r oo z 0 = ( 0 , 1 , 0 ) ( 25 ) v θ = r o b θ = ( k ^ θ × r o b ) sin α + ( k ^ θ ( k ^ .Math. r o b + k ^ ( k ^ θ .Math. r o b ) ( 1 - cos α ) ( 26 ) v ϕ = r o b ϕ = ( k ^ ϕ × r o b ) sin α + ( k ^ ϕ ( k ^ .Math. r o b + k ^ ( k ^ ϕ .Math. r o b ) ( 1 - cos α ) ( 27 ) v α = r o b α = ( k ^ × r o b ) cos α + ( k ^ ( k ^ .Math. r o b ) - r o b ) sin α where ( 28 ) k ^ θ = ( cos ϕ cos θ , sin ϕ cos θ , - sin θ ) ( 29 ) k ^ ϕ = ( - sin ϕ sin θ , cos ϕ sin θ , 0 ) ( 30 )
Finally, the following applies:
u=2(v.Math.∇)v  (31)
which in component form translates to

(48) u x j = 2 .Math. n = 1 7 v n v n x j ( 32 )
Accordingly, the equation (21) can be written as:

(49) J = v i u - v i u 3 2 ( v .Math. ) v ( 33 )

(50) With reference now to FIG. 7, the general steps of an embodiment of the method according to the present invention for calibrating an imaging system 50 for capturing images of a patient in connection with treatment planning or treatment in a radiation therapy system will be described. The method may, for example, be performed in a system as described in FIG. 2.

(51) A first step may be to perform a calibration of image quality parameters of the imaging system 50 including determining a rotational axis of the imaging system 50. Alternatively, if a calibration has been performed earlier, the imaging system 50 may not need a calibration and calibration data can be stored in a calibration file.

(52) At step 210, an image scanning procedure is initiated and the releasably attached calibration tool 110 is irradiated using the radiation unit 51 of the imaging system 50.

(53) At step 220, at least one two-dimensional image including cross-sectional representations of the reference objects 112 of the calibration tool 110 is captured using the detector 52 of the imaging system 50 during the image scanning procedure.

(54) At step 230, the image coordinates d.sub.xy of the representation or projection of each reference object 112 is identified or determined in the captured images. As has been described above, a point for each object 112 is determined that represents its projection is determined. Due to the size of the objects 112, their projections will occupy regions in the images larger than a pixel and therefore it will be efficient to identify point that represents the central point. For example, thresholding can be used to separate the projections from the background. The reference objects 112 are arranged on the calibration tool 110 such that no projections overlap either horizontally or vertically. A summing in the non-overlapping direction and an identifying of contiguous nonzero regions are performed. This procedure is repeated in both directions for each of the segmented strips. The sought point can be found in the resulting region of interest. A center of mass calculation can for example be used for this purpose.

(55) At step 240, a position of the origin o of the calibration tool 110 in relation to the imaging unit 51 or the vector r.sub.so between the imaging unit 51 and the origin o of the calibration tool is obtained. In embodiments of the present invention, the vector r.sub.so between the imaging unit 51 and the origin o of the calibration tool is calculated and in other embodiments of the present invention, the vector r.sub.so between the imaging unit 51 and the origin o of the calibration tool is predetermined.

(56) At step 250, a transformation including a translational and rotational position difference between the position of the calibration tool 110 in the stereotactic coordinate system and a position of the calibration tool 110 in an imaging system coordinate system is calculated using, for example, the equations (1)-(33) described above. Generally, the calculation is based on the reference objects image coordinates d.sub.xy, positions r.sub.ob of the reference objects 112 in the stereotactic coordinate system relative to an origin o of the calibration tool 110 and a position r.sub.so of the origin o of the calibration tool 110 relative to the imaging unit 51. If SAD is not predetermined, SAD is calculated at the same time as the transformation is calculated.

(57) In a following step, the transformation that has been calculated can be used for calibrating the imaging system 50 in relation to the radiation therapy system 1.

(58) Turning now to FIG. 8, steps of another embodiment of the method according to the present invention for calibrating an imaging system 50 for capturing images of a patient in connection with treatment planning or treatment in a radiation therapy system will be described. The method may, for example, be performed in a system as described in FIG. 2. A first step may be to perform a calibration of image quality parameters of the imaging system 50 including determining a rotational axis of the imaging system 50. Alternatively, if a calibration has been performed earlier, the imaging system 50 may not need a calibration and calibration data can be stored in a calibration file.

(59) At step 310, an image scanning procedure is initiated and the releasably attached calibration tool 110 is irradiated using the radiation unit 51 of the imaging system 50.

(60) At step 320, at least one two-dimensional image including cross-sectional representations of the reference objects 112 of the calibration tool 110 is captured using the detector 52 of the imaging system 50 during the image scanning procedure.

(61) At step 330, the image coordinates d.sub.xy of the representation or projection of each reference object 112 is identified or determined in the captured images. As has been described above, a point for each object 112 is determined that represents its projection is determined. Due to the size of the objects 112, their projections will occupy regions in the images larger than a pixel and therefore it will be efficient to identify point that represents the central point. For example, thresholding can be used to separate the projections from the background. The reference objects 112 are arranged on the calibration tool 110 such that no projections overlap either horizontally or vertically, see FIG. 4. A summing in the non-overlapping direction and an identifying of contiguous nonzero regions are performed. This procedure is repeated in both directions as shown in FIG. 4 for each of the segmented strips. The sought point can be found in the resulting region of interest. A center of mass calculation can for example be used for this purpose.

(62) At step 340, positions r.sub.sd of the reference objects 112 relative to the imaging unit 51 is determined or calculated based on the reference objects image coordinates d.sub.xy and a position r.sub.sd of the detector 52 relative to the imaging unit or X-ray source 51.

(63) At step 350, a position of the origin o of the calibration tool 110 in relation to the imaging unit 51 is obtained or the vector r.sub.so between the imaging unit 51 and the origin o of the calibration tool. In embodiments of the present invention, the vector r.sub.so between the imaging unit 51 and the origin o of the calibration tool is calculated and, in other embodiments of the present invention, the vector r.sub.so between the imaging unit 51 and the origin o of the calibration tool is predetermined.

(64) At step 360, a transformation including a translational and rotational position difference between the position of the calibration tool 110 in the stereotactic coordinate system and a position of the calibration tool 110 in an imaging system coordinate system is calculated using, for example, the equations (1)-(31) described above. Generally, the calculation is based on the positions r.sub.sd of the reference objects relative to the imaging unit 51, positions r.sub.o′b of the reference objects in the imaging coordinate system and a position r.sub.so of the origin o of the calibration tool 110 relative to the imaging unit 51. If SAD is not predetermined, SAD is calculated at the same time as the transformation is calculated. In a following step, the transformation that has been calculated can be used

(65) for calibrating the imaging system 50 in relation to the radiation therapy system 1.

(66) Turning now to FIG. 9, steps of further embodiment of the method according to the present invention for calibrating an imaging system 50 for capturing images of a patient in connection with treatment planning or treatment in a radiation therapy system will be described. The method may, for example, be performed in a system as described in FIG. 2. A first step may be to perform a calibration of image quality parameters of the imaging system 50 including determining a rotational axis of the imaging system 50. Alternatively, if a calibration has been performed earlier, the imaging system 50 may not need a calibration and calibration data can be stored in a calibration file.

(67) At step 410, an image scanning procedure is initiated and the releasably attached calibration tool 110 is irradiated using the radiation unit 51 of the imaging system 50.

(68) At step 420, at least one two-dimensional image including cross-sectional representations of the reference objects 112 of the calibration tool 110 is captured using the detector 52 of the imaging system 50 during the image scanning procedure.

(69) At step 430, the image coordinates d.sub.xy of the representation or projection of each reference object 112 is identified or determined in the captured images. As has been described above, a point for each object 112 is determined that represents its projection is determined. Due to the size of the objects 112, their projections will occupy regions in the images larger than a pixel and therefore it will be efficient to identify point that represents the central point. For example, thresholding can be used to separate the projections from the background. The reference objects 112 are arranged on the calibration tool 110 such that no projections overlap either horizontally or vertically, see FIG. 4. A summing in the non-overlapping direction and an identifying of contiguous nonzero regions are performed. This procedure is repeated in both directions as shown in FIG. 4 for each of the segmented strips. The sought point can be found in the resulting region of interest. A center of mass calculation can for example be used for this purpose.

(70) At step 440, vectors r.sub.sb between the reference objects positions and the position of the imaging unit 51 are determined based on the respective reference objects image coordinates d.sub.xy and an assumption that the vectors r.sub.sb between the reference objects positions and the position of the imaging unit 51 are parallel, for respective reference objects 112, with vectors r.sub.sd between positions the reference objects image coordinates d.sub.xy and the imaging unit 51.

(71) At step 450, a position of the origin o of the calibration tool 110 in relation to the imaging unit 51 is obtained or the vector r.sub.so between the imaging unit 51 and the origin o of the calibration tool. In embodiments of the present invention, the vector r.sub.so between the imaging unit 51 and the origin o of the calibration tool is calculated and, in other embodiments of the present invention, the vector r.sub.so between the imaging unit 51 and the origin o of the calibration tool is predetermined.

(72) At step 460, a transformation including a translational and rotational position difference between the position of the calibration tool 110 in the stereotactic coordinate system and a position of the calibration tool 110 in an imaging system coordinate system is calculated using, for example, the equations (1)-(31) described above using also the relation between the vectors r.sub.sd between the reference objects positions and the position of the imaging unit 51 and the vectors r.sub.sb between positions the reference objects image coordinates d.sub.xy and the imaging unit 51 in calculating the transformation. If SAD is not predetermined, SAD is calculated at the same time as the transformation is calculated.

(73) In a following step, the transformation that has been calculated can be used for calibrating the imaging system 50 in relation to the radiation therapy system 1.

(74) Even though the present invention has been described above using exemplifying embodiments thereof, alterations, modifications, and combinations thereof, as understood by those skilled in the art, may be made without departing from the scope of the invention as defined in the accompanying claims.