docstr: check if input is of correct type.
docstr_tok: ["check","if","input","is","of","correct","type","."]
code: def _set_x0(self, x0):
      """check if input is of correct type."""
  
      if hasattr(x0, "ndim"):
          if len(x0) not in [3, 6, 7, 9, 12]:
              m_ = "Only 1D arrays of 3, 6, 7, 9 and 12 elements are allowed"
              raise ValueError(m_)
          if x0.ndim != 1:
              raise ValueError("Array should have only one dimension")
          return x0
  
      if isinstance(x0, str):
          if x0.lower() == "translation":
              return np.zeros(3)
  
          if x0.lower() == "rigid":
              return np.zeros(6)
  
          if x0.lower() == "similarity":
              return np.array([0, 0, 0, 0, 0, 0, 1.0])
  
          if x0.lower() == "scaling":
              return np.array([0, 0, 0, 0, 0, 0, 1.0, 1.0, 1.0])
  
          if x0.lower() == "affine":
              return np.array(
                  [0, 0, 0, 0, 0, 0, 1.0, 1.0, 1.0, 0, 0, 0]
              )
  
      if isinstance(x0, int):
          if x0 not in [3, 6, 7, 9, 12]:
              msg = "Only 3, 6, 7, 9 and 12 are accepted as integers"
              raise ValueError(msg)
          else:
              if x0 == 3:
                  return np.zeros(3)
              if x0 == 6:
                  return np.zeros(6)
              if x0 == 7:
                  return np.array([0, 0, 0, 0, 0, 0, 1.0])
              if x0 == 9:
                  return np.array([0, 0, 0, 0, 0, 0, 1.0, 1.0, 1.0])
              if x0 == 12:
                  return np.array(
                      [0, 0, 0, 0, 0, 0, 1.0, 1.0, 1.0, 0, 0, 0]
                  )
  
      raise ValueError("Wrong input")
  
imports: import logging
  import abc
  from itertools import combinations
  import numpy
  from dipy.core.optimize import Optimizer
  from dipy.align.bundlemin import _bundle_minimum_distance, _bundle_minimum_distance_asymmetric, distance_matrix_mdf
  from dipy.tracking.streamline import transform_streamlines, unlist_streamlines, center_streamlines, set_number_of_points, select_random_set_of_streamlines, length, Streamlines
  from dipy.segment.clustering import qbx_and_merge
  from dipy.core.geometry import compose_transformations, compose_matrix, decompose_matrix
  from time import time
label_desc: Use image node_id 3 for calling the StreamlineLinearRegistration obj's underlying member method code with example usage: obj._set_x0(x0) and returns: x0, np, np, np, np, np, np, np, np, np, np