code: def test_setting_affine_to_rasmm(self):
      tractogram = DATA["tractogram"].copy()
      affine = np.diag(range(4))
  
      # Test assigning None.
      tractogram.affine_to_rasmm = None
      assert tractogram.affine_to_rasmm is None
  
      # Test assigning a valid ndarray (should make a copy).
      tractogram.affine_to_rasmm = affine
      assert tractogram.affine_to_rasmm is not affine
  
      # Test assigning a list of lists.
      tractogram.affine_to_rasmm = affine.tolist()
      assert_array_equal(tractogram.affine_to_rasmm, affine)
  
      # Test assigning a ndarray with wrong shape.
      with pytest.raises(ValueError):
          tractogram.affine_to_rasmm = affine[::2]
  
imports: import copy
  import operator
  import sys
  import unittest
  import warnings
  from collections import defaultdict
  import numpy
  import pytest
  from numpy.testing import assert_array_almost_equal, assert_array_equal
  from ...testing import assert_arrays_equal, clear_and_catch_warnings
  from ..None import tractogram
  from ..tractogram import LazyDict, LazyTractogram, PerArrayDict, PerArraySequenceDict, Tractogram, TractogramItem, is_data_dict, is_lazy_dict
label_desc: Use image node_id 2 for calling the TestTractogram obj's underlying member method code with example usage: obj.test_setting_affine_to_rasmm() without return types