fix(interface): ``EstimateReferenceImage`` generates 4D references if 4D SBRefs are supplied as input.
fix(interface): ``EstimateReferenceImage`` generates 4D references if 4D SBRefs are supplied as input.

This patch checks the dimensionality of SBRefs and generates an average if the SBRef is 4D.
Fixes poldracklab/fmriprep#1579.
Intimately related to #253, although I'm not sure the proposed resampling there is absolutely necessary.
It could be detrimental for ``bbregister`` in co-registration.
It is very likely necessary for head-motion correction with either ``mcflirt`` or ``3dVolReg``.

oesteban/niworkflows,oesteban/niworkflows,poldracklab/niworkflows,oesteban/niworkflows,poldracklab/niworkflows