= Image stack axis calibration
<Image stack axis calibration> assigns physical coordinates to the indices of an <image stack>. It states what each axis means, its spacing, origin and orientation. Pixel indices, section indices and frame indices are distinct from positions and times. In <ImageJ>, image properties include pixel width, pixel height, voxel depth and frame interval; its Origin fields are expressed in pixels.<ImageJ User Guide by Tiago Ferreira and Wayne Rasband>[Section28.4, Image Properties; section30.8, Set Scale]{ref}
For an original general spatial model, let the index <vector> be $\mathbf n=(i,j,k)^T$ and define
$$
\mathbf r=\mathbf r_0+R\operatorname{diag}(s_x,s_y,s_z)\mathbf n,
$$
where $\mathbf r_0$ is a physical origin and $R$ is a <rotation matrix>. This is an <affine map>; the rotation represents a chosen acquisition-to-world orientation rather than a claim that ImageJ's Properties dialog implements an arbitrary rotation. Convert any pixel-unit origin into the chosen physical convention before using this equation.
Take spacings $(s_x,s_y,s_z)=(0.2,0.3,1.0)\,\mathrm{\mu m}$, origin $\mathbf r_0=(10,-4,2)\,\mathrm{\mu m}$ and a 90° rotation about the positive third axis:
$$
R=\begin{pmatrix}0&-1&0\\1&0&0\\0&0&1\end{pmatrix}.
$$
Index $(3,2,1)$ first maps to local displacement $(0.6,0.6,1.0)\,\mathrm{\mu m}$ and then to world position $(9.4,-3.4,3.0)\,\mathrm{\mu m}$. Its distance from the physical origin is $\sqrt{0.6^2+0.6^2+1^2}\simeq1.31\,\mathrm{\mu m}$, unchanged by the rotation.
Cropping and axis permutation require corresponding metadata changes. If a crop begins at old index $\mathbf c$, its new physical origin is $\mathbf r_0'=\mathbf r_0+R\operatorname{diag}(s_x,s_y,s_z)\mathbf c$. For irregular section positions, store those positions explicitly instead of inventing one uniform depth increment. <Image resampling> may alter the grid, but it does not create independently acquired depth information.
Back to article page