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: Get or estimate the shape of the segmentation matrix
  This is the dense shape, ('c', 't', 'z', 'y', 'x')
  
  Order of precedence:
  Shape supplied in the constructor
  Shape of the dense representation
  maximum extent of the sparse representation + 1
docstr_tok: ["Get","or","estimate","the","shape","of","the","segmentation","matrix","This","is","the","dense","shape",",","(","'","c","'",",","'t","'",",","'","z","'",",","'","y","'",",","'","x","'",")","Order","of","precedence",":","Shape","supplied","in","the","constructor","Shape","of","the","dense","representation","maximum","extent","of","the","sparse","representation","+","1"]
code: def shape(self):
      """Get or estimate the shape of the segmentation matrix
      This is the dense shape, ('c', 't', 'z', 'y', 'x')
  
      Order of precedence:
      Shape supplied in the constructor
      Shape of the dense representation
      maximum extent of the sparse representation + 1
      """
      if self.__shape is not None:
          return self.__shape
      if self.has_dense():
          self.__shape = self.get_dense()[0].shape[1:]
      else:
          sparse = self.sparse
          if len(sparse) == 0:
              self.__shape = (1, 1, 1, 1, 1)
          else:
              self.__shape = dense_shape_from_sparse(
                  sparse, validate=False
              )
      return self.__shape
  
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 2 for calling the Segmentation obj's underlying member method code with example usage: obj.shape() and returns: self, self