Systems and methods for calibrating and controlling collimator leaves

Systems and methods for calibrating and controlling leaves of a multi-leaf collimator are disclosed. According to an exemplary method, a controller may receive images of collimator leaves and may determine a minor offset between an imaging marker and the tip of the respective leaf. In addition, the controller may quantify a barrel distortion effect associated with a leaf-imaging camera. The controller may correct leaf position data using the minor offsets and barrel distortion quantification, and may use the corrected leaf positions to accurately place the leaves during radiotherapy. Advantageously, a desired beam shaping window may be formed with the leaves, ensuring that healthy tissue is minimally irradiated while also ensuring that the target tissue receives the correct radiation dose. Embodiments of the present disclosure provide collimator calibration techniques which may be faster than prior calibration techniques, allowing shortened calibration times and faster radiotherapy sessions.

TECHNICAL FIELD

This disclosure relates generally to multi-leaf collimators of radiotherapy systems. More specifically, this disclosure relates to systems and methods for calibrating and controlling movement of leaves of a multi-leaf collimator.

BACKGROUND

Radiotherapy is used to treat cancers and other ailments by irradiating tissue with ionizing radiation. Radiotherapy systems generate a beam of radiation (e.g. electrons, protons, ions, and the like) and direct the beam towards a target site, such as a tumour. To concentrate the radiation at the target site and to minimize irradiation of healthy surrounding tissue, radiotherapy systems often also include a beam-shaping device such as a multi-leaf collimator (MLC). A MLC includes rows of elongate leaves that are arranged side-to-side and constructed of a radiation-shielding material such as tungsten. Each leaf can be independently moved into and out of the path of the radiation to block a portion of the beam. By arranging the collimator leaves, the MLC can be used to shape the radiation beam in order to focus the dose on the target tissues.

Given the importance of accurately controlling the beam shape, techniques have been developed to calibrate the positions of collimator leaves. For example, some radiation-based calibration techniques utilize x-ray film or point dosimeters to confirm that the leaves form the desired radiation beam shape. However, such techniques can be time-consuming and often provide a poor indication of the actual beam geometry. Other calibration techniques involve using a laser beam and optical detector to determine when the MLC leaves have reached a defined calibration position. However, this technique may not provide an accurate indication of the leaf positions for all leaf shape configurations. Still further calibration techniques involve imaging optical markers on the leaves with a camera and using the detected positions of the optical markers to determine the positions of the leaves. However, the lens of the camera can distort the images of the markers, meaning additional calibration steps may be necessary to provide accurate determination of the leaf positions. The extent of this distortion is different for each lens and can change every time adjustments are made to the camera; thus, a distortion correction technique developed for one camera may not be applicable to other cameras, or to the camera in question after servicing. In addition, because the optical markers are manually placed on the collimator leaves, the distance between the marker and the leaf tip (a distance known as the “minor offset”) is different for each leaf. Existing MLCs cannot simply measure the minor offset with the camera because the leaves are not visible to the camera. For these reasons, existing collimator systems may require computationally-intensive and time-consuming calibration steps to ensure that collimator leaves are correctly positioned during radiotherapy.

Thus, there remains a need for improved techniques for accurately monitoring collimator leaf positions by minimizing the distortion of leaf images caused by the camera lens and by accurately measuring and accounting for the minor offsets of the leaves in a more timely fashion. The present disclosure provides systems and methods for generating undistorted images of collimator leaves and accurate measurements of the minor offsets using a minimal number of measurements, such that the true positions of the leaves can be determined without adding excessive calibration time to the machine setup process. As a result, the leaves can be even more accurately placed during radiotherapy so that the desired beam geometry can be achieved and the time required to perform the calibration may be reduced.

SUMMARY

Disclosed herein are systems and methods for correcting distortion of images of collimator leaves which is caused by the lens of a leaf-imaging camera, and for accurately measuring the minor offsets of the collimator leaves. Particular examples of the disclosure may enable accurate determination of the positions of the collimator leaves, thus providing more exact positioning of leaves to shape radiation beams during radiotherapy.

According to an exemplary embodiment of the present disclosure, a computer-implemented method for calibrating leaves of a multi-leaf collimator of a radiotherapy device is provided, the leaves including imaging markers and configured to shape a radiation beam emitted by the radiotherapy device by blocking radiation, wherein the radiotherapy device includes an imaging device configured to image the leaves, the imaging device including a lens. The method includes receiving a plurality of images of the leaves from the imaging device. The leaves are in a first position in at least a first image and in a second position in at least a second image. The method further includes generating, based at least in part on the first image and the second image, initial position estimates of the leaves in the first position and in the second position. The initial position estimates of the leaves are generated with respect to a predetermined coordinate space associated with the multi-leaf collimator. The method further includes determining, based at least in part on the initial position estimates of the leaves in the first position and in the second position, offsets for the leaves. The offsets reflect differences between imaging marker positions of the leaves and positions of tips of the leaves. The method further includes identifying first position coordinates, with respect to the predetermined coordinate space, for the leaves based upon the offsets of the leaves and the initial position estimates of the leaves. The method further includes calculating a distortion coefficient of the lens based upon the first position coordinates for the leaves and the offsets of the leaves. The distortion coefficient reflects an optical distortion effect associated with the lens. The method further includes determining corrected position coordinates, with respect to the predetermined coordinate space, for the leaves based on the distortion coefficient and the first position coordinates for the leaves. The method further includes correcting the offsets for the leaves based on the corrected position coordinates for the leaves. The method further includes calibrating the multi-leaf collimator based on the corrected offsets, wherein at least one leaf of the multi-leaf collimator is controlled based on the calibration.

The multi-leaf collimator includes two banks of leaves which are captured in the images. Two opposing leaves constitute a leaf pair. The first position is a retracted position of the leaves and the second position is an extended position of the leaves. A first bank of leaves moves into the retracted position in the first image and the extended position in the second image. A second bank of leaves moves into the extended position in the first image and the retracted position in the second image. Calculating the distortion coefficient includes identifying, in the predetermined coordinate space, a lens x-coordinate and a lens y-coordinate associated with a centre of the lens. Identifying the lens x-coordinate includes, for each leaf pair, generating a function based on the first position coordinates of the two opposing leaves in the first position and in the second position. Identifying the lens x-coordinate additionally includes identifying a maximum or a minimum of each function; determining an x-coordinate, relative to the predetermined coordinate space, of each maximum or minimum; and averaging the x-coordinates of the maximums and minimums. The function of each leaf pair is a second-order polynomial. Identifying the lens y-coordinate includes generating, for each bank of leaves in each of the first and second positions, a function based on the first position coordinates of the leaves; identifying a turning point for each function; and averaging the turning points. The function for each bank of leaves in each of the first and second positions is a second-order polynomial. Calculating of the distortion coefficient of the lens includes generating a function based on the first position coordinates and offsets of a selected one of the banks of leaves in one of the images; calculating a provisional distortion coefficient of the lens based on the function; determining an error value of the provisional distortion coefficient; if the error value is above a predetermined threshold, regenerating the function using the error value, recalculating the provisional distortion coefficient of the lens based on the regenerated function, and determining the error value of the recalculated provisional distortion coefficient until the error value is below the predetermined threshold; and when the error value is below the predetermined threshold, setting the distortion coefficient of the lens to be equal to the provisional distortion coefficient. The function is generated using a root mean square technique. Calculating the provisional distortion coefficient includes determining undistorted position coordinates, with respect to the predetermined coordinate space, for each leaf in the selected bank of leaves by minimizing, with the generated function, optical distortion associated with the lens; calculating a distortion coefficient of each leaf in the selected bank of leaves based on the undistorted position coordinates; and generating the provisional distortion coefficient of the lens by averaging the distortion coefficients of the leaves. The method additionally includes identifying the imaging marker positions of the leaves utilizing a predetermined conversion factor relating numbers of pixels and distance. Determining the offsets for the leaves includes identifying the imaging marker positions of the leaves, wherein each leaf is associated with at least two identified imaging marker positions; averaging, for each leaf, the imaging marker positions; identifying a reference leaf based on the average imaging marker positions; determining differences between the average imaging marker positions of the leaves and the average imaging marker position of the reference leaf; and calculating the offsets based on the determined differences.

