Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #489: Allow odd no. of TARGET/ISOCENTER leaves in SYNCHDMLC #514

Merged
merged 1 commit into from
Jan 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 23 additions & 17 deletions HEN_HOUSE/doc/src/pirs509a-beamnrc/inputformats/SYNCHDMLC.inp
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@
NGROUP_$SYNCHDMLC = number of groups of adjacent leaves where
all leaves in a group are:
1. FULL leaves
2. HALF TARGET/ISOCENTER pairs with TARGET leaf
on the -X (ORIENT=0) or -Y (ORIENT=1) side
3. QUARTER TARGET/ISOCENTER pairs
2. HALF TARGET/ISOCENTER leaves
3. QUARTER TARGET/ISOCENTER leaves
NGROUP_$SYNCHDMLC defaults to 3 if set <=0
MODE_$SYNCHCMLC = 0 for single setting of leaf openings (static
field)
Expand Down Expand Up @@ -135,7 +134,7 @@
leaf on +X [ORIENT=0] or +Y [ORIENT=1] side of ISOCENTER
leaf only) ZTONGUE_$SYNCHDMLC(1)<=ZGROOVE_$SYNCHDMLC(3)

Note: If there are no HALF leaf pairs in your model, you can input
Note: If there are no HALF leaves in your model, you can input
blanks, zeroes, or arbitrary floating-point numbers for these
cross section dimensions.

Expand Down Expand Up @@ -206,15 +205,22 @@
NUM_LEAF_$SYNCHDMLC(I): Number of adjacent leaves in group I
LEAFTYPE: Type of leaf in group I.
Set to: 1 for FULL leaves
2 for HALF TARGET/ISOCENTER pair with
TARGET leaf on the -X (ORIENT=0)
or -Y (ORIENT=1) side
3 for QUARTER TARGET/ISOCENTER pair with
TARGET leaf on the -X (ORIENT=0)
or -Y (ORIENT=1) side

Note: If LEAFTYPE is 2 or 3, then you must have an even number
of leaves in the group.
2 for HALF TARGET/ISOCENTER leaves.
Starting leaf on -X (ORIENT=0) or -Y
(ORIENT=1) side depends on adjacent leaf:
If adjacecent leaf is a HALF or QUARTER
TARGET, then it will be HALF ISOCENTER.
Otherwise, it will be HALF TARGET.
3 for QUARTER TARGET/ISOCENTER leaves.
Starting leaf on -X (ORIENT=0) or -Y
(ORIENT=1) side will depend on the
adjacent leaf: If it is a HALF or
QUARTER TARGET leaf, then the starting
leaf will be QUARTER ISOCENTER.
Otherwise, it will be QUARTER TARGET.

Restrictions: 1. Cannot have a HALF or QUARTER TARGET leaf on the -ve
side of a FULL leaf.

