Pass img_f not img_obj to _get_nvols
@@ -200,7 +200,7 @@ def _load_time_variables(layout, dataset=None, columns=None, scan_length=None,
# Get duration of run: first try to get it directly from the image
# header; if that fails, look for a scan_length argument.
try:
- nvols = _get_nvols(img_obj)
+ nvols = _get_nvols(img_f)
duration = nvols * tr
except Exception as e:
if scan_length is not None:
