#!/usr/bin/python # -*- coding: utf-8 -*- # \file AttributeProfiles.py # \brief TODO # \author Florent Guiotte # \version 0.1 # \date 04 avril 2018 # # TODO details from core import Filter ## TODO: dep import sys import numpy as np sys.path.append('../triskele/python') import triskele class AttributeProfiles(Filter): def __init__(self, area=None, sd=None, moi=None): super().__init__(self.__class__.__name__) self.area = area self.sd = sd self.moi = moi def _process(self, data, metadata): t = triskele.Triskele(data, verbose=False) att_min = t.filter(tree='min-tree', area=self.area, standard_deviation=self.sd, moment_of_inertia=self.moi) att_max = t.filter(tree='max-tree', area=self.area, standard_deviation=self.sd, moment_of_inertia=self.moi) att = np.dstack((att_min, att_max)) return att, metadata