class_docstr: Class for stateful representation of collections of streamlines
  Object designed to be identical no matter the file format
  (trk, tck, vtk, fib, dpy). Facilitate transformation between space and
  data manipulation for each streamline / point.
class_docstr_tok: ["Class","for","stateful","representation","of","collections","of","streamlines","Object","designed","to","be","identical","no","matter","the","file","format","(","trk",",","tck",",","vtk",",","fib",",","dpy",")",".","Facilitate","transformation","between","space","and","data","manipulation","for","each","streamline","\/","point","."]
docstr: Create an instance of `StatefulTractogram` from another instance
  of `StatefulTractogram`.
  
  Parameters
  ----------
  streamlines : list or ArraySequence
      Streamlines of the tractogram
  sft : StatefulTractogram,
      The other StatefulTractogram to copy the space_attribute AND
      state from.
  data_per_point : dict, optional
      Dictionary in which each key has X items, each items has Y_i items
      X being the number of streamlines
      Y_i being the number of points on streamlines #i
  data_per_streamline : dict, optional
      Dictionary in which each key has X items
      X being the number of streamlines
  -----
docstr_tok: ["Create","an","instance","of","`","StatefulTractogram","`","from","another","instance","of","`","StatefulTractogram","`",".","Parameters","--","--","--","--","--","streamlines",":","list","or","ArraySequence","Streamlines","of","the","tractogram","sft",":","StatefulTractogram",",","The","other","StatefulTractogram","to","copy","the","space_attribute","AND","state","from",".","data_per_point",":","dict",",","optional","Dictionary","in","which","each","key","has","X","items",",","each","items","has","Y_i","items","X","being","the","number","of","streamlines","Y_i","being","the","number","of","points","on","streamlines","#","i","data_per_streamline",":","dict",",","optional","Dictionary","in","which","each","key","has","X","items","X","being","the","number","of","streamlines","--","--","-"]
code: def from_sft(
      streamlines, sft, data_per_point=None, data_per_streamline=None
  ):
      """Create an instance of `StatefulTractogram` from another instance
      of `StatefulTractogram`.
  
      Parameters
      ----------
      streamlines : list or ArraySequence
          Streamlines of the tractogram
      sft : StatefulTractogram,
          The other StatefulTractogram to copy the space_attribute AND
          state from.
      data_per_point : dict, optional
          Dictionary in which each key has X items, each items has Y_i items
          X being the number of streamlines
          Y_i being the number of points on streamlines #i
      data_per_streamline : dict, optional
          Dictionary in which each key has X items
          X being the number of streamlines
      -----
      """
      new_sft = StatefulTractogram(
          streamlines,
          sft.space_attributes,
          sft.space,
          origin=sft.origin,
          data_per_point=data_per_point,
          data_per_streamline=data_per_streamline,
      )
      new_sft.dtype_dict = sft.dtype_dict
      return new_sft
  
imports: from bisect import bisect
  from collections import OrderedDict
  from copy import deepcopy
  import enum
  from itertools import product
  import logging
  from nibabel.affines import apply_affine
  from nibabel.streamlines.tractogram import Tractogram, PerArraySequenceDict, PerArrayDict
  import numpy
  from dipy.io.dpy import Streamlines
  from dipy.io.utils import get_reference_info, is_reference_info_valid, is_header_compatible
label_desc: Use image node_id 3 for calling the StatefulTractogram obj's underlying member method code with example usage: obj.from_sft(streamlines, sft, data_per_point, data_per_streamline) and returns: new_sft