How to use the ndlib.ndctypelib.filter_ctype_OMP function in ndlib

To help you get started, we’ve selected a few ndlib examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github neurodata / ndstore / webservices / ndwsrest.py View on Github external
def FilterCube ( imageargs, cb ):
  """ Return a cube with the filtered ids """

  # Filter Function - used to filter
  result = re.search ("filter/([\d/,]+)/",imageargs)
  if result != None:
    filterlist = np.array ( result.group(1).split(','), dtype=np.uint32 )
    cb.data = filter_ctype_OMP ( cb.data, filterlist )
github neurodata / ndstore / webservices / ndwsrest.py View on Github external
def filterCube(ch, cube, filterlist=None):
  """Call Filter on a cube"""

  if ch.channel_type in ANNOTATION_CHANNELS and filterlist is not None:
    cube.data = filter_ctype_OMP ( cube.data, filterlist )
  elif filterlist is not None and ch.channel_type not in ANNOTATION_CHANNELS:
    logger.error("Filter only possible for Annotation Channels")
    raise NDWSError("Filter only possible for Annotation Channels")