9 START_$SYNCHDMLC (F15.0) : the start position (cm) wrt the CAX of
leaf 1 as projected to ZMIN_$SYNCHDMLC.
Expand Down Expand Up @@ -379,7 +385,7 @@
The collimator starts at Z=47.0 cm, is 7 cm thick and has 80 tungsten
leaves opening in the X direction. Leaves 1-10 and 71-80 are FULL
(type 1), leaves 11-24 and 57-70 are HALF TARGET/HALF ISOCENTER
pairs, and leaves 25-56 are QUARTER TARGET/QUARTER ISOCENTER pairs.
leaves, and leaves 25-56 are QUARTER TARGET/QUARTER ISOCENTER leaves.
The Z focus of the leaf sides is at Z=0 cm which is the position of the
source. The leaf ends are straight and also focused at Z=0 cm.
In this example, the mlc is being run in step-and-shoot mode
Expand All @@ -402,9 +408,9 @@
0.11, 0.04, 0.04, 0.035, 0.08, 0.065, 47.2, 47.3, 50.53, 50.52, 52.9, 53.1,
1.7, 53.6, 53.9, QUARTER ISOCENTER cross-section
10, 1, FULL leaves
14, 2, HALF TARGET/ISOCENTER pairs
32, 3, QUARTER TARGET/ISOCENTER pairs
14, 2, HALF TARGET/ISOCENTER pairs
14, 2, HALF TARGET/ISOCENTER leaves
32, 3, QUARTER TARGET/ISOCENTER leaves
14, 2, HALF TARGET/ISOCENTER leaves
10, 1, FULL leaves
-10.5, START
0.005, LEAFGAP
Expand Down
38 changes: 22 additions & 16 deletions HEN_HOUSE/doc/src/pirs509a-beamnrc/pirs509a-beamnrc.tex
Original file line number Diff line number Diff line change
Expand Up @@ -6842,8 +6842,8 @@ \subsubsubsection{SYNCMLCE}
\subsubsubsection{SYNCHDMLC}
SYNCHDMLC is a version of SYNCVMLC optimized for modeling the High-definition Multileaf
Collimator (HDMLC 120) available on TrueBeam and Novalis linacs. SYNCHDMLC features five
possible leaf cross sections: FULL, HALF TARGET/HALF ISOCENTER pairs, and QUARTER TARGET/QUARTER ISOCENTER
pairs. FULL leaves are similar to FULL leaves in DYNVMLC/SYNCVMLC. HALF TARGET/HALF ISOCENTER leaves are
possible leaf cross sections: FULL, HALF TARGET/HALF ISOCENTER leaves, and QUARTER TARGET/QUARTER ISOCENTER
leaves. FULL leaves are similar to FULL leaves in DYNVMLC/SYNCVMLC. HALF TARGET/HALF ISOCENTER leaves are
equivalent to the TARGET/ISOCENTER leaves in DYNVMLC/SYNCVMLC. QUARTER TARGET/QUARTER ISOCENTER have the
same shaped cross sections as the HALF TARGET/HALF ISOCENTER leaves, but the cross section perpendicular to
the opening direction is generally thinner. Similar to other synchronized CMs, leaf opening
Expand Down Expand Up @@ -8463,8 +8463,9 @@ \subsubsection{SYNCHDMLC}

SYNCHDMLC is a CM coded by Lobo \& Popescu and based on an earlier code by Borges et al\cite{Bo12} for
modeling the high-definition micro mlc (HD120) available on TrueBeam and Novalis linacs. In overall
design it is similar to DYNVMLC/SYNCVMLC but features two different types of TARGET/ISOCENTER leaf pairs:
HALF TARGET/HALF ISOCENTER and QUARTER TARGET/QUARTER ISOCENTER. In terms of leaf cross-section
design it is similar to DYNVMLC/SYNCVMLC but features two different types of TARGET/ISOCENTER leaves:
HALF TARGET/HALF ISOCENTER and QUARTER TARGET/QUARTER ISOCENTER. In addition, the last TARGET or ISOCENTER
leaf in a group need not have a matching ISOCENTER or TARGET counterpart. In terms of leaf cross-section
(perpendicular to the opening direction), these are
similar to the TARGET/ISOCENTER leaves in DYNVMLC, with HALF TARGET/HALF ISOCENTER leaves being
wider than the QUARTER TARGET/QUARTER ISOCENTER leaves.
Expand All @@ -8490,10 +8491,9 @@ \subsubsection{SYNCHDMLC}
user must input (see Table~\ref{dynvmlc_tab} for label key).
QUARTER leaf cross-sections have similar Z-dimensions
to HALF leaf cross-sections but are thinner in X.
TARGET/ISOCENTER leaves must always occur in pairs.
In this illustration leaves 1, 2, 11, 12 are FULL; leaves 3, 4, 9, 10
are HALF TARGET/HALF ISOCENTER pairs; leaves 5--8 are QUARTER TARGET/QUARTER ISOCENTER
pairs.}
are HALF TARGET/HALF ISOCENTER leaves; leaves 5--8 are QUARTER TARGET/QUARTER ISOCENTER
leaves. Unlike DYNVMLC and SYNCVMLC, an odd number of TARGET/ISOCENTER leaves may be specified in a group.}
\label{synchdmlc_fig}
\end{figure}

