Start of AttributeProfiles

This commit is contained in:
Florent Guiotte 2018-04-04 18:28:05 +02:00
parent 05e7474a33
commit 4c8b9738e4
2 changed files with 40 additions and 11 deletions

View File

@ -0,0 +1,34 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
# \file AttributeProfiles.py
# \brief TODO
# \author Florent Guiotte <florent.guiotte@gmail.com>
# \version 0.1
# \date 04 avril 2018
#
# TODO details
from core import Filter
## TODO: dep
import sys
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)
return att, None

View File

@ -10,22 +10,17 @@
from core import Input, Output, Filter from core import Input, Output, Filter
from LoadTIFF import LoadTIFF from LoadTIFF import LoadTIFF
from AttributeProfiles import AttributeProfiles as APs
def main(): def main():
i = LoadTIFF(['../Data/test.tiff']) i = LoadTIFF(['../Data/test.tiff'])
ap = APs()
o = Output('o') o = Output('o')
n = Filter('n')
f = Filter('f') ap.input = i
print(n) o.input = i
#n.run()
print(n.input)
f.input = i
n.input = f
o.input = n
o.run() o.run()
#i.process(None)
print(n.input)
print(f.outputs)
if __name__ == '__main__': if __name__ == '__main__':
main() main()