  We present a 3D zigzag rafter (first in literature) which allows us to obtain
the exact sequence of spectral components after application of Discrete Cosine
Transform 3D (DCT-2D) over a cube. Such cube represents part of a video or
eventually a group of images such as multislicing (e.g., Magnetic Resonance or
Computed Tomography imaging) and multi or hyperspectral imagery (optical
satellites). Besides, we present a new version of the traditional 2D zigzag,
including the case of rectangular blocks. Finally, all the attached code is
done in MATLAB, and that code serves both blocks of pixels or blocks of blocks.