Expand All @@ -8505,7 +8505,7 @@ \subsubsection{SYNCHDMLC}
Table~\ref{dynvmlc_tab}). In general, QUARTER leaves
are used closer to middle of the mlc, and, while their Z-dimensions are similar to those for their HALF counterparts, they
are significantly thinner in the X- ({\tt ORIENT}=0) or Y- ({\tt ORIENT}=1)
dimension. HALF TARGET/HALF ISOCENTER leaves must occur in pairs, as must QUARTER TARGET/QUARTER ISOCENTER leaves.
dimension.

\index{SYNCHDMLC!restrictions on leaf dimensions}
Similar to DYNVMLC, leaf cross-section dimensions must be defined so that the Z and X ({\tt ORIENT}=0) or Y ({\tt ORIENT}=1) grid lines
Expand All @@ -8523,14 +8523,20 @@ \subsubsection{SYNCHDMLC}
QUARTER ISOCENTER/HALF TARGET ({\tt zg}$_{QUARTER~ISOCENTER}$ $\geq$ {\tt zt}$_{HALF~TARGET}$)\\
and HALF ISOCENTER/FULL (ie {\tt zg}$_{HALF~ISOCENTER}$ $\geq$ {\tt zt}$_{FULL}$).

As in DYNVMLC, rather than specifying the type of each leaf, the user is able to specify groups
of adjacent leaves all having the same type. Since HALF TARGET/HALF ISOCENTER leaves and
QUARTER TARGET/QUARTER ISOCENTER leaves must always occur in pairs, there are really
only three types to choose from. This also means there must be an even number of
HALF or QUARTER TARGET/ISOCENTER leaves. Also note that, even though the user
must specify cross-sections for all leaf types, they need not use all types in a
given MLC simulation. Thus, there may be no FULL leaves, HALF TARGET/ISOCENTER
pairs, or QUARTER TARGET/ISOCENTER pairs in the simulation.
As in DYNVMLC and SYNCVMLC, rather than specifying the type of each leaf in the MLC, the user is able to specify groups
of adjacent leaves of the same type. Since TARGET leaves always alternate with ISOCENTER leaves within a group,
for the purpose of defining a leaf group, HALF or QUARTER TARGET/ISOCENTER leaves are considered one type.
Unlike DYNVMLC and SYNCVMLC, however, the number of TARGET/ISOCENTER leaves in a group does not have to be even. Thus,
the final TARGET or ISOCENTER leaf in a group need not be matched by its ISOCENTER or TARGET (respectively)
counterpart. If a group of TARGET/ISOCENTER is defined adjacent to another group of TARGET/ISOCENTER leaves, the
first leaf in the group will automatically be chosen to match the last leaf of the previous group. Thus, if
the last leaf of the previous group was a QUARTER or HALF TARGET leaf, then the first leaf of the current
group will be a QUARTER or HALF ISOCENTER leaf, and vice versa. In terms of leaf groups, the only restriction
is that the numbers and types of leaves cannot be specified so that a QUARTER or HALF TARGET leaf ends up
immediately adjacent to a FULL leaf on the -X (ORIENT=0) or -Y (ORIENT=1) side.
Finally, note that the user need not use all leaf types in a simulated MLC. Thus, there may be no FULL leaves, HALF TARGET/ISOCENTER
leaves, or QUARTER TARGET/ISOCENTER leaves in the simulation. In this case, inputs for the
cross-section parameters of the unused leaves can be left as blanks or zeros.