According to another exemplary embodiment of the present disclosure, a computer-implemented method for use in a radiotherapy device that emits a radiation beam to treat a target tumour of a patient is provided. The radiotherapy device includes a multi-leaf collimator having a plurality of leaves, the leaves including imaging markers and configured to shape the radiation beam emitted by the radiotherapy device by blocking radiation. The radiotherapy device includes an imaging device configured to image the leaves. The imaging device includes a lens. The method includes receiving a treatment plan for treating the target tumour with radiation. The treatment plan includes a therapeutic radiation beam shape for irradiating the target tumour. The method includes identifying radiotherapy position coordinates, with respect to a predetermined coordinate space associated with the multi-leaf collimator, for the leaves of the multi-leaf collimator. The leaves form the therapeutic radiation beam shape by blocking radiation when they are positioned at the radiotherapy position coordinates. The method includes receiving offsets for the leaves. The offsets reflect differences between imaging marker positions of the leaves and positions of tips of the leaves. The method includes receiving calibration coefficients based on leaf position data from multiple multi-leaf collimators. The method includes generating a position error function based on the calibration coefficients. The position error function indicates a leaf position error associated with an optical distortion effect of the lens. The method includes controlling the leaves to move to the radiotherapy position coordinates based on the offsets and the position error function.

The multi-leaf collimator includes two opposing banks of leaves. Generating the position error function includes generating position error polynomials for the banks of leaves, wherein each position error polynomial is based on different calibration coefficients; receiving, from the imaging device, an image of the leaves; identifying distorted position coordinates, with respect to the predetermined coordinate space, for the leaves based upon positions of the imaging markers of the leaves in the image; and generating the position error function based on the position error polynomials and the distorted position coordinates of the leaves. Each bank of leaves is associated with three position error polynomials, and each position error polynomial is based on four calibration coefficients. The offsets of the leaves are determined, at least in part, from leaf position data obtained when the leaves are in a first position and upon leaf position data obtained when the leaves are in a second position. The position error function indicates a leaf position error of each leaf. The method additionally includes calculating corrected calibration coefficients to accommodate an adjustment of the multi-leaf collimator; and generating a corrected position error function based on the corrected calibration coefficients.

Additional features and advantages of the disclosed embodiments will be set forth in part in the description that follows, and in part will be obvious from the description, or may be learned by practice of the disclosed embodiments. The features and advantages of the disclosed embodiments will be realized and attained by the elements and combinations particularly pointed out in the appended claims.

It is to be understood that both the foregoing general description and the following detailed description are examples and explanatory only and are not restrictive of the disclosed embodiments as claimed.

The accompanying drawings constitute a part of this specification. The drawings illustrate several embodiments of the present disclosure and, together with the description, serve to explain the principles of the disclosed embodiments as set forth in the accompanying claims.

DETAILED DESCRIPTION

Exemplary embodiments are described with reference to the accompanying drawings. In the figures, which are not necessarily drawn to scale, the left-most digit(s) of a reference number identifies the figure in which the reference number first appears. Wherever convenient, the same reference numbers are used throughout the drawings to refer to the same or like parts. While examples and features of disclosed principles are described herein, modifications, adaptations, and other implementations are possible without departing from the spirit and scope of the disclosed embodiments. Also, the words “comprising,” “having,” “containing,” and “including,” and other similar forms are intended to be equivalent in meaning and be open ended in that an item or items following any one of these words is not meant to be an exhaustive listing of such item or items, or meant to be limited to only the listed item or items. It should also be noted that as used herein and in the appended claims, the singular forms “a,” “an,” and “the” include plural references unless the context clearly dictates otherwise.

Exemplary embodiments generally relate to systems and methods for minimizing or eliminating distortion in images of collimator leaves caused by the lens of a leaf-imaging camera. In addition, exemplary embodiments generally relate to systems and methods for accurately determining minor offsets of collimator leaves. Embodiments of the present disclosure may enable accurate determination of leaf positions, both during calibration and radiotherapy. Additionally, exemplary embodiments generally relate to systems and methods for performing radiotherapy, during which the positions of collimator leaves are corrected with generated position error functions.

FIG. 1is a view of an exemplary radiotherapy system100. System100may be a linear accelerator (LINAC) system or a combination magnetic resonance imaging (MRI) and linear accelerator system, known as an MR-LINAC. However, it will be appreciated that system100in the present disclosure is not limited to a LINAC or a MR-LINAC, and that the systems and devices disclosed herein may be used to enable any suitable radiotherapy system, or any suitable combination medical imaging and radiotherapy system.

System100may include a chassis102, which may support a radiation head104and a radiation detection panel106. Radiation head104and detection panel106may be mounted opposite each other on chassis102, with a rotational axis of chassis102positioned between them. Radiation head104may be configured to generate a radiation beam122, such as according to a treatment plan, to deliver doses of radiation to a patient124supported by a couch110. The treatment plan may be predetermined, or may be determined in real-time or just prior to treatment and may be adjusted during the course of treatment. Chassis102may be configured to rotate radiation head104and detection panel106about couch110, to provide patient124with a plurality of varying dosages of radiation according to the treatment plan. For example, chassis102may be powered by one or more chassis motors such that chassis102is continuously rotatable around couch110. In some embodiments, couch110may be motorized so that the patient124can be positioned with a tumour site at or close to the isocentre126of the radiation beam122. Additionally or alternatively, simultaneously with rotation of chassis102about the patient124, couch110may be moved along a translation axis into or out of the treatment area (i.e. parallel to the axis of rotation of the chassis). With this simultaneous motion, a helical radiation delivery pattern known in the art may be achieved for producing certain types of dose distributions.

In some embodiments, system100may additionally include an imaging device. For example, system100may be configured as an MR-LINAC system. Exemplary system100may utilize MR images, CT images, and/or pseudo-CT images to monitor and control radiation delivered by radiation head104.

Controller140may be programmed to control features of system100according to a radiotherapy treatment plan for irradiating a target tissue of a patient. The treatment plan may include information about a particular dose to be applied to a target tissue, as well as other parameters such as beam angles, dose-histogram-volume information, the number of radiation beams to be used during therapy, the dose per beam, and the like. Controller140may be programmed to control various components of system100, such as chassis102, radiation head104, detection panel106, and couch110, according to the predetermined treatment plan. In some embodiments, controller140may be programmed to generate a treatment plan using images received from an imaging device. Alternatively or additionally, controller140may be programmed to acquire a treatment plan from memory142and to execute the plan with system100. In some embodiments, controller140may be programmed to modify a treatment plan received from memory142prior to execution with system100.

