class_docstr: A segmentation of a space into labeled objects
  
  Supports overlapping objects and cacheing. Retrieval can be as a
  single plane (legacy), as multiple planes and as sparse ijv.
class_docstr_tok: ["A","segmentation","of","a","space","into","labeled","objects","Supports","overlapping","objects","and","cacheing",".","Retrieval","can","be","as","a","single","plane","(","legacy",")",",","as","multiple","planes","and","as","sparse","ijv","."]
docstr: Initialize the segmentation with either a dense or sparse labeling
  
  dense - A 6-d array composed of one or more 5-d integer labelings of
  each hyper-voxel. The dimension order is labeling, c, t, z, y, x.
  Typically, a 2-D non-overlapping segmentation has dimensions of
  1, 1, 1, 1, y, x.
  
  sparse - a labeling stored in a record data type with each column
           having a name of "c", "t", "z", "y", "x" or "label".
           The "label" column is the object number, starting with 1.
           When "c", "t", "z" are absent, this is the interoperable with
           an ijv labeling of the pixels, or in the COOrdinate format
           (as in scipy.sparse.coo_matrix).
  
  shape - the 5-D shape of the imaging site if sparse. If this is absent
          the shape is inferred from the given coordinates of the sparse
          labeling, which is a size capable of containing an equivilent
          dense representation, but may not be exactly equal to the
          original shape of the imaging site.
docstr_tok: ["Initialize","the","segmentation","with","either","a","dense","or","sparse","labeling","dense","-","A","6-d","array","composed","of","one","or","more","5-d","integer","labelings","of","each","hyper-voxel",".","The","dimension","order","is","labeling",",","c",",","t",",","z",",","y",",","x",".","Typically",",","a","2-D","non-overlapping","segmentation","has","dimensions","of","1",",","1",",","1",",","1",",","y",",","x.","sparse","-","a","labeling","stored","in","a","record","data","type","with","each","column","having","a","name","of","``","c","''",",","``","t","''",",","``","z","''",",","``","y","''",",","``","x","''","or","``","label","''",".","The","``","label","''","column","is","the","object","number",",","starting","with","1",".","When","``","c","''",",","``","t","''",",","``","z","''","are","absent",",","this","is","the","interoperable","with","an","ijv","labeling","of","the","pixels",",","or","in","the","COOrdinate","format","(","as","in","scipy.sparse.coo_matrix",")",".","shape","-","the","5-D","shape","of","the","imaging","site","if","sparse",".","If","this","is","absent","the","shape","is","inferred","from","the","given","coordinates","of","the","sparse","labeling",",","which","is","a","size","capable","of","containing","an","equivilent","dense","representation",",","but","may","not","be","exactly","equal","to","the","original","shape","of","the","imaging","site","."]
code: def __init__(self, dense=None, sparse=None, shape=None):
      """Initialize the segmentation with either a dense or sparse labeling
  
      dense - A 6-d array composed of one or more 5-d integer labelings of
      each hyper-voxel. The dimension order is labeling, c, t, z, y, x.
      Typically, a 2-D non-overlapping segmentation has dimensions of
      1, 1, 1, 1, y, x.
  
      sparse - a labeling stored in a record data type with each column
               having a name of "c", "t", "z", "y", "x" or "label".
               The "label" column is the object number, starting with 1.
               When "c", "t", "z" are absent, this is the interoperable with
               an ijv labeling of the pixels, or in the COOrdinate format
               (as in scipy.sparse.coo_matrix).
  
      shape - the 5-D shape of the imaging site if sparse. If this is absent
              the shape is inferred from the given coordinates of the sparse
              labeling, which is a size capable of containing an equivilent
              dense representation, but may not be exactly equal to the
              original shape of the imaging site.
      """
      if dense is not None:
          _validate_dense(dense)
      if sparse is not None:
          _validate_sparse(sparse)
      if shape is not None:
          _validate_dense_shape(shape)
  
      self.__dense = dense
      self.__sparse = sparse
      if shape is not None:
          self.__shape = shape
          self.__explicit_shape = True
      else:
          self.__shape = None
          self.__explicit_shape = False
  
      if dense is not None:
          self.__indices = indices_from_dense(dense)
  
file_path: CellProfiler/src/subpackages/core/cellprofiler_core/object/_segmentation.py
imports: from cellprofiler_library.functions.segmentation import convert_dense_to_sparse
  from cellprofiler_library.functions.segmentation import convert_sparse_to_dense
  from cellprofiler_library.functions.segmentation import indices_from_dense
  from cellprofiler_library.functions.segmentation import dense_shape_from_sparse
  from cellprofiler_library.functions.segmentation import _validate_dense
  from cellprofiler_library.functions.segmentation import _validate_sparse
  from cellprofiler_library.functions.segmentation import _validate_dense_shape
label_desc: Use image node_id 1 to create a new Segmentation object  with example: obj = Segmentation(dense, sparse, shape)