class_docstr: Besides DiscreteDomain attributed, StructuredDomain has a topology,
  which allows many operations (morphology etc.)
class_docstr_tok: ["Besides","DiscreteDomain","attributed",",","StructuredDomain","has","a","topology",",","which","allows","many","operations","(","morphology","etc",".",")"]
docstr: Returns a StructuredDomain instance that has been further masked
          
code: def mask(self, bmask, did=""):
      """Returns a StructuredDomain instance that has been further masked"""
      td = DiscreteDomain.mask(self, bmask)
      stopo = reduce_coo_matrix(self.topology, bmask)
      dd = StructuredDomain(
          self.dim,
          td.coord,
          td.local_volume,
          stopo,
          did,
          self.referential,
      )
  
      for fid in list(td.features.keys()):
          dd.set_feature(fid, td.features.pop(fid))
      return dd
  
imports: import numpy
  import scipy.sparse
  from nibabel import Nifti1Image, load, save
  from nipy.algorithms.graph import WeightedGraph, wgraph_from_3d_grid, wgraph_from_coo_matrix
  from nipy.io.nibcompat import get_affine, get_header
label_desc: Use image node_id 2 for calling the StructuredDomain obj's underlying member method code with example usage: obj.mask(bmask, did) and returns: dd