function out = ifft3c(in)

sz_in = size(in); sz_in(end+1:3) = 1;
nvols = prod(sz_in(4:end));
out = zeros(sz_in,class(in));

for ivol = 1:nvols
    ifft_out = in(:,:,:,ivol);
    ifft_out = fftshift(ifftn(ifftshift(ifft_out)));
    out(:,:,:,ivol) = ifft_out;
end

end
