Average set of 3D-CTs into one single image volume

I have ten 3D-CT volumes in nifti format (i.e. nii.gz) which corresponds to a 4D-CT that I want to generate a one single 3D CT volume by averaging them and save it. How can I do that with nibabel ?

This question is underspecified.

  1. Are these all structural CT scans from a single individual, in which case you want to coregister the images and create a single mean image?
  2. Are these CT-perfusion scans form a single individual where you want to derive perfusion parameters (mean transit, time to peak, etc)?
  3. Are these structural CT scans from different individuals where you hoe to normalize all to a single template?