6.3. Box Geometry
Table of Contents
Box dimensions
In GATE, a box is one of the simplest and most frequently used solid shapes. You will often use it to represent detector blocks, phantoms, shielding slabs, or support structures. Conceptually, a box is defined by three half lengths along the Cartesian axes: one for $x$, one for $y$, and one for $z$. The full physical size in each direction is twice the corresponding half length.
When you create a box volume in GATE, you set its size with a parameter that typically looks like size = [sx, sy, sz]. Each component is a length with units. These values represent the half sizes. For example, if you choose
$$
\text{half\_size}_x = 10 \,\text{mm},\quad
\text{half\_size}_y = 20 \,\text{mm},\quad
\text{half\_size}_z = 5 \,\text{mm},
$$
the resulting box has full dimensions
$$
L_x = 2 \times 10 \,\text{mm} = 20 \,\text{mm},\\
L_y = 2 \times 20 \,\text{mm} = 40 \,\text{mm},\\
L_z = 2 \times 5 \,\text{mm} = 10 \,\text{mm}.
$$
In other words, what you enter in the simulation configuration is half the physical width, height, and depth of the box. This convention comes from Geant4 and is used in many volume definitions.
The following table summarizes how half sizes relate to full sizes.
| Parameter in GATE | Physical meaning |
|---|---|
size[0] or half_size_x | Half length along $x$ |
size[1] or half_size_y | Half length along $y$ |
size[2] or half_size_z | Half length along $z$ |
| Full size along $x$ | $2 \times \text{half\_size}_x$ |
| Full size along $y$ | $2 \times \text{half\_size}_y$ |
| Full size along $z$ | $2 \times \text{half\_size}_z$ |
Important rule: For box volumes, GATE expects half lengths along $x$, $y$, and $z$. The actual physical size of the box in each direction is twice the value you specify.
You can use any valid GATE length units for the half sizes, such as mm, cm, or m. It is common in medical physics to work in millimeters or centimeters. Always keep your units consistent with the rest of the geometry to avoid boxes that are accidentally too small or too large.
To design a box with a specific physical size, it is often easier to start from the desired full dimensions and then divide by two for each direction. For example, if you want a detector block that is $50 \,\text{mm}$ wide, $50 \,\text{mm}$ high, and $10 \,\text{mm}$ thick, you set the half sizes to $25 \,\text{mm}$, $25 \,\text{mm}$, and $5 \,\text{mm}$. This also helps when you later build arrays of boxes, because you can easily compute positions from these half dimensions.
Positioning boxes
Once you have defined the dimensions of a box, you must place it in a parent volume, usually the world or another larger box. In GATE, as in Geant4, the position of a volume is defined by the coordinates of its center. The surfaces of the box extend symmetrically around this center according to the half sizes.
If a box has half sizes $\text{half\_size}_x$, $\text{half\_size}_y$, and $\text{half\_size}_z$, and its center is at position $(x_0, y_0, z_0)$, then the faces of the box are located at
$$
x = x_0 \pm \text{half\_size}_x, \\
y = y_0 \pm \text{half\_size}_y, \\
z = z_0 \pm \text{half\_size}_z.
$$
The coordinates $(x_0, y_0, z_0)$ are specified in the coordinate system of the parent volume. For example, if you place a box in the world, its position is given in world coordinates. If you place a small box inside a larger box, its position is relative to the center of that larger box.
The following table shows how center position and half sizes determine the extents of the box.
| Quantity | Formula |
|---|---|
| Left face in $x$ | $x_{\min} = x_0 - \text{half\_size}_x$ |
| Right face in $x$ | $x_{\max} = x_0 + \text{half\_size}_x$ |
| Bottom face in $y$ | $y_{\min} = y_0 - \text{half\_size}_y$ |
| Top face in $y$ | $y_{\max} = y_0 + \text{half\_size}_y$ |
| Back face in $z$ | $z_{\min} = z_0 - \text{half\_size}_z$ |
| Front face in $z$ | $z_{\max} = z_0 + \text{half\_size}_z$ |
When positioning boxes, an important practical task is to avoid overlaps between volumes. Two boxes should not physically intersect each other within the same parent, unless a boolean operation is intentional. Because positions are defined by centers and dimensions are half lengths, you can use simple formulas to place boxes next to each other without gaps or overlaps.
Suppose you have two boxes along the $x$ direction, with half sizes $\text{half\_size}_x^{(1)}$ and $\text{half\_size}_x^{(2)}$, and you want them to touch without overlapping. If the first box is centered at $x_0^{(1)}$, the second box can be placed with its center at
$$
x_0^{(2)} = x_0^{(1)} + \text{half\_size}_x^{(1)} + \text{half\_size}_x^{(2)}.
$$
This places the right face of the first box exactly at the left face of the second box. You can use the same idea in $y$ and $z$ when building stacks or grids of box volumes.
Important rule: Box positions in GATE are the coordinates of the box center. The faces are always at center coordinates plus or minus the corresponding half size.
In many medical imaging geometries, such as detector modules or simple phantoms, you often want to align a box with an axis or center it at the origin. To center a box in the world, you simply set its position to $(0, 0, 0)$. Then its faces are located symmetrically around the origin, at $\pm \text{half\_size}_x$, $\pm \text{half\_size}_y$, and $\pm \text{half\_size}_z$.
You may also need to position several identical boxes in a regular pattern, for example to create a simple 1D array. If you have a set of identical boxes with half size $\text{half\_size}_x$ and you want a regular spacing $\Delta$ between their centers in the $x$ direction, the center of the $i$‑th box can be computed as
$$
x_i = x_{\text{start}} + i \cdot \Delta,
$$
where $i$ is an integer index. If you want the boxes to touch each other without gaps, choose $\Delta = 2 \times \text{half\_size}_x$. If you want a small gap $g$ between them, you can use
$$
\Delta = 2 \times \text{half\_size}_x + g.
$$
This center based positioning is fundamental when you later build more complex structures from boxes, such as detector arrays or simple voxel phantoms.
Views: 11
KAHIBARO