FIG. 2illustrates features of an exemplary radiation head104of system100. Radiation head104may include a radiation beam generator210(e.g. an X-ray source) and a multi-leaf collimator (MLC)200, at least one of which may be mounted on chassis102. Radiation beam122, generated by beam generator210, may be a cone beam or a fan beam, for example. In other embodiments, radiation head104may include more than one beam generator and/or more than one respective multi-leaf collimator. MLC200may include a plurality of elongate leaves202,204oriented orthogonal to the axis of beam122. The leaves of MLC200may be controlled to take different positions to selectively block some or all of radiation beam122, thereby altering the shape of the beam that reaches the patient.

Radiation head104may also include a camera220configured to view collimator leaves202,204via a pair of tilt-adjustable mirrors222,224, which may permit the camera to be located out of the radiation beam122. In some embodiments, leaves202,204may not be visible to camera220; accordingly, leaves202,204may include imaging markers mounted thereon, such as rubies or fluorescing markers, which may be visible to camera220. A beam splitter242may be placed in the optical path (between the two mirrors222,224so that it is also out of the radiation beam122) such that a light projector240may illuminate the imaging markers along the same optical path. Radiation head104may include a further mirror or mirrors244so as to locate the light projector (and/or other elements) in convenient locations.

According to embodiments in which leaves202,204each include a ruby as an imaging marker, the ruby may be configured to fluoresce in the dark red/near infrared light band (e.g. 695 nm) when illuminated with light having a wavelength in the 525 nm green light band or in the 410 nm violet/near ultraviolet light band. For example, light projector240may irradiate the rubies with green or violet light such that the rubies fluoresce, emitting light which may be diverted to camera220by mirrors222,224. Camera220may generate image data of the leaves202,204utilizing the light emitted by the rubies, and controller140may utilize the image data to determine the position of the leaves and to control movement of the leaves into or out of the path of radiation beam122so as to shape the beam (e.g. according to a predetermined treatment plan). It will be appreciated that radiation head104in the present disclosure is not limited to the leaf-imaging configuration depicted inFIG. 2, and that the systems and devices disclosed herein may include any suitable configuration to image the leaves of MLC200.

FIG. 3Ais a top plan view of an exemplary leaf array of MLC200, andFIG. 3Bis a side view of an exemplary leaf202. MLC200may include two banks310,320of leaves, each of which may be individually extended into and out of the path of radiation beam122so that their respective tips304shape the cross-section of the beam by blocking portions thereof. The word “tip” may refer to a functional end of leaf202along a longitudinal axis thereof for purposes of forming a shaping window for radiation beam122. The word “tip” does not necessarily refer to the end point of leaf202relative to the longitudinal axis thereof (that is, the point of the leaf202closest to the center of MLC200), although in some embodiments it may refer to the end point of leaf202relative to the longitudinal axis thereof. In some embodiments, MLC200may include a bank of motors, each configured to move a corresponding one of the leaves. Movement of each leaf by the motors may be controlled by controller140; for example, controller140may control placement of the leaf tips304via the motors to shape radiation beam122for irradiating a target tissue300, such as according to a predetermined treatment plan. In some embodiments, leaves202,204may be configured to be extended into the path of radiation beam122to a location beyond a halfway point between leaf banks310,320. This capability may allow the leaves202,204to be fully closed together. Leaves202,204may be constructed of a radiopaque material such as tungsten and may be arranged side-by-side relative to each other, in two opposing banks310,320; thus, areas beneath the leaves202,204are not irradiated. Each leaf is positioned directly opposite a corresponding leaf in the other leaf bank; two opposing leaves constitute a leaf pair325. Each leaf may be thin in its transverse (y) direction to provide high resolution and limit the size of unnecessarily irradiated tissue areas. Each leaf may also be deep in the (z) direction to provide effective radiation absorption. In some embodiments, each bank may include 80 leaves, resulting in 160 leaves in total; alternatively, MLC200may include more or fewer leaves.

Each leaf202,204may include a drive coupling330and a tungsten body340secured together. The drive coupling330may include two grooves334,346configured to engage end stop bars which may limit movement of the leaf (discussed further below). The drive coupling330may additionally include a notch332near the rear end336thereof, the notch332being configured to engage the leaf motor. For example, the leaf motor may be connected to a leaf key which may be inserted into notch332and driven by the motor to move the leaf into and out of radiation beam122. Tungsten body340may include an imaging marker342(e.g. a ruby) positioned near the leaf tip304. The imaging marker342of each leaf is manually placed approximately a predetermined distance from leaf tip304. For example, imaging marker342may be placed such that its centre is approximately 4.5 millimeters from leaf tip304. However, because each imaging marker is manually placed, the minor offset344between the centre of imaging marker342and the leaf tip304may be different for each leaf. Camera220cannot measure minor offset344by imaging the position of the leaf tip304because leaf202is not visible to the camera220except for imaging marker342.

FIG. 4Ais a top plan view of leaf banks310and320, with their tips304aligned in two straight lines. For example, each leaf depicted inFIG. 4Amay be in a respective fully retracted position.FIG. 4Bis an image of imaging markers342, as captured by camera220. In the configuration depicted inFIG. 4A, imaging markers342of the leaves are approximately aligned on two straight lines because the markers are roughly the same distance from the aligned tips. As depicted inFIG. 4B, camera220captures an image of markers342. However, the lens of camera220distorts the image of markers342: markers342appear, in the image, to form two curved lines, rather than two approximately straight lines. This distortion effect, which is known as “barrel distortion” and which is illustrated inFIG. 4C, compresses image features to appear closer to the centre400of the image the further they are from the x coordinate axis402and y coordinate axis404of the image. Thus, as depicted inFIG. 4C, straight lines406are distorted to appear as curved lines408, with the curve becoming more pronounced the further the line extends away from the x-axis402and y-axis404of the image. The barrel distortion effects are different for each camera lens and can make it difficult to determine the true positions of the collimator leaves, especially for the leaves furthest from the centre of the collimator. Therefore, in order to accurately locate and position the collimator leaves, the barrel distortion must be quantified and removed.

FIG. 5Aillustrates an exemplary calibration method500A for a multi-leaf collimator (e.g. MLC200) in which the barrel distortion and minor offsets may be quantified and used to correct the detected positions of the collimator leaves. Method500A may be a processor-executed method. In some embodiments, method500A may be executed by the same processor, such as controller140. Alternatively, one or more steps of method500A can be executed by separate processors.

In step502, controller140may control movement of the collimator leaves and may receive images of the leaves from camera220. The controller may identify position data of the imaging markers342from the received images. Step502may include receiving two or more images of the leaves from camera220. Controller140may be programmed to control MLC200such that each bank of leaves310,320may be in a different position in each of the images. Optionally, controller140may store the position data of the imaging markers in memory142.

FIG. 6Aillustrates an exemplary process of step502. The process ofFIG. 6Amay be executed by a processor, such as controller140. In step602, controller140may retract a first bank of leaves (e.g. leaf bank310) to an outer end stop622. In step604, controller140may advance the other bank of leaves (e.g. leaf bank320) to an inner end stop624. In some embodiments, leaves in the advancing bank (e.g. leaf bank320) may be advanced beyond the halfway point between the leaf banks310,320when they are advanced to the inner end stop624. Controller140may move the leaves, including advancing and retracting the leaves to the end stops, by actuation of the leaf motors of system100.

