## Check sample homogeneity

If you have a reasonable sample size artefacts are easily overseen. In order to identify images with poor image quality or even artefacts you can use the function “Check sample homogeneity using standard deviation across sample”. To use this function images have to be in the same orientation with same voxel size and dimension (e.g. normalized images).

The idea of this tool is to check the standard deviation across the sample. Standard deviation is caclulated by the sum of the squared distance of each image from the sample mean. Hence, the squared distance of one image from the sample mean represents the amount to which this images deviates from the sample mean.

A large distance to mean does not always mean that this image is an outlier or contains an artefact. Usually images of patients are more deviant from the sample mean and this is what you try to localize. If there are no artefacts in the image and if the image quality is reasonable you don’t have to exclude this image from the sample. This tool is intended to utilitize the process of quality checking and there is no clear criteria to exclude an images only based on squared distance to mean.

The squared distance to mean is calculated for each image and plotted using a boxplot and the indicated filenames. The larger the squared distance the more deviant is this image from the sample mean. In the “squared distance to mean plot” outliers from the sample are usually isolated from the majority of images which are clustered around the sample mean. The squared distance to mean is plotted at the y-axis and the x-axis reflects the image order. Images are plotted from left to right which is helpful if you have selected the images in the order of different sub-groups. Furthermore this is also useful for fMRI images which can be also used with this tool. The “proportional scaling” option should be only used if image intensity is not scaled (e.g. T1 images) or if images have to be scaled during statistical analysis (e.g. modulated images).

I recommend this tool for any images which are intended for statistical analysis (segmented images, fMRI images). Hence, I would use the smoothed, normalized images. Optionally an output image will be save with standard deviation at every voxel to identify deviant regions.

After calculating the squared distance to mean the images with the largest distance can be displayed with help of the CheckReg function.