code: def test_no_scaling(self, in_dtype, supported_dtype):
      # Test writing image converting types when not calculating scaling
      img_class = self.image_class
      hdr_class = img_class.header_class
      hdr = hdr_class()
      # Any old non-default slope and intercept
      slope = 2
      inter = 10 if hdr.has_data_intercept else 0
  
      mn_in, mx_in = _dt_min_max(in_dtype)
      mn = -1 if np.dtype(in_dtype).kind != "u" else 0
      arr = np.array([mn_in, mn, 0, 1, 10, mx_in], dtype=in_dtype)
      img = img_class(arr, np.eye(4), hdr)
      img.set_data_dtype(supported_dtype)
      # Setting the scaling means we don't calculate it later
      img.header.set_slope_inter(slope, inter)
      with np.errstate(invalid="ignore"):
          rt_img = bytesio_round_trip(img)
      with suppress_warnings():  # invalid mult
          back_arr = np.asanyarray(rt_img.dataobj)
      exp_back = arr.copy()
      # If converting to floating point type, casting is direct.
      # Otherwise we will need to do float-(u)int casting at some point
      if supported_dtype in IUINT_TYPES:
          if in_dtype in FLOAT_TYPES:
              # Working precision is (at least) float
              exp_back = exp_back.astype(float)
              # Float to iu conversion will always round, clip
              with np.errstate(invalid="ignore"):
                  exp_back = np.round(exp_back)
              if in_dtype in FLOAT_TYPES:
                  # Clip to shared range of working precision
                  exp_back = np.clip(
                      exp_back, *shared_range(float, supported_dtype)
                  )
          else:  # iu input and output type
              # No scaling, never gets converted to float.
              # Does get clipped to range of output type
              mn_out, mx_out = _dt_min_max(supported_dtype)
              if (mn_in, mx_in) != (mn_out, mx_out):
                  # Use smaller of input, output range to avoid np.clip
                  # upcasting the array because of large clip limits.
                  exp_back = np.clip(
                      exp_back, max(mn_in, mn_out), min(mx_in, mx_out)
                  )
      if supported_dtype in COMPLEX_TYPES:
          # always cast to real from complex
          exp_back = exp_back.astype(supported_dtype)
      else:
          # Cast to working precision
          exp_back = exp_back.astype(float)
      # Allow for small differences in large numbers
      with suppress_warnings():  # invalid value
          assert_allclose_safely(back_arr, exp_back * slope + inter)
  
imports: import itertools
  import unittest
  from io import BytesIO
  import numpy
  import pytest
  from numpy.testing import assert_array_almost_equal, assert_array_equal
  from ..optpkg import optional_package
  from ..casting import sctypes_aliases, shared_range, type_info
  from ..spatialimages import HeaderDataError
  from ..spm99analyze import HeaderTypeError, Spm99AnalyzeHeader, Spm99AnalyzeImage
  from ..testing import assert_allclose_safely, bytesio_filemap, bytesio_round_trip, suppress_warnings
  from ..volumeutils import _dt_min_max, apply_read_scaling
  from .None import test_analyze
label_desc: Use image node_id 9 for calling the ImageScalingMixin obj's underlying member method code with example usage: obj.test_no_scaling(in_dtype, supported_dtype) without return types