FIGS. 6B and 6Cillustrate a first exemplary configuration of retracted and extended leaves. Each leaf bank310,320may include an outer end stop622and an inner end stop624. The end stops622,624may be situated perpendicular to the longitudinal axis of the leaves and may limit movement of the leaves. For example, outer end stop622may engage groove334on the rear end336of drive coupling330, and may define the fully retracted position of the leaves because the leaves cannot be retracted away from the collimator centre beyond outer end stop622. Inner end stop624may engage groove346and may define the fully extended position of the leaves because the leaves cannot be advanced towards the collimator centre past inner end stop624. However, one of ordinary skill will appreciate that the configurations of leaves202,204and of end stops622,624are merely exemplary, and that the systems and devices disclosed herein may include any suitable configuration to define fully retracted and fully extended positions of the collimator leaves.

In step602(FIG. 6A), controller140may retract leaf bank310away from the collimator centre until grooves334of the drive couplings330engage outer end stop622, as illustrated in the cross-sectional view ofFIG. 6C. In step604, controller140may advance leaf bank320towards the collimator centre until grooves346of the leaves in the bank engage inner end stop624. In this arrangement, leaf tips304and rear ends336of the leaves in each bank may be aligned in straight lines because the leaves are identically shaped and dimensioned (with the exception of the manual placement of imaging marker342). In step606, controller140may control camera220to capture a first image of the leaves and may receive the image from camera220. In some embodiments, controller140may store the first image in memory142.

FIGS. 6D and 6Eillustrate steps608-612. In step608, controller140may advance bank310until grooves346of the leaves in the bank engage inner end stop624, as illustrated in the cross-sectional view ofFIG. 6E. In some embodiments, leaves in the advancing bank (e.g. leaf bank310) may be advanced beyond the halfway point between the leaf banks310,320when they are advanced to inner end stop624. In step610, controller140may retract leaf bank320away from the collimator centre until grooves334of leaves in the bank engage outer end stop622. In step612, controller140may control the camera220to capture a second image of the leaves and may receive the image from camera220. In some embodiments, controller140may store the second image in memory142.

One of ordinary skill will understand that controller140may execute steps608-612prior to executing steps602-606. In addition, controller140may control camera220to capture more than two images of the leaves. For example, controller140may image banks310and320separately in their respective fully extended and fully retracted configurations, resulting in four total images. However, at a minimum, two images of the leaves must be collected because the leaves must be imaged in at least two different positions.

Referring again toFIG. 5A, in step504, controller140may identify the positions of imaging markers342within the images received in steps606and612. Controller140may identify the positions of the imaging markers in both banks of leaves in the retracted and advanced positions. Thus, for a given leaf of MLC200, controller140may identify the imaging marker position from the image of that leaf in the advanced position and may identify the imaging marker position from the image of that leaf in the retracted position. Controller140may convert the imaging marker position data from pixels to a unit of distance, such as millimeters or microns, using a predetermined conversion factor. In some embodiments, the conversion factor may be constant for all leaves of MLC200. The conversion factor may be calculated from a measured distance of a leaf travel trajectory in millimetres (which may be determined based upon the known dimensions of MLC200) and a measured distance of the same leaf travel trajectory in pixels (which may be captured by camera220and corrected in accordance with, for example, method500A). Additionally or alternatively, a conversion factor may be estimated from a number of MLCs and averaged or otherwise combined to produce the conversion factor. In step504, controller140may determine x and y position coordinates for the imaging markers, with respect to a predetermined coordinate space520associated with MLC200, based upon the converted imaging marker position data. Each leaf of MLC200may be associated with two sets of imaging marker position coordinates: one set of imaging marker position coordinates representing when the leaf is fully advanced and another set of imaging marker position coordinates representing when the leaf is fully retracted. In some embodiments, controller140may store the imaging marker position coordinates in memory142. In some embodiments, controller140may perform the pixel-to-distance conversion of step504prior to determining the imaging marker position coordinates. In alternative embodiments, controller140may determine the imaging marker position coordinates in pixels, and may perform steps506-514of method500A, and optionally step516of method500A, using measurements and calculations in pixels. In such embodiments, controller140may then perform the pixel-to-distance conversion prior to performing the leaf control of step518.

In some embodiments, controller140may receive multiple images of the leaves at step606and at step612. For example, controller140may receive 2 images, 3 images, 4 images, 5 images, 10 images, 25 images, 50 images, 100 images, or some other number of images at step606and at step612. Controller140may execute step504of method500A for each image received in steps606and612and may thus calculate imaging marker position coordinates for imaging marker342in each received image. In some embodiments, the imaging marker position coordinates from each image of a given leaf at a given position (e.g., from each image of the first leaf of left bank310in the retracted position) may be averaged to generate a more accurate set of position coordinates for the imaging marker of each leaf at each position. The average imaging marker position coordinates may be utilized by controller140in executing the remainder of method500A.

FIG. 5Bdepicts an exemplary predetermined coordinate space520associated with MLC200, with the position coordinates for each imaging marker342mapped therein. The position coordinates of the imaging markers may be affected by the barrel distortion of the camera lens. For example, in a MLC with 80 leaves per leaf bank, markers of the first leaf522and 80thleaf528may appear closer to the y-axis than markers of the 40thleaf524and 41stleaf526, though in reality the markers may be placed in approximately straight lines. The imaging marker position coordinates for a first bank of leaves (e.g. leaf bank310) may have negative x-coordinates (i.e. are positioned to the left of the y-axis), while the imaging marker position coordinates for a second bank of leaves (e.g. leaf bank320) may have positive x-coordinates (i.e. are positioned to the right of the y-axis). In some embodiments, controller140may determine imaging marker position coordinates with the origin530of the coordinate space520corresponding to the position of the collimator centre. In a MLC with 80 leaves per leaf bank (160 leaves total), the collimator centre may be located between the 40thleaf524and the 41stleaf526, relative to an axis perpendicular to longitudinal directions of the leaves, and may be located equidistantly between the two leaf banks310,320. In some alternative embodiments, controller140may position origin530at a point which is equidistant between leaf banks310,320and above first leaf522(relative toFIG. 5B) or below 80thleaf528(relative toFIG. 5B). Thus, the imaging marker position coordinates in coordinate space520may be assigned relative to the collimator centre.

Returning to method500A inFIG. 5A, controller140may transform the imaging marker position coordinates from the bipolar coordinate system to a mechanical coordinate system in step506, so as to correct the x-coordinates of markers measured relative to the negative portion of x-axis402(i.e. markers in leaf bank310). Controller140may execute this transformation by multiplying the x-coordinates of the imaging markers in leaf bank310by −1. In some alternative embodiments, controller140may execute the bipolar-to-mechanical transformation at a different step of method500A, such as at the beginning of step512.

Controller140may calculate minor offset values for leaves in step508.FIG. 7illustrates an exemplary process of calculating the minor offsets in step508. The leaves of MLC200may be identically shaped and dimensioned; for example, the leaf length720, length722of drive coupling330, and length724of body340may be constant for all leaves of MLC200. However, because each marker342is manually and individually placed, minor offset344may vary across the leaves.

