From cb344e52722c5a415b5cd785fec5ea0c69309a33 Mon Sep 17 00:00:00 2001 From: Philipp Schlegel Date: Tue, 26 Oct 2021 12:02:04 +0100 Subject: [PATCH] decode_sparsevol: deal with empty sparsevols --- dvid/decode.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dvid/decode.py b/dvid/decode.py index e1fee0c..7cd88a2 100644 --- a/dvid/decode.py +++ b/dvid/decode.py @@ -43,7 +43,11 @@ def decode_sparsevol(b, format='rles'): this_run[:, 0] = np.arange(x, x + run_len) coords.append(this_run) - coords = np.concatenate(coords) + + if len(coords): + coords = np.concatenate(coords) + else: + coords = np.zeros((0, 3)) return header, coords elif format == 'blocks': raise ValueError('Format "blocks" not yet implemented.')