code: def test_creating_invalid_tractogram(self):
      # Not enough data_per_point for all the points of all streamlines.
      scalars = [
          [(1, 0, 0)] * 1,
          [(0, 1, 0)] * 2,
          [(0, 0, 1)] * 3,
      ]  # Last streamlines has 5 points.
  
      with pytest.raises(ValueError):
          Tractogram(
              streamlines=DATA["streamlines"],
              data_per_point={"scalars": scalars},
          )
  
      # Not enough data_per_streamline for all streamlines.
      properties = [
          np.array([1.11, 1.22], dtype="f4"),
          np.array([3.11, 3.22], dtype="f4"),
      ]
  
      with pytest.raises(ValueError):
          Tractogram(
              streamlines=DATA["streamlines"],
              data_per_streamline={"properties": properties},
          )
  
      # Inconsistent dimension for a data_per_point.
      scalars = [[(1, 0, 0)] * 1, [(0, 1)] * 2, [(0, 0, 1)] * 5]
  
      with pytest.raises(ValueError):
          Tractogram(
              streamlines=DATA["streamlines"],
              data_per_point={"scalars": scalars},
          )
  
      # Inconsistent dimension for a data_per_streamline.
      properties = [[1.11, 1.22], [2.11], [3.11, 3.22]]
  
      with pytest.raises(ValueError):
          Tractogram(
              streamlines=DATA["streamlines"],
              data_per_streamline={"properties": properties},
          )
  
      # Too many dimension for a data_per_streamline.
      properties = [
          np.array([[1.11], [1.22]], dtype="f4"),
          np.array([[2.11], [2.22]], dtype="f4"),
          np.array([[3.11], [3.22]], dtype="f4"),
      ]
  
      with pytest.raises(ValueError):
          Tractogram(
              streamlines=DATA["streamlines"],
              data_per_streamline={"properties": properties},
          )
  
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 6 for calling the TestTractogram obj's underlying member method code with example usage: obj.test_creating_invalid_tractogram() without return types