At step702, controller140may obtain the imaging marker position coordinates determined in step504. The obtained imaging marker position coordinates may include the imaging marker position coordinates for the imaging marker of each leaf at each position (that is, in the advanced position and in the retracted position). In step704, for one bank of leaves, controller140may calculate a temporal offset valve offsettempfor the imaging marker of each leaf. Controller140may calculate offsettempfor a given marker according to the following:

offesttemp=xouter-xinner2
where xouterrepresents the x-coordinate of the marker when the leaf is at the fully retracted position and xinnerrepresents the x-coordinate of the marker when the leaf is at the fully advanced position. Thus, offsettempmay be considered an average x-coordinate for the marker of a given leaf. Offsettemphas a positive value. In step706, controller140may identify a reference marker from among the imaging markers342in the bank. In some embodiments, the reference marker may be the imaging marker with the largest offsettempvalue (that is, the imaging marker with the x-coordinate which is furthest from the y-axis of coordinate space520). In some alternative embodiments, the reference marker may be the imaging marker with the smallest offsettempvalue (that is, the imaging marker with the x-coordinate which is closest to the y-axis of coordinate space520).

In step708, controller140may calculate the minor offsets344for the remaining leaves in the bank. In some embodiments, the reference marker may be assumed to have a predetermined minor offset. For example, the leaves of MLC200may be manufactured such that each marker342is placed approximately a predetermined distance (e.g. 4.5 millimeters) from the leaf tip304. Controller140may assume that the reference marker has a minor offset344equal to this distance (e.g. 4.5 millimeters) and may utilize the offsettempvalues of the reference leaf and of the remaining leaves in the bank to calculate the minor offsets344of the other leaves. In some embodiments, controller140may determine longitudinal distances (i.e. distances along the x-axis of coordinate space520) between offsettempof the reference marker and the offsettempvalues of the other markers in the bank. Controller140may then subtract the determined longitudinal distances from the predetermined distance to calculate the minor offsets of the leaves. According to an example in which the predetermined distance is 4.5 millimetres, if the controller determines that the offsettempof a given marker is 0.3 millimeters from the offsettempof the reference marker, controller140may determine that the given marker has a minor offset of 4.2 millimeters (i.e. 4.5 mm-0.3 mm). The controller may perform this calculation for all leaves in the bank. In step710, controller140may calculate the minor offsets for the leaves in the other bank according to steps704-708.

As mentioned above, in some alternative embodiments of step706the marker closest to the collimator centre may be selected by controller140as the reference marker. In such embodiments, controller140may assume that the reference marker has a minor offset equal to the predetermined distance (e.g. 4.5 millimeters) and may add the determined longitudinal distances between the reference marker and the remaining markers to the predetermined distance to calculate the minor offsets of the leaves in step708. For example, if it is determined that offsettempof a given marker is 0.1 millimeter from offsettempof the reference marker, controller140may determine that the given marker has a minor offset of 4.6 millimeters (i.e. 4.5 mm+0.1 mm). Controller140may perform this calculation for all remaining leaves in the bank. In step710, controller140may calculate the minor offsets for the leaves in the other bank

Advantageously, controller140may identify the imaging marker with the largest temporal offset value (that is, the marker which is furthest from the collimator centre) as the reference marker in some embodiments because the leaf of that marker is likely to be in the fully retracted configuration. Because the leaves themselves are not visible to camera220, it cannot be confirmed with camera220that all of the leaves are actually in contact with outer end stop622when in the fully retracted position. It is highly likely that the leaf with the imaging marker furthest from the collimator centre is in the fully retracted position, since the imaging marker is drawn away from the collimator centre when the leaf is retracted towards outer end stop622. Therefore, the determined minor offset of the reference marker is highly likely to be accurate, allowing calculation of the other minor offset values to be accurate as well.

Returning to method500A ofFIG. 5A, in step510controller140may calculate leaf position coordinates corresponding to the position of tips304of the collimator leaves relative to coordinate space520. The leaf position coordinates may include an x-coordinate and a y-coordinate of each leaf tip304. For a given leaf at a given position (that is, either the advanced position or the retracted position), the value of the minor offset may be subtracted from the value of the imaging marker x-coordinate to determine the value of the leaf position x-coordinate. In this way, the minor offset may be corrected for and the x-coordinate of the leaf tip identified. For a given leaf at a given position, the value of the leaf position y-coordinate may be equal to the value of the imaging marker y-coordinate. Because minor offset only distorts calculation of the leaf position along the x-axis, the y-coordinates of the leaves do not require correction for the minor offset. Controller140may calculate leaf position coordinates for each leaf in the advanced position and in the retracted position. That is, each leaf of MLC200may be associated with two sets of leaf position coordinates: one set coordinates representing when the leaf is fully advanced and another set of coordinates representing when the leaf is fully retracted.

Once the leaf position coordinates are determined, a distortion coefficient which quantifies the barrel distortion effect associated with the camera lens may be determined in step512.FIG. 8illustrates an exemplary process of calculating a distortion coefficient kin step512. Distortion coefficient k characterizes the barrel distortion behavior of the lens and is different for each lens. Distortion coefficient k can be approximated to a third degree Taylor series and expressed by the following formula:
rdistorted=rundistorted·(1+k·rundistorted2)
where rdistortedis the radius of a point from the lens centre for a distorted image, and rundistortedis the radius of a point from the lens centre for an undistorted image. Since barrel distortion compresses an image, rdistortedis smaller than rundistorted. Since both radii are, by definition, positive:

rdistorted<rundistorted⇒rdistortedrundistorted<1⇒⇒1+k·rundistorted2<1⇒k·rundistorted2<0⇒k<0
Thus, distortion coefficient k must be less than 0. By determining distortion coefficient k of the lens, the barrel distortion can be quantified and removed. Calculation of distortion coefficient k may be performed with the imaging marker positions represented in pixels or in a unit of distance (e.g. microns); however, all calculations must be made in the same units.

Prior to executing step802depicted inFIG. 8, controller140may perform the bipolar-to-mechanical transformation, if the transformation was not performed earlier in method500A. In step802, controller140may determine x- and y-position coordinates of the lens centre within to coordinate space520. The lens centre represents the origin of the distortion introduced by the lens of camera220; that is, the lens centre is the point of the lens through which light passing through the lens is undistorted. In some cases, the lens centre may be at origin530; in other cases, it may be at a different location in coordinate space520. Either the x-coordinate or the y-coordinate of the lens centre may be calculated first by controller140.

An exemplary method of calculating the x-coordinate of the lens centre in step802is depicted inFIG. 9A. For each leaf pair325in MLC200, controller140may generate a function representing a fit between the four sets of leaf position coordinates, the four sets of coordinates including the coordinates for each leaf in the retracted position and in the advanced position. For example, for leaf pair325depicted inFIG. 9A, position902may represent the position coordinates of the first leaf in the fully extended position, and position904may represent the position coordinates of the first leaf in the fully retracted position. Similarly, position906may represent the position coordinates of the second leaf in the fully extended position, and position908may represent the position coordinates of the second leaf in the fully retracted position. Controller140may generate a function910that represents a fit between the four points902-908. In some embodiments, function910may be a second-order polynomial function. Controller140may generate a function910for each leaf pair in MLC200. Controller140may then identify a maximum or minimum912(depending on the curvature) of each generated function910. In some embodiments, due to the barrel distortion effect, controller140may identify a maximum for each leaf pair325above the x-axis of coordinate space520, and a minimum for each leaf pair325below the x-axis of coordinate space520. In a MLC with 80 leaves per bank, controller140may identify 80 maximum or minimum values912. Controller140may then average the x-coordinates of all of the identified maximum or minimum values912to determine the x-coordinate of the lens centre.