Similar to DYNVMLC and SYNCVMLC, leaf ends can be straight, focused ({\tt ENDTYPE}=1) or cylindrical
({\tt ENDTYPE}=0). For straight, focused ends, the user must specify the Z-position of the
Expand Down
110 changes: 73 additions & 37 deletions HEN_HOUSE/omega/beamnrc/CMs/SYNCHDMLC_cm.mortran
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,8 @@
"I> NGROUP_$SYNCHDMLC = number of groups of adjacent leaves where
"I> all leaves in a group are:
"I> 1. FULL leaves
"I> 2. HALF TARGET/ISOCENTER pairs with TARGET leaf
"I> on the -X (ORIENT=0) or -Y (ORIENT=1) side
"I> 3. QUARTER TARGET/ISOCENTER pairs
"I> 2. HALF TARGET/ISOCENTER leaves
"I> 3. QUARTER TARGET/ISOCENTER leaves
"I> NGROUP_$SYNCHDMLC defaults to 3 if set <=0
"I> MODE_$SYNCHCMLC = 0 for single setting of leaf openings (static
"I> field)
Expand Down Expand Up @@ -362,7 +361,7 @@
"I> leaf on +X [ORIENT=0] or +Y [ORIENT=1] side of ISOCENTER
"I> leaf only) ZTONGUE_$SYNCHDMLC(1)<=ZGROOVE_$SYNCHDMLC(3)
"I>
"I> Note: If there are no HALF leaf pairs in your model, you can input
"I> Note: If there are no HALF leaves in your model, you can input
"I> blanks, zeroes, or arbitrary floating-point numbers for these
"I> cross section dimensions.
"I>
Expand Down Expand Up @@ -434,15 +433,22 @@
"I> NUM_LEAF_$SYNCHDMLC(I): Number of adjacent leaves in group I
"I> LEAFTYPE: Type of leaf in group I.
"I> Set to: 1 for FULL leaves
"I> 2 for HALF TARGET/ISOCENTER pair with
"I> TARGET leaf on the -X (ORIENT=0)
"I> or -Y (ORIENT=1) side
"I> 3 for QUARTER TARGET/ISOCENTER pair with
"I> TARGET leaf on the -X (ORIENT=0)
"I> or -Y (ORIENT=1) side
"I>
"I> Note: If LEAFTYPE is 2 or 3, then you must have an even number
"I> of leaves in the group.
"I> 2 for HALF TARGET/ISOCENTER leaves.
"I> Starting leaf on -X (ORIENT=0) or -Y
"I> (ORIENT=1) side depends on adjacent leaf:
"I> If adjacecent leaf is a HALF or QUARTER
"I> TARGET, then it will be HALF ISOCENTER.
"I> Otherwise, it will be HALF TARGET.
"I> 3 for QUARTER TARGET/ISOCENTER leaves.
"I> Starting leaf on -X (ORIENT=0) or -Y
"I> (ORIENT=1) side will depend on the
"I> adjacent leaf: If it is a HALF or
"I> QUARTER TARGET leaf, then the starting
"I> leaf will be QUARTER ISOCENTER.
"I> Otherwise, it will be QUARTER TARGET.
"I>
"I> Restrictions: 1. Cannot have a HALF or QUARTER TARGET leaf on the -ve
"I> side of a FULL leaf.
"I>
"I> 9 START_$SYNCHDMLC (F15.0) : the start position (cm) wrt the CAX of
"I> leaf 1 as projected to ZMIN_$SYNCHDMLC.
Expand Down Expand Up @@ -607,7 +613,7 @@
"I> The collimator starts at Z=47.0 cm, is 7 cm thick and has 80 tungsten
"I> leaves opening in the X direction. Leaves 1-10 and 71-80 are FULL
"I> (type 1), leaves 11-24 and 57-70 are HALF TARGET/HALF ISOCENTER
"I> pairs, and leaves 25-56 are QUARTER TARGET/QUARTER ISOCENTER pairs.
"I> leaves, and leaves 25-56 are QUARTER TARGET/QUARTER ISOCENTER leaves.
"I> The Z focus of the leaf sides is at Z=0 cm which is the position of the
"I> source. The leaf ends are straight and also focused at Z=0 cm.
"I> In this example, the mlc is being run in step-and-shoot mode
Expand All @@ -630,9 +636,9 @@
"I> 0.11, 0.04, 0.04, 0.035, 0.08, 0.065, 47.2, 47.3, 50.53, 50.52, 52.9, 53.1,
"I> 1.7, 53.6, 53.9, QUARTER ISOCENTER cross-section
"I> 10, 1, FULL leaves
"I> 14, 2, HALF TARGET/ISOCENTER pairs
"I> 32, 3, QUARTER TARGET/ISOCENTER pairs
"I> 14, 2, HALF TARGET/ISOCENTER pairs
"I> 14, 2, HALF TARGET/ISOCENTER leaves
"I> 32, 3, QUARTER TARGET/ISOCENTER leaves
"I> 14, 2, HALF TARGET/ISOCENTER leaves
"I> 10, 1, FULL leaves
"I> -10.5, START
"I> 0.005, LEAFGAP
Expand Down Expand Up @@ -1136,6 +1142,7 @@ character*256 mlc_file;
CHARACTER*80 MLC_TITLE; "T> title line in mlc_file
$REAL INDEXTMP; "T>temporary input variable for field indices in dynamic and
" step-and-shoot simulations
$LOGICAL check_full_qtr;
" **************************************************************** "

