code: def test_nifti_qfac_checks(self):
      # Test qfac is 1 or -1 or 0
      hdr = self.header_class()
      # 1, 0, -1 all OK
      hdr["pixdim"][0] = 1
      self.log_chk(hdr, 0)
      hdr["pixdim"][0] = 0
      self.log_chk(hdr, 0)
      hdr["pixdim"][0] = -1
      self.log_chk(hdr, 0)
      # Anything else is not
      hdr["pixdim"][0] = 2
      fhdr, message, raiser = self.log_chk(hdr, 20)
      assert fhdr["pixdim"][0] == 1
      assert (
          message
          == "pixdim[0] (qfac) should be 1 (default) or 0 or -1; setting qfac to 1"
      )
  
imports: import io
  from os.path import dirname
  from os.path import join
  import numpy
  import pytest
  from numpy.testing import assert_array_almost_equal
  from packaging.version import Version
  import nibabel
  from nibabel import cifti2
  from nibabel.cifti2.parse_cifti2 import _Cifti2AsNiftiHeader
  from nibabel.tests import test_nifti2
  from nibabel.tests.nibabel_data import get_nibabel_data, needs_nibabel_data
  from nibabel.tmpdirs import InTemporaryDirectory
label_desc: Use image node_id 2 for calling the TestCifti2SingleHeader obj's underlying member method code with example usage: obj.test_nifti_qfac_checks() without return types