The MGZ file format is a compressed version of the MGH file format, which was developed by the Martinos Center for Biomedical Imaging at Massachusetts General Hospital. It is primarily used by the FreeSurfer software suite for the analysis and visualization of structural and functional magnetic resonance imaging (MRI) data. An MGZ file typically contains a 3D or 4D volume of brain imaging data, including anatomical scans, surface overlays, or statistical maps. The format uses GZIP compression to reduce the file size of the large volumetric datasets while preserving all metadata and voxel information. It supports various data types, such as integers and floating-point numbers, and includes a header that stores information about the image dimensions, voxel size, and coordinate transformations (RAS coordinates). Because it is a standard in the neuroimaging community, it is often used for sharing processed brain data between researchers and is compatible with several specialized neuroimaging toolboxes and libraries like NiBabel in Python. It is the default output format for many automated brain segmentation and cortical surface reconstruction pipelines.