In some embodiments, controller140may determine if the identified maximum or minimum for a function910is found on an edge of the coordinate space520. This may occur due to rotation of an image collected in step502and/or due to marker detection errors. Controller140may correct for the rotation and marker detection errors, recalculate the maximum or minimum of the function910, and utilize the recalculated maximum or minimum in determining the x-coordinate of the lens centre. In some embodiments, if controller140determines that the calculated x-coordinate of the lens centre is more than a predetermined distance from the origin530, controller140may determine that the calculated x-coordinate of the lens centre is inaccurate. In such a case, controller140may default the x-coordinate of the lens centre to be equal to zero.

An exemplary method of calculating the y-coordinate of the lens centre in step802is depicted inFIG. 9B. For each bank of leaves in each image, controller140may generate a function representing a fit between the position coordinates of all of the leaves in the bank. For example, inFIG. 9B, 310Amay represent the position coordinates of the leaves in bank310when the bank is in the fully extended position, and310B may represent the position coordinates of the leaves in bank310when the bank is in the fully retracted position. Similarly,320A may represent the position coordinates of the leaves of bank320when the bank is in the fully extended position, and320B may represent the position coordinates of the leaves of bank320when the bank is in the fully retracted position. InFIG. 9B, the leaf position coordinates of310A (which are associated with first bank310) may be situated to the right of the leaf position coordinates of320A (which are associated with second bank320) because the leaves of MLC200may be configured to advance beyond the midway point between banks310,320when moving into their respective fully-advanced positions. Controller140may generate a function920which represents a fit between the leaf position coordinates of all leaves in a given bank at a given position. In the example depicted inFIG. 9B, controller140may generate four functions920, two for each leaf bank310,320. In some embodiments, function920may be a second-order polynomial function. Controller140may then identify a turning point922for each generated function920. For example, turning point922may be the position on function920with the largest x-value. Controller140may then average the y-coordinates of all of the turning points922to determine the y-coordinate of the lens centre.

Controller140may then perform steps804-812to determine distortion coefficient k of the camera lens. Controller140may determine distortion coefficient k only utilizing the leaf position coordinates for one bank of leaves in a single image. Controller140may calculate input coordinates xinputand yinputfor the tip of each leaf as follows:
[xinput,yinput]=[xmeasured−xlens,ymeasured−ylens]
where xmeasuredand ymeasuredare the leaf position coordinates obtained in step510and) xlensand ylensare the x- and y-coordinates of the lens centre determined in step802. Controller140may then generate distorted coordinates xdistortedand ydistortedfor the tip of each leaf; for each leaf, xdistortedand ydistortedmay be set equal to xinputand yinput, respectively.

In step804, for each leaf in the one bank, controller140may determine a distorted radius rdistortedand angle θ of the leaf tip from the origin530as follows:

In step806, controller140may fit the distorted x- and y-coordinates of the leaf tips to a straight line using the root mean square method, and may calculate the slope m of the fit line. In some embodiments, the fit line may not be vertical due to, among other things, slight rotation of camera220relative to the collimator leaves. Controller140may also identify the leaf tip in the bank having an x-coordinate which is furthest from origin530(that is, the leaf tip with the largest x-coordinate value). This leaf may be the leaf that is least distorted by the barrel distortion, since barrel distortion tends to compress images towards the image centre. Controller140may store the x-coordinate of this leaf tip as a variable offset.

Controller140may then generate a straight line with slope m and with an x-intercept equal to offset. From this line, undistorted x- and y-coordinates for each leaf tip may be calculated by controller140as follows:
xundistorted=ydistorted·m+offset
yundistorted=xundistorted·cos(θ)

In steps808and810, based upon the undistorted x- and y-coordinates of the leaf tips, controller140may calculate a provisional distortion coefficient ktempbased upon the relationship between distorted and undistorted radii of the leaves. Provisional distortion coefficient ktempis an approximation of the distortion coefficient of the lens of camera220. In some embodiments, controller140may execute a recursive function which recalculates ktempuntil an associated error value Ekis determined to be below a predetermined threshold, at which time the corrected provisional distortion coefficient ktempmay be stored as distortion coefficient k of the lens.

xundistorted=rundistorted·cos⁡(θ)⇒cos⁡(θ)=xundistortedrundistortedA)rundistorted=xundistorted2+yundistorted2B)
It follows that, for each point in a line:

xdistorted-xundistorted=⁢k·rundistorted3·cos⁡(θ)=⁢k·rundistorted3·xundistortedrundistorted==⁢k·rundistorted2·xundistorted=⁢k·(xundistorted2+yundistorted2)·xundistorted=⁢k·(xundistorted3+yundistorted2·xundistorted)
Accordingly, in step808controller140may calculate a lens distortion coefficient kleaffor each leaf in the one bank according to the following:

In step810, controller140may average the lens distortion coefficient kleaffor all of the leaves in the one bank to determine the provisional lens distortion coefficient ktemp.

Having calculated ktemp, controller140may calculate an error value Ekassociated with ktempand compare it to a predetermined threshold. Controller140may utilize ktempto update rundistortedand rdistortedfor each leaf for a subsequent iteration of the recursive function, based upon the undistorted x- and y-coordinates:
rundistorted=√{square root over (xundistorted2+yundistorted2)}
rdistorted=rundistorted+ktemp·rundistorted3
For each leaf, controller140may calculate new xdistortedand ydistortedvalues based upon the following relationships:

If controller140determines that Ekis below a predetermined threshold (e.g. less than 0.001), ktempmay be determined to be accurate, and controller140may store ktempas the distortion coefficient k of the camera lens. However, if Ekis not below the predetermined threshold, controller140may update the offset value as follows:
offset=offset+Ek
Controller140may utilize the updated offset value and the updated xdistortedand ydistortedvalues for each leaf to calculate new xundistortedand yundistortedvalues for each leaf tip. The slope m of the fit line, the x- and y-coordinates of the lens centre (xlensand ylens), and the angle θ, xinput, and yinputvalues for each leaf may remain unchanged in each iteration. Controller140may repeat steps806-810using updated values to recalculate ktempuntil controller140determines that Ekis less than the predetermined threshold, Controller140may then store ktempas the distortion coefficient k of the lens of camera220. Distortion coefficient k may remain accurate until camera220and/or the camera lens is adjusted or replaced, or when another component of the leaf-imaging configuration, such as light projector240or one of mirrors222,224,242, or244is adjusted or replaced. Such changes may affect the distortion effect, causing k to change. Accordingly, on such an occasion controller140may recalculate the distortion coefficient k.

