Work on metadata streaming

This commit is contained in:
Florent Guiotte 2018-04-12 08:53:59 +02:00
parent 7689382a64
commit 3274683983
3 changed files with 32 additions and 3 deletions

View File

@ -8,7 +8,7 @@
# #
# TODO details # TODO details
from core import Input from core import Input, Stack
import numpy as np import numpy as np
## TODO: dep ## TODO: dep
@ -23,10 +23,15 @@ class LoadTIFF(Input):
def _process(self, data, metadata): def _process(self, data, metadata):
layers = list() layers = list()
metadata = list()
for file in self.files: for i, file in enumerate(self.files):
print('Loading {}'.format(file)) print('Loading {}'.format(file))
layers.append(triskele.read(file)) layers.append(triskele.read(file))
metadata.append(Stack(i, desc=file, symb='I_{{{}}}'.format(i)))
return np.stack(layers, axis=2), self.files return np.stack(layers, axis=2), metadata
def I(self, i):
return self.files[i]

23
ld2dap/core/Stack.py Normal file
View File

@ -0,0 +1,23 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
# \file %filename%.py
# \brief TODO
# \author Florent Guiotte <florent.guiotte@gmail.com>
# \version 0.1
# \date 11 avril 2018
#
# TODO details
class Stack(object):
def __init__(self, begin=0, size=1, desc=None, symb=None) :
self.begin = begin
self.end = begin + size
self.desc = list()
self.symb = list()
if desc is not None:
self.desc.append(desc)
if symb is not None:
self.symb.append(symb)

View File

@ -11,3 +11,4 @@
from .Output import Output from .Output import Output
from .Input import Input from .Input import Input
from .Filter import Filter from .Filter import Filter
from .Stack import Stack