" STEP I : INITIALIZE PARAMETERS
Expand All @@ -1147,7 +1154,7 @@ $REAL INDEXTMP; "T>temporary input variable for field indices in dynamic and
"I. GET THE TITLE "
"================ "
;
OUTPUT;(/' Next component is a VARIAN type MLC'/' Title: ',$);
OUTPUT;(/' Next component is a VARIAN HD 120 MLC'/' Title: ',$);
MINPUT ($SYNCHDMLC) TITLE_$SYNCHDMLC;(60A1);
"MINPUT is a replacement macro with EOF and
"ERR branching to :EOF_{P1}: and :ERR_{P1}:
Expand Down Expand Up @@ -1360,12 +1367,15 @@ OUTPUT;(' ');
NUM_FULL=0;
NUM_HLF=0;
NUM_QTR=0;
check_full_qtr = .FALSE.;
DO I=1,NGROUP_$SYNCHDMLC [
OUTPUT I;
(' Group ',I3,':'/
' No. of leaves, leaf type (1. FULL leaves--the default, '/
' 2. HALF TARGET/ISOCENTER pairs with TARGET leaf on -X or -Y side'/
' 3. QUARTER TARGET/ISOCENTER pairs with TARGET leaf on -X or -Y side)'/
' 2. HALF TARGET/ISOCENTER leaves with TARGET or ISOCENTER leaf on -X',
' or -Y side'/
' 3. QUARTER TARGET/ISOCENTER leaves with TARGET or ISOCENTER leaf on -X',
' or -Y side)'/
' :',$);
MINPUT ($SYNCHDMLC) NUM_LEAF_$SYNCHDMLC(I), LEAFTYPE; (2I5);
OUTPUT NUM_LEAF_$SYNCHDMLC(I), LEAFTYPE; (2I5);
Expand All @@ -1380,39 +1390,46 @@ DO I=1,NGROUP_$SYNCHDMLC [
' Leaf type for group ',I3,' not recognized.'/
' Will default to 1.'//);
]
IF(MOD(NUM_LEAF_$SYNCHDMLC(I),2)~=0 & (LEAFTYPE=2 |
LEAFTYPE=3) )[
OUTPUT ICM_$SYNCHDMLC,I;
(//' ***ERROR IN CM ',I3,' ($SYNCHDMLC)'/
' Leaf group ',I3,' consists of TARGET/ISOCENTER pairs but'/
' does not have an even number of leaves.'//);
IERR_GEOM(ICM_$SYNCHDMLC)=IERR_GEOM(ICM_$SYNCHDMLC)+1;
]
"now set LEAFTYPE for each leaf"
DO J=1,NUM_LEAF_$SYNCHDMLC(I)[
K=K+1;
IF(LEAFTYPE=1)[
LEAFTYPE_$SYNCHDMLC(K)=1;
NUM_FULL=NUM_FULL+1;
IF(K>1)[
IF(LEAFTYPE_$SYNCHDMLC(K-1) = 2 | LEAFTYPE_$SYNCHDMLC(K-1) = 4)[
OUTPUT ICM_$SYNCHDMLC;
(//' ***ERROR IN CM ',I3,' ($SYNCHDMLC)'/
' Cannot have TARGET leaf on -ve side of FULL leaf.'//);
IERR_GEOM(ICM_$SYNCHDMLC)=IERR_GEOM(ICM_$SYNCHDMLC)+1;

]
ELSEIF(LEAFTYPE_$SYNCHDMLC(K-1) = 5)[
check_full_qtr=.TRUE.;
]
]
]
ELSEIF(LEAFTYPE=2)["half target/isocenter pair"
IF(MOD(J,2)~=0)["target leaf"
LEAFTYPE_$SYNCHDMLC(K)=2;
ELSEIF(LEAFTYPE=2)["half target/isocenter leaf"
IF(K>1 & (LEAFTYPE_$SYNCHDMLC(K-1)=4 | LEAFTYPE_$SYNCHDMLC(K-1)=2))[
LEAFTYPE_$SYNCHDMLC(K)=3; "isocenter leaf"
]
ELSE[
LEAFTYPE_$SYNCHDMLC(K)=3;
LEAFTYPE_$SYNCHDMLC(K)=2; "target leaf"
]
NUM_HLF=NUM_HLF+1;
]
ELSE ["quarter target/isocenter pair"
IF(MOD(J,2)~=0)["target leaf"
LEAFTYPE_$SYNCHDMLC(K)=4;
ELSE ["quarter target/isocenter leaf"
IF(K>1 & (LEAFTYPE_$SYNCHDMLC(K-1)=4 | LEAFTYPE_$SYNCHDMLC(K-1)=2))[
LEAFTYPE_$SYNCHDMLC(K)=5; "isocenter leaf"
]
ELSE[
LEAFTYPE_$SYNCHDMLC(K)=5;
LEAFTYPE_$SYNCHDMLC(K)=4;
IF(K>1 & LEAFTYPE_$SYNCHDMLC(K-1)=1)[
check_full_qtr=.TRUE.;
]
]
NUM_QTR=NUM_QTR+1;
]
]
]
]
;
Expand Down Expand Up @@ -2000,6 +2017,25 @@ IF(NUM_HLF>0 & NUM_QTR>0) [
]
]

IF(check_full_qtr) [ "Ya never know"
IF(ZGROOVE_$SYNCHDMLC(5)<=ZTONGUE_$SYNCHDMLC(1))[
OUTPUT ICM_$SYNCHDMLC;
(//' ***ERROR IN CM ',I3,' ($SYNCHDMLC) in leaf definition:'/
' ZGROOVE_$SYNCHDMLC(5)<=ZTONGUE_$SYNCHDMLC(1).'/
' QUARTER ISOCENTER leaf will not fit with'/
' FULL leaf if ISOCENTER leaf is on -X or -Y side.'//);
IERR_GEOM(ICM_$SYNCHDMLC)=IERR_GEOM(ICM_$SYNCHDMLC)+1;
]
IF(ZTONGUE_$SYNCHDMLC(4)>=ZGROOVE_$SYNCHDMLC(1))[
OUTPUT ICM_$SYNCHDMLC;
(//' ***ERROR IN CM ',I3,' ($SYNCHDMLC) in leaf definition:'/
' ZTONGUE_$SYNCHDMLC(4)>=ZGROOVE_$SYNCHDMLC(1).'/
' QUARTER TARGET leaf will not fit with'/
' FULL leaf if FULL leaf is on -X or -Y side.'//);
IERR_GEOM(ICM_$SYNCHDMLC)=IERR_GEOM(ICM_$SYNCHDMLC)+1;
]
]

" III. START POSITION OF LEAVES"
" ============================="
;
Expand Down
Loading