code: def make_hroi_from_subdomain(sub_domain, parents):
      """Instantiate an HROi from a SubDomain instance and parents"""
      hroi = HierarchicalROI(
          sub_domain.domain, sub_domain.label, parents
      )
      # set features
      for fid in sub_domain.features:
          hroi.set_feature(fid, sub_domain.get_feature(fid))
      # set ROI features
      for fid in sub_domain.roi_features:
          hroi.set_roi_feature(fid, sub_domain.get_roi_feature(fid))
      return hroi
  
imports: import numpy
  from nipy.algorithms.graph.field import field_from_coo_matrix_and_data
  from nipy.algorithms.graph.forest import Forest
  from nipy.algorithms.graph.graph import WeightedGraph
  from .mroi import SubDomains
label_desc: Use image node_id 4 for calling a global function with example usage: make_hroi_from_subdomain(sub_domain, parents) and returns: hroi