Start of AttributeProfiles
This commit is contained in:
parent
05e7474a33
commit
4c8b9738e4
34
ld2dap/AttributeProfiles.py
Normal file
34
ld2dap/AttributeProfiles.py
Normal 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
|
||||
@ -10,22 +10,17 @@
|
||||
|
||||
from core import Input, Output, Filter
|
||||
from LoadTIFF import LoadTIFF
|
||||
from AttributeProfiles import AttributeProfiles as APs
|
||||
|
||||
def main():
|
||||
i = LoadTIFF(['../Data/test.tiff'])
|
||||
ap = APs()
|
||||
o = Output('o')
|
||||
n = Filter('n')
|
||||
f = Filter('f')
|
||||
print(n)
|
||||
#n.run()
|
||||
print(n.input)
|
||||
f.input = i
|
||||
n.input = f
|
||||
o.input = n
|
||||
|
||||
ap.input = i
|
||||
o.input = i
|
||||
|
||||
o.run()
|
||||
#i.process(None)
|
||||
print(n.input)
|
||||
print(f.outputs)
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user