Referring to step514inFIG. 5A, controller140may utilize the calculated) xlens, ylens, and k values to correct the optical distortion for each leaf in MLC200. Controller140may calculate rdistortedand rundistortedvalues for the tip of each leaf in MLC200according to the following:
[xinput,yinput]=[xmeasured−xlens,ymeasured−ylens]
rdistorted=√{square root over ((xinput)−xlens)2+(yinput−ylens)2)}
rdistorted=rundistorted·(1+k·rundistorted2)=rundistorted+k·rundistorted3
where xmeasuredand ymeasuredare the leaf position coordinates obtained in step510. Controller140may solve these equations to determine the undistorted radius rundistortedfor each leaf tip. Controller140may also calculate an angle θ for each leaf tip, which may be the same for both the distorted and undistorted position coordinates, as follows:

θ=atan⁡(ydistortedxdistorted)
Controller140may determine undistorted x- and y-coordinates (“corrected leaf position coordinates”) for each leaf tip as follows:
xundistorted=rundistorted·cos(θ)
yundistorted=rundistorted·sin(θ)
The corrected leaf position coordinates xundistortedand yundistortedmay represent the true x- and y-position coordinates of each leaf tip within coordinate space520, having been corrected to account for the optical distortion of camera220.

In step514, controller140may additionally recalculate the minor offset for each leaf by determining a distance, along the x-axis, between the imaging marker x-coordinate and xundistorted. In some embodiments, controller140may calculate the minor offset for the leaf in the retracted position and for the leaf in the advanced position, and may average the two values to generate a corrected minor offset value. Advantageously, this recalculation may produce a more accurate measurement of the minor offset of each leaf because controller140has corrected for the optical distortion of camera220.

In step516, controller140may store the corrected minor offset values of the leaves in memory142. In future sessions, controller140may receive the corrected minor offset values from the memory142and utilize them, for example, to control leaf placement during a radiotherapy session. The corrected minor offset values may remain accurate until a leaf of MLC200and/or an imaging marker342is replaced. In such an occasion, controller140may recalculate the minor offsets and store them in memory as the corrected minor offset values. Distortion coefficient k need not be recalculated when a leaf of MLC200or an imaging marker342is replaced because the optical characteristics of the camera lens remains unchanged.

In step518, controller140may control movement of the leaves utilizing the corrected leaf position coordinates and/or the corrected minor offset values. For example, controller140may advance a leaf to a desired position based upon the corrected position coordinates of that leaf. Because xundistortedand yundistortedare known for each leaf, controller140may accurately determine the distance to move each leaf to achieve a desired leaf position, without inadvertently over- or under-advancing the leaf. Additionally or alternatively, controller140may utilize the corrected minor offsets to accurately place the tip of each leaf based upon the detected marker position. Advantageously, controller140may place each leaf tip in a desired position, thus forming the correct shaping window for a radiotherapy beam. In some embodiments, controller140can control the MLC (step518) prior to storing the corrected minor offsets in memory (step516).

FIG. 5Cillustrates another exemplary calibration method500B for a multi-leaf collimator, such as MLC200. Method500B may also be a processor-executed method. In some embodiments, method500B may be executed by controller140. In method500B, controller140may execute steps502-514of method500A. In step515B, controller140may generate a leaf position error function for each leaf in MLC200. A leaf position error function may characterize the optical distortion of each leaf in MLC200by the lens of camera220; that is, a position error function may characterize the spatial relationship between the distorted and undistorted positions of the imaging marker of each collimator leaf. Referring toFIG. 10, in step1002, controller140may identify at least two positions, in pixels, for the leaves. For example, controller140may identify a fully retracted and a fully extended position for each leaf. Alternatively, controller140may identify two or more alternative positions for each leaf. In step1004, controller140may apply distortion to the identified positions for each leaf. The distortion may be based, at least in part, on the characteristics of the lens of camera220. In step1006, controller140may calculate the error, along a travel direction of the leaf, between the distorted and undistorted positions for each leaf. The travel directions of the leaves may be parallel to the x-axis inFIG. 5B, as the leaves of MLC200may only be configured for one-dimensional advancement and retraction in the x-direction. In step1008, controller140may convert the calculated error from pixels into a unit of distance (e.g. millimeters or microns) using the predetermined conversion factor discussed above, which may be constant for all leaves of MLC200. In step1010, controller140may generate a position error function for each leaf by fitting a function to the converted error. In some embodiments, the position error function may be a third order polynomial function. The position error function for each leaf may receive the distorted x-coordinate of the imaging marker as input and may output the longitudinal distance between the distorted and undistorted x-coordinates of the imaging marker.

In step516B, controller140may store the corrected minor offset values and the position error function coefficients in memory142. In future sessions, controller140may receive the corrected minor offset values and/or the position error function coefficients from the memory142and utilize them, for example, to control leaf placement during a radiotherapy session. The corrected minor offset values may remain accurate until a leaf of MLC200and/or an imaging marker342is replaced. In such an occasion, controller140may recalculate the minor offsets and store them in memory as the corrected minor offset values. The position error function coefficients may remain accurate until camera220and/or the camera lens is replaced, or when another component of the leaf-imaging configuration, such as light projector240or one of mirrors222,224,242, or244is replaced.

In step518B, controller140may utilize the corrected minor offsets and position error functions to accurately determine the leaf positions and to control movement of the leaves. For example, controller140may receive imaging marker position data from camera220and may utilize the position error functions to determine the true positions of the imaging markers. Controller140may then use the corrected minor offset values to determine the positions of leaf tips304and may move the tips to desired beam-shaping positions. Advantageously, controller140may place each leaf tip in a desired position, thus forming the correct shaping window for a radiotherapy beam.

Advantageously, the calibration methods of the present disclosure may accurately quantify and correct for the barrel distortion of camera220and the manufacturing inconsistencies of the minor offsets in a shorter period of time and with fewer computing steps than prior calibration methods. As a result, accurate control of the collimator leaf positions may be achieved while also reducing the length of time and the number of steps required to calibrate the MLC and to execute a radiotherapy session. This may be particularly beneficial to research hospitals and smaller clinics which may not have available time to perform radiation-based calibration.

FIG. 11Aillustrates an exemplary radiotherapy method1100A. Method1100A may be a processor-executed method. In some embodiments, the steps of method1100A may be executed by the same processor, such as controller140. Alternatively, one or more steps of method1100A can be executed by separate processors.

In step1102, controller140may receive a radiotherapy treatment plan for treating a target tissue of a patient, such as a tumour. Controller140may receive the treatment plan from memory, such as memory142. In some embodiments, controller140may have previously generated the radiotherapy treatment plan based upon, among other things, images of the target tissue, and may have stored the treatment plan in memory142. In other embodiments, the radiotherapy treatment plan may be generated by a different processor and may be executed by controller140. The radiotherapy treatment plan may include radiation dose and radiation beam shape, as well as other parameters such as beam angles, dose-histogram-volume information, the number of radiation beams to be used during radiotherapy, the dose per beam, and the like. Factors such as the location and size of the target tumour may be taken into consideration to achieve a balance between efficient treatment of the tumour (e.g., such that the tumour receives enough radiation dose for an effective therapy) and low irradiation of the healthy surrounding tissue (e.g., the healthy surrounding tissue receives as low a radiation dose as possible). One of ordinary skill in the art will appreciate that the radiotherapy treatment plan described herein is merely exemplary, and that any suitable radiotherapy treatment plan may be utilized according to the present disclosure.

In step1104, controller140may determine radiotherapy position coordinates for the tip of each leaf. The radiotherapy position coordinates may be determined relative to coordinate space520and may represent the leaf tip positions for shaping radiation beam122according to the received radiotherapy treatment plan.

