diff --git a/Notebooks/Node Streaming Benchmark.ipynb b/Notebooks/Node Streaming Benchmark.ipynb index 7baacef..402cf97 100644 --- a/Notebooks/Node Streaming Benchmark.ipynb +++ b/Notebooks/Node Streaming Benchmark.ipynb @@ -24,29 +24,20 @@ "metadata": {}, "outputs": [], "source": [ - "load = ld2dap.LoadTIFF('../Data/test.tiff')\n", + "load = ld2dap.LoadTIFF(('../Data/test.tiff', '../Data/test2.tiff'))\n", "trsh = ld2dap.Treshold(1e4)\n", + "aps = ld2dap.AttributeProfiles(area=[100, 1e3, 1e4])\n", + "aps2 = ld2dap.AttributeProfiles(area=[100, 1e3, 1e4])\n", + "\n", "disp = ld2dap.ShowFig(fname=None)\n", - "out = ld2dap.RawOutput()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "disp.input = trsh\n", + "out = ld2dap.RawOutput()\n", + "\n", + "aps2.input = aps\n", + "out.input = aps\n", + "disp.input = aps\n", + "aps.input = trsh\n", "trsh.input = load\n", - "out.input = trsh" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ + "\n", "disp.run()" ] }, diff --git a/ld2dap/AttributeProfiles.py b/ld2dap/AttributeProfiles.py index 1334857..78bbe8d 100644 --- a/ld2dap/AttributeProfiles.py +++ b/ld2dap/AttributeProfiles.py @@ -69,7 +69,10 @@ class AttributeProfiles(Filter): raise NotImplementedError('Nested filtering not implemented yet') for att in ['area', 'sd', 'moi']: - stack_new = Stack(stack_offset * stack.begin, att_offset[att], + if att_offset[att] == 0: + continue + + stack_new = Stack(stack_offset * stack.begin, att_offset[att], stack.desc[0], stack.symb[0]) for old_desc, new_desc in zip(stack_new.desc, att_desc[att]): diff --git a/ld2dap/LoadTIFF.py b/ld2dap/LoadTIFF.py index cdc723e..134c3c4 100644 --- a/ld2dap/LoadTIFF.py +++ b/ld2dap/LoadTIFF.py @@ -19,7 +19,7 @@ import triskele class LoadTIFF(Input): def __init__(self, tiffFiles): super().__init__(self.__class__.__name__) - self.files = tiffFiles if isinstance(tiffFiles, list) else [tiffFiles] + self.files = tiffFiles if isinstance(tiffFiles, (tuple, list)) else [tiffFiles] def _process(self, data, metadata): layers = list() diff --git a/test.py b/test.py index 0e9d325..795efed 100644 --- a/test.py +++ b/test.py @@ -18,7 +18,7 @@ def main(): i = LoadTIFF(['Data/test.tiff', 'Data/test2.tiff']) t = Treshold(1e4) ap = APs(np.array([100,1e3,1e4])) - o = SaveFig('test.png') + o = SaveFig('Res/test.png') s = ShowFig(None) t.input = i