Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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 )
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")