In step1106, controller140may receive the corrected minor offset values for each leaf and a set of calibration coefficients, for example from memory142. The calibration coefficients may be coefficients of polynomial functions which characterize the optical distortion for each leaf within a bank of leaves310,320. For each bank of leaves, the optical distortion may be characterized by three third-order polynomials; accordingly, controller140may receive 24 calibration coefficients (2 banks×3 polynomials per bank×4 coefficients per polynomial). The calibration coefficients may be generated from data received from a plurality of radiation heads, optionally including radiation head104. All of the radiation heads may have the same model camera220, the same type of camera lens, and the same leaf-imaging configuration (for example, the arrangement of light projector240and the mirrors222,224,242, and244depicted inFIG. 2). Accordingly, the calibration coefficients may be representative of the optical distortion effects in all MLCs with the same model camera, camera lens, and leaf-imaging configuration.

In some embodiments, controller140may generate the calibration coefficients; in some alternative embodiments, the calibration coefficients may be generated by a separate processor. The calibration coefficients may be generated in real-time, or may be generated before execution of method1100A and accessed (e.g. from a memory) during execution of method1100A. A processor (e.g. controller140) may receive the data from the plurality of radiation heads and generate the lens centre, k value, and leaf position error functions for each head (e.g. according to method500B). The processor may perform filtering to identify and remove outlier data. Such outlier data may be due to mechanical variation or tolerance; by removing the outliers, the processor may ensure that the remaining data is more representative of the camera lens and leaf-imaging configuration. The filtered data from the plurality of radiation heads may be averaged or otherwise combined to produce representative data, which the processor may fit with functions to produce the calibration coefficients. When data is received from an additional radiation head, or when a component of system100(e.g. the lens of camera220) is altered or replaced, the processor may recalculate the calibration coefficients and store them (e.g. in memory142).

In step1106, controller140may receive the calibration coefficients and in step1108, controller140may use the calibration coefficients to generate three distortion-modeling functions for each bank of leaves (thus, six distortion modeling functions in total). In some embodiments, the distortion modeling functions may be third-order polynomial functions, each having four coefficients. Thus, controller140may receive 24 calibration coefficients in step1106. The distortion-modeling functions may characterize the optical distortion of each leaf in the corresponding leaf bank; that is, the distortion-modeling functions may receive the number of a leaf within a bank (e.g. between 1 and 80) and may generate values that quantify the optical distortion associated with the given leaf. Advantageously, the distortion-modeling functions require far fewer coefficients than the leaf position error functions generated in step1010: the former requires just 24 coefficients, while the later requires 480 coefficients. As a result, less memory is required to store the coefficients. In addition, the distortion modeling functions may quantify the optical distortion more accurately due to the removal of outliers during the filtering processes explained above.

For a given bank of leaves (e.g.310or320), controller140may generate the following distortion-modeling functions:
ai=A1·i3−B1·i2+C1·i+D1
bi=A2·i3−B2·i2+C2·i+D2
ci=A3·i3−B3·i2+C3·i+D3
where i is the number of a leaf within the bank (e.g. with 1≤i≤80), A1-3, B1-3, C1-3, and D1-3are the twelve calibration coefficients for the bank of leaves, and ai, bi, and ciare values which quantify the optical distortion for each leaf. Controller140may calculate ai, bi, and cifor each leaf in the bank of leaves by plugging in the leaf number i to the distortion modeling functions.

In step1110, controller140may generate a position error function for each leaf of MLC200using the calculated ai, bi, and civalues. Similar to the position error functions generated in step1010, the position error functions generated in step1110may characterize the error in the determined imaging marker position caused by the optical distortion of the camera lens. For a given leaf i, controller140may generate a leaf position error function as follows:
opticDeltai=ai·xdistorted3−bi·xdistorted+ci·xdistorted
where opticDeltaiquantifies the error in the determined imaging marker position along the x-axis caused by the optical distortion (in a unit of distance such as microns) and where xdistortedis the x-coordinate of the imaging marker (relative to coordinate space520) as detected by camera220. Controller140may generate a leaf position error function for each leaf in MLC200, and may use the functions to generate an opticDeltaivalue for each leaf. The y-coordinates of the leaves may not require correction because each leaf may be fixed along the y-axis of coordinate space520; thus, the y-position of each leaf is known at all times and need not be corrected.

In step1112, controller140may calculate the undistorted x-coordinate xundistortedof each leaf tip (in a unit of distance such as microns) as follows:
xundistorted=xdistorted−xMO+opticDeltai
where xMOis the minor offset of the leaf accessed from memory in step1106. Thus, controller140may correct for the barrel distortion of the camera lens and the minor offset values, and may determine the true position of each leaf tip. In step1114, controller140may advance and/or retract each leaf to its respective radiotherapy position coordinates. Because the true position of each leaf is known, controller140may accurately determine the distance to move each leaf to position it at the radiotherapy position coordinates, without over- or under-advancing the leaf. In step1116, controller may control radiation head104to deliver radiation to the target tumour. Because the leaves of MLC200are accurately positioned, irradiation of healthy tissue may be minimized or eliminated while ensuring that the entire area of the target tumour is irradiated according to the radiotherapy treatment plan.

FIG. 11Billustrates another exemplary radiotherapy method1100B. Method11008may also be a processor-executed method. In some embodiments, the steps of method1100B may be executed by the same processor, such as controller140. Alternatively, one or more steps of method1100B may be executed by separate processors. In method1100B, controller140may execute steps1102and1104of method1100A. In step1106B, controller140may receive the corrected minor offset values of the leaves, as well as the coefficients of the leaf position error functions generated in step1010. In step1110B, controller140may regenerate the position error function for each leaf using the received coefficients. In step1112, controller140may use the functions to calculate the opticDeltaivalue and the xundistortedvalue for each leaf. Controller140may execute steps1114and1116of method1100A.

Various operations or functions are described herein, which may be implemented or defined as software code or instructions. Such content may be directly executable (“object” or “executable” form), source code, or difference code (“delta” or “patch” code). Software implementations of the embodiments described herein may be provided via an article of manufacture with the code or instructions stored thereon, or via a method of operating a communication interface to send data via the communication interface. A machine- or computer-readable storage medium may cause a machine to perform the functions or operations described, and includes any mechanism that stores information in a form accessible by a machine (e.g., computing device, electronic system, and the like), such as recordable/non-recordable media (e.g., read only memory (ROM), random access memory (RAM), magnetic disk storage media, optical storage media, flash memory devices, and the like). A communication interface includes any mechanism that interfaces to any of a hardwired, wireless, optical, and the like, medium to communicate to another device, such as a memory bus interface, a processor bus interface, an Internet connection, a disk controller, and the like. The communication interface can be configured by providing configuration parameters and/or sending signals to prepare the communication interface to provide a data signal describing the software content. The communication interface can be accessed via one or more commands or signals sent to the communication interface.

Embodiments may be implemented with computer-executable instructions. The computer-executable instructions may be organized into one or more computer-executable components or modules. Embodiments may be implemented with any number and organization of such components or modules. For example, aspects of the disclosure are not limited to the specific computer-executable instructions or the specific components or modules illustrated in the figures and described herein. Other embodiments may include different computer-executable instructions or components having more or less functionality than illustrated and described herein.