From 3354f68385e4d94ec3c04b1c51f40e818e21c8dc Mon Sep 17 00:00:00 2001
From: Philip ABBET <philip.abbet@idiap.ch>
Date: Mon, 13 Nov 2017 15:30:32 +0100
Subject: [PATCH] Remove biowave/2, only keep an updated biowave/1 (was never
 used before)

---
 advanced/databases/biowave/1.json             |  335 ++--
 advanced/databases/biowave/1.py               | 1054 +++++++-----
 advanced/databases/biowave/1.rst              |    4 +-
 advanced/databases/biowave/2.json             | 1502 -----------------
 advanced/databases/biowave/2.py               |  745 --------
 advanced/databases/biowave/2.rst              |  208 ---
 .../array_1d_coordinates/1.json               |    7 +
 7 files changed, 746 insertions(+), 3109 deletions(-)
 delete mode 100644 advanced/databases/biowave/2.json
 delete mode 100644 advanced/databases/biowave/2.py
 delete mode 100644 advanced/databases/biowave/2.rst
 create mode 100644 system/dataformats/system_username/array_1d_coordinates/1.json

diff --git a/advanced/databases/biowave/1.json b/advanced/databases/biowave/1.json
index c5f97c9..e50328a 100644
--- a/advanced/databases/biowave/1.json
+++ b/advanced/databases/biowave/1.json
@@ -15,8 +15,7 @@
                     "template": "train",
                     "parameters": {
                         "protocol": "Idiap_1_1_R_BEAT_test",
-                        "group": "world",
-                        "annotated_images": "False"
+                        "group": "world"
                     },
                     "name": "train"
                 },
@@ -31,8 +30,7 @@
                     "parameters": {
                         "protocol": "Idiap_1_1_R_BEAT_test",
                         "group": "dev",
-                        "purpose": "enroll",
-                        "annotated_images": "False"
+                        "purpose": "enroll"
                     },
                     "template": "enroll"
                 },
@@ -46,8 +44,7 @@
                     "parameters": {
                         "protocol": "Idiap_1_1_R_BEAT_test",
                         "group": "dev",
-                        "purpose": "probe",
-                        "annotated_images": "False"
+                        "purpose": "probe"
                     },
                     "template": "probe"
                 },
@@ -62,8 +59,7 @@
                     "parameters": {
                         "protocol": "Idiap_1_1_R_BEAT_test",
                         "group": "eval",
-                        "purpose": "enroll",
-                        "annotated_images": "False"
+                        "purpose": "enroll"
                     },
                     "template": "enroll"
                 },
@@ -77,8 +73,7 @@
                     "parameters": {
                         "protocol": "Idiap_1_1_R_BEAT_test",
                         "group": "eval",
-                        "purpose": "probe",
-                        "annotated_images": "False"
+                        "purpose": "probe"
                     },
                     "template": "probe"
                 }
@@ -97,8 +92,7 @@
                     "template": "train",
                     "parameters": {
                         "protocol": "Idiap_5_5_R_BEAT_test",
-                        "group": "world",
-                        "annotated_images": "False"
+                        "group": "world"
                     },
                     "name": "train"
                 },
@@ -113,8 +107,7 @@
                     "parameters": {
                         "protocol": "Idiap_5_5_R_BEAT_test",
                         "group": "dev",
-                        "purpose": "enroll",
-                        "annotated_images": "False"
+                        "purpose": "enroll"
                     },
                     "template": "enroll"
                 },
@@ -128,8 +121,7 @@
                     "parameters": {
                         "protocol": "Idiap_5_5_R_BEAT_test",
                         "group": "dev",
-                        "purpose": "probe",
-                        "annotated_images": "False"
+                        "purpose": "probe"
                     },
                     "template": "probe"
                 },
@@ -144,8 +136,7 @@
                     "parameters": {
                         "protocol": "Idiap_5_5_R_BEAT_test",
                         "group": "eval",
-                        "purpose": "enroll",
-                        "annotated_images": "False"
+                        "purpose": "enroll"
                     },
                     "template": "enroll"
                 },
@@ -159,8 +150,7 @@
                     "parameters": {
                         "protocol": "Idiap_5_5_R_BEAT_test",
                         "group": "eval",
-                        "purpose": "probe",
-                        "annotated_images": "False"
+                        "purpose": "probe"
                     },
                     "template": "probe"
                 }
@@ -179,8 +169,7 @@
                     "template": "train",
                     "parameters": {
                         "protocol": "Idiap_1_5_R_BEAT_test",
-                        "group": "world",
-                        "annotated_images": "False"
+                        "group": "world"
                     },
                     "name": "train"
                 },
@@ -195,8 +184,7 @@
                     "parameters": {
                         "protocol": "Idiap_1_5_R_BEAT_test",
                         "group": "dev",
-                        "purpose": "enroll",
-                        "annotated_images": "False"
+                        "purpose": "enroll"
                     },
                     "template": "enroll"
                 },
@@ -210,8 +198,7 @@
                     "parameters": {
                         "protocol": "Idiap_1_5_R_BEAT_test",
                         "group": "dev",
-                        "purpose": "probe",
-                        "annotated_images": "False"
+                        "purpose": "probe"
                     },
                     "template": "probe"
                 },
@@ -226,8 +213,7 @@
                     "parameters": {
                         "protocol": "Idiap_1_5_R_BEAT_test",
                         "group": "eval",
-                        "purpose": "enroll",
-                        "annotated_images": "False"
+                        "purpose": "enroll"
                     },
                     "template": "enroll"
                 },
@@ -241,8 +227,7 @@
                     "parameters": {
                         "protocol": "Idiap_1_5_R_BEAT_test",
                         "group": "eval",
-                        "purpose": "probe",
-                        "annotated_images": "False"
+                        "purpose": "probe"
                     },
                     "template": "probe"
                 }
@@ -261,8 +246,7 @@
                     "template": "train",
                     "parameters": {
                         "protocol": "Idiap_1_1_R",
-                        "group": "world",
-                        "annotated_images": "False"
+                        "group": "world"
                     },
                     "name": "train"
                 },
@@ -277,8 +261,7 @@
                     "parameters": {
                         "protocol": "Idiap_1_1_R",
                         "group": "dev",
-                        "purpose": "enroll",
-                        "annotated_images": "False"
+                        "purpose": "enroll"
                     },
                     "template": "enroll"
                 },
@@ -292,8 +275,7 @@
                     "parameters": {
                         "protocol": "Idiap_1_1_R",
                         "group": "dev",
-                        "purpose": "probe",
-                        "annotated_images": "False"
+                        "purpose": "probe"
                     },
                     "template": "probe"
                 },
@@ -308,8 +290,7 @@
                     "parameters": {
                         "protocol": "Idiap_1_1_R",
                         "group": "eval",
-                        "purpose": "enroll",
-                        "annotated_images": "False"
+                        "purpose": "enroll"
                     },
                     "template": "enroll"
                 },
@@ -323,8 +304,7 @@
                     "parameters": {
                         "protocol": "Idiap_1_1_R",
                         "group": "eval",
-                        "purpose": "probe",
-                        "annotated_images": "False"
+                        "purpose": "probe"
                     },
                     "template": "probe"
                 }
@@ -343,8 +323,7 @@
                     "template": "train",
                     "parameters": {
                         "protocol": "Idiap_1_5_R",
-                        "group": "world",
-                        "annotated_images": "False"
+                        "group": "world"
                     },
                     "name": "train"
                 },
@@ -359,8 +338,7 @@
                     "parameters": {
                         "protocol": "Idiap_1_5_R",
                         "group": "dev",
-                        "purpose": "enroll",
-                        "annotated_images": "False"
+                        "purpose": "enroll"
                     },
                     "template": "enroll"
                 },
@@ -374,8 +352,7 @@
                     "parameters": {
                         "protocol": "Idiap_1_5_R",
                         "group": "dev",
-                        "purpose": "probe",
-                        "annotated_images": "False"
+                        "purpose": "probe"
                     },
                     "template": "probe"
                 },
@@ -390,8 +367,7 @@
                     "parameters": {
                         "protocol": "Idiap_1_5_R",
                         "group": "eval",
-                        "purpose": "enroll",
-                        "annotated_images": "False"
+                        "purpose": "enroll"
                     },
                     "template": "enroll"
                 },
@@ -405,8 +381,7 @@
                     "parameters": {
                         "protocol": "Idiap_1_5_R",
                         "group": "eval",
-                        "purpose": "probe",
-                        "annotated_images": "False"
+                        "purpose": "probe"
                     },
                     "template": "probe"
                 }
@@ -425,8 +400,7 @@
                     "template": "train",
                     "parameters": {
                         "protocol": "Idiap_5_5_R",
-                        "group": "world",
-                        "annotated_images": "False"
+                        "group": "world"
                     },
                     "name": "train"
                 },
@@ -441,8 +415,7 @@
                     "parameters": {
                         "protocol": "Idiap_5_5_R",
                         "group": "dev",
-                        "purpose": "enroll",
-                        "annotated_images": "False"
+                        "purpose": "enroll"
                     },
                     "template": "enroll"
                 },
@@ -456,8 +429,7 @@
                     "parameters": {
                         "protocol": "Idiap_5_5_R",
                         "group": "dev",
-                        "purpose": "probe",
-                        "annotated_images": "False"
+                        "purpose": "probe"
                     },
                     "template": "probe"
                 },
@@ -472,8 +444,7 @@
                     "parameters": {
                         "protocol": "Idiap_5_5_R",
                         "group": "eval",
-                        "purpose": "enroll",
-                        "annotated_images": "False"
+                        "purpose": "enroll"
                     },
                     "template": "enroll"
                 },
@@ -487,8 +458,7 @@
                     "parameters": {
                         "protocol": "Idiap_5_5_R",
                         "group": "eval",
-                        "purpose": "probe",
-                        "annotated_images": "False"
+                        "purpose": "probe"
                     },
                     "template": "probe"
                 }
@@ -507,8 +477,7 @@
                     "template": "train",
                     "parameters": {
                         "protocol": "Idiap_1_1_L",
-                        "group": "world",
-                        "annotated_images": "False"
+                        "group": "world"
                     },
                     "name": "train"
                 },
@@ -523,8 +492,7 @@
                     "parameters": {
                         "protocol": "Idiap_1_1_L",
                         "group": "dev",
-                        "purpose": "enroll",
-                        "annotated_images": "False"
+                        "purpose": "enroll"
                     },
                     "template": "enroll"
                 },
@@ -538,8 +506,7 @@
                     "parameters": {
                         "protocol": "Idiap_1_1_L",
                         "group": "dev",
-                        "purpose": "probe",
-                        "annotated_images": "False"
+                        "purpose": "probe"
                     },
                     "template": "probe"
                 },
@@ -554,8 +521,7 @@
                     "parameters": {
                         "protocol": "Idiap_1_1_L",
                         "group": "eval",
-                        "purpose": "enroll",
-                        "annotated_images": "False"
+                        "purpose": "enroll"
                     },
                     "template": "enroll"
                 },
@@ -569,8 +535,7 @@
                     "parameters": {
                         "protocol": "Idiap_1_1_L",
                         "group": "eval",
-                        "purpose": "probe",
-                        "annotated_images": "False"
+                        "purpose": "probe"
                     },
                     "template": "probe"
                 }
@@ -589,8 +554,7 @@
                     "template": "train",
                     "parameters": {
                         "protocol": "Idiap_1_5_L",
-                        "group": "world",
-                        "annotated_images": "False"
+                        "group": "world"
                     },
                     "name": "train"
                 },
@@ -605,8 +569,7 @@
                     "parameters": {
                         "protocol": "Idiap_1_5_L",
                         "group": "dev",
-                        "purpose": "enroll",
-                        "annotated_images": "False"
+                        "purpose": "enroll"
                     },
                     "template": "enroll"
                 },
@@ -620,8 +583,7 @@
                     "parameters": {
                         "protocol": "Idiap_1_5_L",
                         "group": "dev",
-                        "purpose": "probe",
-                        "annotated_images": "False"
+                        "purpose": "probe"
                     },
                     "template": "probe"
                 },
@@ -636,8 +598,7 @@
                     "parameters": {
                         "protocol": "Idiap_1_5_L",
                         "group": "eval",
-                        "purpose": "enroll",
-                        "annotated_images": "False"
+                        "purpose": "enroll"
                     },
                     "template": "enroll"
                 },
@@ -651,8 +612,7 @@
                     "parameters": {
                         "protocol": "Idiap_1_5_L",
                         "group": "eval",
-                        "purpose": "probe",
-                        "annotated_images": "False"
+                        "purpose": "probe"
                     },
                     "template": "probe"
                 }
@@ -671,8 +631,7 @@
                     "template": "train",
                     "parameters": {
                         "protocol": "Idiap_5_5_L",
-                        "group": "world",
-                        "annotated_images": "False"
+                        "group": "world"
                     },
                     "name": "train"
                 },
@@ -687,8 +646,7 @@
                     "parameters": {
                         "protocol": "Idiap_5_5_L",
                         "group": "dev",
-                        "purpose": "enroll",
-                        "annotated_images": "False"
+                        "purpose": "enroll"
                     },
                     "template": "enroll"
                 },
@@ -702,8 +660,7 @@
                     "parameters": {
                         "protocol": "Idiap_5_5_L",
                         "group": "dev",
-                        "purpose": "probe",
-                        "annotated_images": "False"
+                        "purpose": "probe"
                     },
                     "template": "probe"
                 },
@@ -718,8 +675,7 @@
                     "parameters": {
                         "protocol": "Idiap_5_5_L",
                         "group": "eval",
-                        "purpose": "enroll",
-                        "annotated_images": "False"
+                        "purpose": "enroll"
                     },
                     "template": "enroll"
                 },
@@ -733,8 +689,7 @@
                     "parameters": {
                         "protocol": "Idiap_5_5_L",
                         "group": "eval",
-                        "purpose": "probe",
-                        "annotated_images": "False"
+                        "purpose": "probe"
                     },
                     "template": "probe"
                 }
@@ -753,8 +708,7 @@
                     "template": "train",
                     "parameters": {
                         "protocol": "Idiap_1_1_R_less",
-                        "group": "world",
-                        "annotated_images": "False"
+                        "group": "world"
                     },
                     "name": "train"
                 },
@@ -769,8 +723,7 @@
                     "parameters": {
                         "protocol": "Idiap_1_1_R_less",
                         "group": "dev",
-                        "purpose": "enroll",
-                        "annotated_images": "False"
+                        "purpose": "enroll"
                     },
                     "template": "enroll"
                 },
@@ -784,8 +737,7 @@
                     "parameters": {
                         "protocol": "Idiap_1_1_R_less",
                         "group": "dev",
-                        "purpose": "probe",
-                        "annotated_images": "False"
+                        "purpose": "probe"
                     },
                     "template": "probe"
                 },
@@ -800,8 +752,7 @@
                     "parameters": {
                         "protocol": "Idiap_1_1_R_less",
                         "group": "eval",
-                        "purpose": "enroll",
-                        "annotated_images": "False"
+                        "purpose": "enroll"
                     },
                     "template": "enroll"
                 },
@@ -815,8 +766,7 @@
                     "parameters": {
                         "protocol": "Idiap_1_1_R_less",
                         "group": "eval",
-                        "purpose": "probe",
-                        "annotated_images": "False"
+                        "purpose": "probe"
                     },
                     "template": "probe"
                 }
@@ -835,8 +785,7 @@
                     "template": "train",
                     "parameters": {
                         "protocol": "Idiap_1_5_R_less",
-                        "group": "world",
-                        "annotated_images": "False"
+                        "group": "world"
                     },
                     "name": "train"
                 },
@@ -851,8 +800,7 @@
                     "parameters": {
                         "protocol": "Idiap_1_5_R_less",
                         "group": "dev",
-                        "purpose": "enroll",
-                        "annotated_images": "False"
+                        "purpose": "enroll"
                     },
                     "template": "enroll"
                 },
@@ -866,8 +814,7 @@
                     "parameters": {
                         "protocol": "Idiap_1_5_R_less",
                         "group": "dev",
-                        "purpose": "probe",
-                        "annotated_images": "False"
+                        "purpose": "probe"
                     },
                     "template": "probe"
                 },
@@ -882,8 +829,7 @@
                     "parameters": {
                         "protocol": "Idiap_1_5_R_less",
                         "group": "eval",
-                        "purpose": "enroll",
-                        "annotated_images": "False"
+                        "purpose": "enroll"
                     },
                     "template": "enroll"
                 },
@@ -897,8 +843,7 @@
                     "parameters": {
                         "protocol": "Idiap_1_5_R_less",
                         "group": "eval",
-                        "purpose": "probe",
-                        "annotated_images": "False"
+                        "purpose": "probe"
                     },
                     "template": "probe"
                 }
@@ -917,8 +862,7 @@
                     "template": "train",
                     "parameters": {
                         "protocol": "Idiap_5_5_R_less",
-                        "group": "world",
-                        "annotated_images": "False"
+                        "group": "world"
                     },
                     "name": "train"
                 },
@@ -933,8 +877,7 @@
                     "parameters": {
                         "protocol": "Idiap_5_5_R_less",
                         "group": "dev",
-                        "purpose": "enroll",
-                        "annotated_images": "False"
+                        "purpose": "enroll"
                     },
                     "template": "enroll"
                 },
@@ -948,8 +891,7 @@
                     "parameters": {
                         "protocol": "Idiap_5_5_R_less",
                         "group": "dev",
-                        "purpose": "probe",
-                        "annotated_images": "False"
+                        "purpose": "probe"
                     },
                     "template": "probe"
                 },
@@ -964,8 +906,7 @@
                     "parameters": {
                         "protocol": "Idiap_5_5_R_less",
                         "group": "eval",
-                        "purpose": "enroll",
-                        "annotated_images": "False"
+                        "purpose": "enroll"
                     },
                     "template": "enroll"
                 },
@@ -979,8 +920,7 @@
                     "parameters": {
                         "protocol": "Idiap_5_5_R_less",
                         "group": "eval",
-                        "purpose": "probe",
-                        "annotated_images": "False"
+                        "purpose": "probe"
                     },
                     "template": "probe"
                 }
@@ -995,15 +935,14 @@
                         "image": "{{ system_user.username }}/array_2d_uint8/1",
                         "vein_annotations": "{{ system_user.username }}/array_2d_uint8/1",
                         "ROI_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "alignment_annotations": "{{ user.username }}/coordinate_list/1",
+                        "alignment_annotations": "{{ system_user.username }}/array_1d_coordinates/1",
                         "client_id": "{{ system_user.username }}/uint64/1"
                     },
                     "view": "ViewAnnotations",
                     "template": "train",
                     "parameters": {
                         "protocol": "Idiap_1_1_R_BEAT_test",
-                        "group": "world",
-                        "annotated_images": "True"
+                        "group": "world"
                     },
                     "name": "train"
                 },
@@ -1013,7 +952,7 @@
                         "image": "{{ system_user.username }}/array_2d_uint8/1",
                         "vein_annotations": "{{ system_user.username }}/array_2d_uint8/1",
                         "ROI_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "alignment_annotations": "{{ user.username }}/coordinate_list/1",
+                        "alignment_annotations": "{{ system_user.username }}/array_1d_coordinates/1",
                         "client_id": "{{ system_user.username }}/uint64/1"
                     },
                     "view": "TemplateViewAnnotations",
@@ -1021,8 +960,7 @@
                     "parameters": {
                         "protocol": "Idiap_1_1_R_BEAT_test",
                         "group": "dev",
-                        "purpose": "enroll",
-                        "annotated_images": "True"
+                        "purpose": "enroll"
                     },
                     "template": "enroll"
                 },
@@ -1031,7 +969,7 @@
                         "image": "{{ system_user.username }}/array_2d_uint8/1",
                         "vein_annotations": "{{ system_user.username }}/array_2d_uint8/1",
                         "ROI_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "alignment_annotations": "{{ user.username }}/coordinate_list/1",
+                        "alignment_annotations": "{{ system_user.username }}/array_1d_coordinates/1",
                         "client_id": "{{ system_user.username }}/uint64/1"
                     },
                     "view": "ViewAnnotations",
@@ -1039,8 +977,7 @@
                     "parameters": {
                         "protocol": "Idiap_1_1_R_BEAT_test",
                         "group": "dev",
-                        "purpose": "probe",
-                        "annotated_images": "True"
+                        "purpose": "probe"
                     },
                     "template": "probe"
                 },
@@ -1050,7 +987,7 @@
                         "image": "{{ system_user.username }}/array_2d_uint8/1",
                         "vein_annotations": "{{ system_user.username }}/array_2d_uint8/1",
                         "ROI_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "alignment_annotations": "{{ user.username }}/coordinate_list/1",
+                        "alignment_annotations": "{{ system_user.username }}/array_1d_coordinates/1",
                         "client_id": "{{ system_user.username }}/uint64/1"
                     },
                     "view": "TemplateViewAnnotations",
@@ -1058,8 +995,7 @@
                     "parameters": {
                         "protocol": "Idiap_1_1_R_BEAT_test",
                         "group": "eval",
-                        "purpose": "enroll",
-                        "annotated_images": "True"
+                        "purpose": "enroll"
                     },
                     "template": "enroll"
                 },
@@ -1068,7 +1004,7 @@
                         "image": "{{ system_user.username }}/array_2d_uint8/1",
                         "vein_annotations": "{{ system_user.username }}/array_2d_uint8/1",
                         "ROI_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "alignment_annotations": "{{ user.username }}/coordinate_list/1",
+                        "alignment_annotations": "{{ system_user.username }}/array_1d_coordinates/1",
                         "client_id": "{{ system_user.username }}/uint64/1"
                     },
                     "view": "TemplateViewAnnotations",
@@ -1076,8 +1012,7 @@
                     "parameters": {
                         "protocol": "Idiap_1_1_R_BEAT_test",
                         "group": "eval",
-                        "purpose": "probe",
-                        "annotated_images": "True"
+                        "purpose": "probe"
                     },
                     "template": "probe"
                 }
@@ -1092,15 +1027,14 @@
                         "image": "{{ system_user.username }}/array_2d_uint8/1",
                         "vein_annotations": "{{ system_user.username }}/array_2d_uint8/1",
                         "ROI_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "alignment_annotations": "{{ user.username }}/coordinate_list/1",
+                        "alignment_annotations": "{{ system_user.username }}/array_1d_coordinates/1",
                         "client_id": "{{ system_user.username }}/uint64/1"
                     },
                     "view": "ViewAnnotations",
                     "template": "train",
                     "parameters": {
                         "protocol": "Idiap_5_5_R_BEAT_test",
-                        "group": "world",
-                        "annotated_images": "True"
+                        "group": "world"
                     },
                     "name": "train"
                 },
@@ -1110,7 +1044,7 @@
                         "image": "{{ system_user.username }}/array_2d_uint8/1",
                         "vein_annotations": "{{ system_user.username }}/array_2d_uint8/1",
                         "ROI_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "alignment_annotations": "{{ user.username }}/coordinate_list/1",
+                        "alignment_annotations": "{{ system_user.username }}/array_1d_coordinates/1",
                         "client_id": "{{ system_user.username }}/uint64/1"
                     },
                     "view": "TemplateViewAnnotations",
@@ -1118,8 +1052,7 @@
                     "parameters": {
                         "protocol": "Idiap_5_5_R_BEAT_test",
                         "group": "dev",
-                        "purpose": "enroll",
-                        "annotated_images": "True"
+                        "purpose": "enroll"
                     },
                     "template": "enroll"
                 },
@@ -1128,7 +1061,7 @@
                         "image": "{{ system_user.username }}/array_2d_uint8/1",
                         "vein_annotations": "{{ system_user.username }}/array_2d_uint8/1",
                         "ROI_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "alignment_annotations": "{{ user.username }}/coordinate_list/1",
+                        "alignment_annotations": "{{ system_user.username }}/array_1d_coordinates/1",
                         "client_id": "{{ system_user.username }}/uint64/1"
                     },
                     "view": "ViewAnnotations",
@@ -1136,8 +1069,7 @@
                     "parameters": {
                         "protocol": "Idiap_5_5_R_BEAT_test",
                         "group": "dev",
-                        "purpose": "probe",
-                        "annotated_images": "True"
+                        "purpose": "probe"
                     },
                     "template": "probe"
                 },
@@ -1147,7 +1079,7 @@
                         "image": "{{ system_user.username }}/array_2d_uint8/1",
                         "vein_annotations": "{{ system_user.username }}/array_2d_uint8/1",
                         "ROI_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "alignment_annotations": "{{ user.username }}/coordinate_list/1",
+                        "alignment_annotations": "{{ system_user.username }}/array_1d_coordinates/1",
                         "client_id": "{{ system_user.username }}/uint64/1"
                     },
                     "view": "TemplateViewAnnotations",
@@ -1155,8 +1087,7 @@
                     "parameters": {
                         "protocol": "Idiap_5_5_R_BEAT_test",
                         "group": "eval",
-                        "purpose": "enroll",
-                        "annotated_images": "True"
+                        "purpose": "enroll"
                     },
                     "template": "enroll"
                 },
@@ -1165,7 +1096,7 @@
                         "image": "{{ system_user.username }}/array_2d_uint8/1",
                         "vein_annotations": "{{ system_user.username }}/array_2d_uint8/1",
                         "ROI_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "alignment_annotations": "{{ user.username }}/coordinate_list/1",
+                        "alignment_annotations": "{{ system_user.username }}/array_1d_coordinates/1",
                         "client_id": "{{ system_user.username }}/uint64/1"
                     },
                     "view": "TemplateViewAnnotations",
@@ -1173,8 +1104,7 @@
                     "parameters": {
                         "protocol": "Idiap_5_5_R_BEAT_test",
                         "group": "eval",
-                        "purpose": "probe",
-                        "annotated_images": "True"
+                        "purpose": "probe"
                     },
                     "template": "probe"
                 }
@@ -1189,15 +1119,14 @@
                         "image": "{{ system_user.username }}/array_2d_uint8/1",
                         "vein_annotations": "{{ system_user.username }}/array_2d_uint8/1",
                         "ROI_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "alignment_annotations": "{{ user.username }}/coordinate_list/1",
+                        "alignment_annotations": "{{ system_user.username }}/array_1d_coordinates/1",
                         "client_id": "{{ system_user.username }}/uint64/1"
                     },
                     "view": "ViewAnnotations",
                     "template": "train",
                     "parameters": {
                         "protocol": "Idiap_1_1_R",
-                        "group": "world",
-                        "annotated_images": "True"
+                        "group": "world"
                     },
                     "name": "train"
                 },
@@ -1207,7 +1136,7 @@
                         "image": "{{ system_user.username }}/array_2d_uint8/1",
                         "vein_annotations": "{{ system_user.username }}/array_2d_uint8/1",
                         "ROI_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "alignment_annotations": "{{ user.username }}/coordinate_list/1",
+                        "alignment_annotations": "{{ system_user.username }}/array_1d_coordinates/1",
                         "client_id": "{{ system_user.username }}/uint64/1"
                     },
                     "view": "TemplateViewAnnotations",
@@ -1215,8 +1144,7 @@
                     "parameters": {
                         "protocol": "Idiap_1_1_R",
                         "group": "dev",
-                        "purpose": "enroll",
-                        "annotated_images": "True"
+                        "purpose": "enroll"
                     },
                     "template": "enroll"
                 },
@@ -1225,7 +1153,7 @@
                         "image": "{{ system_user.username }}/array_2d_uint8/1",
                         "vein_annotations": "{{ system_user.username }}/array_2d_uint8/1",
                         "ROI_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "alignment_annotations": "{{ user.username }}/coordinate_list/1",
+                        "alignment_annotations": "{{ system_user.username }}/array_1d_coordinates/1",
                         "client_id": "{{ system_user.username }}/uint64/1"
                     },
                     "view": "ViewAnnotations",
@@ -1233,8 +1161,7 @@
                     "parameters": {
                         "protocol": "Idiap_1_1_R",
                         "group": "dev",
-                        "purpose": "probe",
-                        "annotated_images": "True"
+                        "purpose": "probe"
                     },
                     "template": "probe"
                 },
@@ -1244,7 +1171,7 @@
                         "image": "{{ system_user.username }}/array_2d_uint8/1",
                         "vein_annotations": "{{ system_user.username }}/array_2d_uint8/1",
                         "ROI_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "alignment_annotations": "{{ user.username }}/coordinate_list/1",
+                        "alignment_annotations": "{{ system_user.username }}/array_1d_coordinates/1",
                         "client_id": "{{ system_user.username }}/uint64/1"
                     },
                     "view": "TemplateViewAnnotations",
@@ -1252,8 +1179,7 @@
                     "parameters": {
                         "protocol": "Idiap_1_1_R",
                         "group": "eval",
-                        "purpose": "enroll",
-                        "annotated_images": "True"
+                        "purpose": "enroll"
                     },
                     "template": "enroll"
                 },
@@ -1262,7 +1188,7 @@
                         "image": "{{ system_user.username }}/array_2d_uint8/1",
                         "vein_annotations": "{{ system_user.username }}/array_2d_uint8/1",
                         "ROI_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "alignment_annotations": "{{ user.username }}/coordinate_list/1",
+                        "alignment_annotations": "{{ system_user.username }}/array_1d_coordinates/1",
                         "client_id": "{{ system_user.username }}/uint64/1"
                     },
                     "view": "TemplateViewAnnotations",
@@ -1270,8 +1196,7 @@
                     "parameters": {
                         "protocol": "Idiap_1_1_R",
                         "group": "eval",
-                        "purpose": "probe",
-                        "annotated_images": "True"
+                        "purpose": "probe"
                     },
                     "template": "probe"
                 }
@@ -1286,15 +1211,14 @@
                         "image": "{{ system_user.username }}/array_2d_uint8/1",
                         "vein_annotations": "{{ system_user.username }}/array_2d_uint8/1",
                         "ROI_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "alignment_annotations": "{{ user.username }}/coordinate_list/1",
+                        "alignment_annotations": "{{ system_user.username }}/array_1d_coordinates/1",
                         "client_id": "{{ system_user.username }}/uint64/1"
                     },
                     "view": "ViewAnnotations",
                     "template": "train",
                     "parameters": {
                         "protocol": "Idiap_5_5_R",
-                        "group": "world",
-                        "annotated_images": "True"
+                        "group": "world"
                     },
                     "name": "train"
                 },
@@ -1304,7 +1228,7 @@
                         "image": "{{ system_user.username }}/array_2d_uint8/1",
                         "vein_annotations": "{{ system_user.username }}/array_2d_uint8/1",
                         "ROI_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "alignment_annotations": "{{ user.username }}/coordinate_list/1",
+                        "alignment_annotations": "{{ system_user.username }}/array_1d_coordinates/1",
                         "client_id": "{{ system_user.username }}/uint64/1"
                     },
                     "view": "TemplateViewAnnotations",
@@ -1312,8 +1236,7 @@
                     "parameters": {
                         "protocol": "Idiap_5_5_R",
                         "group": "dev",
-                        "purpose": "enroll",
-                        "annotated_images": "True"
+                        "purpose": "enroll"
                     },
                     "template": "enroll"
                 },
@@ -1322,7 +1245,7 @@
                         "image": "{{ system_user.username }}/array_2d_uint8/1",
                         "vein_annotations": "{{ system_user.username }}/array_2d_uint8/1",
                         "ROI_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "alignment_annotations": "{{ user.username }}/coordinate_list/1",
+                        "alignment_annotations": "{{ system_user.username }}/array_1d_coordinates/1",
                         "client_id": "{{ system_user.username }}/uint64/1"
                     },
                     "view": "ViewAnnotations",
@@ -1330,8 +1253,7 @@
                     "parameters": {
                         "protocol": "Idiap_5_5_R",
                         "group": "dev",
-                        "purpose": "probe",
-                        "annotated_images": "True"
+                        "purpose": "probe"
                     },
                     "template": "probe"
                 },
@@ -1341,7 +1263,7 @@
                         "image": "{{ system_user.username }}/array_2d_uint8/1",
                         "vein_annotations": "{{ system_user.username }}/array_2d_uint8/1",
                         "ROI_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "alignment_annotations": "{{ user.username }}/coordinate_list/1",
+                        "alignment_annotations": "{{ system_user.username }}/array_1d_coordinates/1",
                         "client_id": "{{ system_user.username }}/uint64/1"
                     },
                     "view": "TemplateViewAnnotations",
@@ -1349,8 +1271,7 @@
                     "parameters": {
                         "protocol": "Idiap_5_5_R",
                         "group": "eval",
-                        "purpose": "enroll",
-                        "annotated_images": "True"
+                        "purpose": "enroll"
                     },
                     "template": "enroll"
                 },
@@ -1359,7 +1280,7 @@
                         "image": "{{ system_user.username }}/array_2d_uint8/1",
                         "vein_annotations": "{{ system_user.username }}/array_2d_uint8/1",
                         "ROI_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "alignment_annotations": "{{ user.username }}/coordinate_list/1",
+                        "alignment_annotations": "{{ system_user.username }}/array_1d_coordinates/1",
                         "client_id": "{{ system_user.username }}/uint64/1"
                     },
                     "view": "TemplateViewAnnotations",
@@ -1367,8 +1288,7 @@
                     "parameters": {
                         "protocol": "Idiap_5_5_R",
                         "group": "eval",
-                        "purpose": "probe",
-                        "annotated_images": "True"
+                        "purpose": "probe"
                     },
                     "template": "probe"
                 }
@@ -1383,15 +1303,14 @@
                         "image": "{{ system_user.username }}/array_2d_uint8/1",
                         "vein_annotations": "{{ system_user.username }}/array_2d_uint8/1",
                         "ROI_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "alignment_annotations": "{{ user.username }}/coordinate_list/1",
+                        "alignment_annotations": "{{ system_user.username }}/array_1d_coordinates/1",
                         "client_id": "{{ system_user.username }}/uint64/1"
                     },
                     "view": "ViewAnnotations",
                     "template": "train",
                     "parameters": {
                         "protocol": "Idiap_1_1_L",
-                        "group": "world",
-                        "annotated_images": "True"
+                        "group": "world"
                     },
                     "name": "train"
                 },
@@ -1401,7 +1320,7 @@
                         "image": "{{ system_user.username }}/array_2d_uint8/1",
                         "vein_annotations": "{{ system_user.username }}/array_2d_uint8/1",
                         "ROI_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "alignment_annotations": "{{ user.username }}/coordinate_list/1",
+                        "alignment_annotations": "{{ system_user.username }}/array_1d_coordinates/1",
                         "client_id": "{{ system_user.username }}/uint64/1"
                     },
                     "view": "TemplateViewAnnotations",
@@ -1409,8 +1328,7 @@
                     "parameters": {
                         "protocol": "Idiap_1_1_L",
                         "group": "dev",
-                        "purpose": "enroll",
-                        "annotated_images": "True"
+                        "purpose": "enroll"
                     },
                     "template": "enroll"
                 },
@@ -1419,7 +1337,7 @@
                         "image": "{{ system_user.username }}/array_2d_uint8/1",
                         "vein_annotations": "{{ system_user.username }}/array_2d_uint8/1",
                         "ROI_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "alignment_annotations": "{{ user.username }}/coordinate_list/1",
+                        "alignment_annotations": "{{ system_user.username }}/array_1d_coordinates/1",
                         "client_id": "{{ system_user.username }}/uint64/1"
                     },
                     "view": "ViewAnnotations",
@@ -1427,8 +1345,7 @@
                     "parameters": {
                         "protocol": "Idiap_1_1_L",
                         "group": "dev",
-                        "purpose": "probe",
-                        "annotated_images": "True"
+                        "purpose": "probe"
                     },
                     "template": "probe"
                 },
@@ -1438,7 +1355,7 @@
                         "image": "{{ system_user.username }}/array_2d_uint8/1",
                         "vein_annotations": "{{ system_user.username }}/array_2d_uint8/1",
                         "ROI_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "alignment_annotations": "{{ user.username }}/coordinate_list/1",
+                        "alignment_annotations": "{{ system_user.username }}/array_1d_coordinates/1",
                         "client_id": "{{ system_user.username }}/uint64/1"
                     },
                     "view": "TemplateViewAnnotations",
@@ -1446,8 +1363,7 @@
                     "parameters": {
                         "protocol": "Idiap_1_1_L",
                         "group": "eval",
-                        "purpose": "enroll",
-                        "annotated_images": "True"
+                        "purpose": "enroll"
                     },
                     "template": "enroll"
                 },
@@ -1456,7 +1372,7 @@
                         "image": "{{ system_user.username }}/array_2d_uint8/1",
                         "vein_annotations": "{{ system_user.username }}/array_2d_uint8/1",
                         "ROI_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "alignment_annotations": "{{ user.username }}/coordinate_list/1",
+                        "alignment_annotations": "{{ system_user.username }}/array_1d_coordinates/1",
                         "client_id": "{{ system_user.username }}/uint64/1"
                     },
                     "view": "TemplateViewAnnotations",
@@ -1464,8 +1380,7 @@
                     "parameters": {
                         "protocol": "Idiap_1_1_L",
                         "group": "eval",
-                        "purpose": "probe",
-                        "annotated_images": "True"
+                        "purpose": "probe"
                     },
                     "template": "probe"
                 }
@@ -1480,15 +1395,14 @@
                         "image": "{{ system_user.username }}/array_2d_uint8/1",
                         "vein_annotations": "{{ system_user.username }}/array_2d_uint8/1",
                         "ROI_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "alignment_annotations": "{{ user.username }}/coordinate_list/1",
+                        "alignment_annotations": "{{ system_user.username }}/array_1d_coordinates/1",
                         "client_id": "{{ system_user.username }}/uint64/1"
                     },
                     "view": "ViewAnnotations",
                     "template": "train",
                     "parameters": {
                         "protocol": "Idiap_5_5_L",
-                        "group": "world",
-                        "annotated_images": "True"
+                        "group": "world"
                     },
                     "name": "train"
                 },
@@ -1498,7 +1412,7 @@
                         "image": "{{ system_user.username }}/array_2d_uint8/1",
                         "vein_annotations": "{{ system_user.username }}/array_2d_uint8/1",
                         "ROI_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "alignment_annotations": "{{ user.username }}/coordinate_list/1",
+                        "alignment_annotations": "{{ system_user.username }}/array_1d_coordinates/1",
                         "client_id": "{{ system_user.username }}/uint64/1"
                     },
                     "view": "TemplateViewAnnotations",
@@ -1506,8 +1420,7 @@
                     "parameters": {
                         "protocol": "Idiap_5_5_L",
                         "group": "dev",
-                        "purpose": "enroll",
-                        "annotated_images": "True"
+                        "purpose": "enroll"
                     },
                     "template": "enroll"
                 },
@@ -1516,7 +1429,7 @@
                         "image": "{{ system_user.username }}/array_2d_uint8/1",
                         "vein_annotations": "{{ system_user.username }}/array_2d_uint8/1",
                         "ROI_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "alignment_annotations": "{{ user.username }}/coordinate_list/1",
+                        "alignment_annotations": "{{ system_user.username }}/array_1d_coordinates/1",
                         "client_id": "{{ system_user.username }}/uint64/1"
                     },
                     "view": "ViewAnnotations",
@@ -1524,8 +1437,7 @@
                     "parameters": {
                         "protocol": "Idiap_5_5_L",
                         "group": "dev",
-                        "purpose": "probe",
-                        "annotated_images": "True"
+                        "purpose": "probe"
                     },
                     "template": "probe"
                 },
@@ -1535,7 +1447,7 @@
                         "image": "{{ system_user.username }}/array_2d_uint8/1",
                         "vein_annotations": "{{ system_user.username }}/array_2d_uint8/1",
                         "ROI_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "alignment_annotations": "{{ user.username }}/coordinate_list/1",
+                        "alignment_annotations": "{{ system_user.username }}/array_1d_coordinates/1",
                         "client_id": "{{ system_user.username }}/uint64/1"
                     },
                     "view": "TemplateViewAnnotations",
@@ -1543,8 +1455,7 @@
                     "parameters": {
                         "protocol": "Idiap_5_5_L",
                         "group": "eval",
-                        "purpose": "enroll",
-                        "annotated_images": "True"
+                        "purpose": "enroll"
                     },
                     "template": "enroll"
                 },
@@ -1553,7 +1464,7 @@
                         "image": "{{ system_user.username }}/array_2d_uint8/1",
                         "vein_annotations": "{{ system_user.username }}/array_2d_uint8/1",
                         "ROI_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "alignment_annotations": "{{ user.username }}/coordinate_list/1",
+                        "alignment_annotations": "{{ system_user.username }}/array_1d_coordinates/1",
                         "client_id": "{{ system_user.username }}/uint64/1"
                     },
                     "view": "TemplateViewAnnotations",
@@ -1561,8 +1472,7 @@
                     "parameters": {
                         "protocol": "Idiap_5_5_L",
                         "group": "eval",
-                        "purpose": "probe",
-                        "annotated_images": "True"
+                        "purpose": "probe"
                     },
                     "template": "probe"
                 }
@@ -1577,13 +1487,12 @@
                         "image": "{{ system_user.username }}/array_2d_uint8/1",
                         "vein_annotations": "{{ system_user.username }}/array_2d_uint8/1",
                         "ROI_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "alignment_annotations": "{{ user.username }}/coordinate_list/1"
+                        "alignment_annotations": "{{ system_user.username }}/array_1d_coordinates/1"
                     },
                     "view": "AnnotationBenchmark",
                     "template": "annotation_benchmark",
                     "parameters": {
-                        "protocol": "Idiap_1_1_R",
-                        "annotated_images": "True"
+                        "protocol": "Idiap_1_1_R"
                     },
                     "name": "annotations"
                 }
diff --git a/advanced/databases/biowave/1.py b/advanced/databases/biowave/1.py
index 934a0f1..cad66fd 100644
--- a/advanced/databases/biowave/1.py
+++ b/advanced/databases/biowave/1.py
@@ -1,569 +1,745 @@
-import os.path
+###############################################################################
+#                                                                             #
+# Copyright (c) 2017 Idiap Research Institute, http://www.idiap.ch/           #
+# Contact: beat.support@idiap.ch                                              #
+#                                                                             #
+# This file is part of the beat.examples module of the BEAT platform.         #
+#                                                                             #
+# Commercial License Usage                                                    #
+# Licensees holding valid commercial BEAT licenses may use this file in       #
+# accordance with the terms contained in a written agreement between you      #
+# and Idiap. For further information contact tto@idiap.ch                     #
+#                                                                             #
+# Alternatively, this file may be used under the terms of the GNU Affero      #
+# Public License version 3 as published by the Free Software and appearing    #
+# in the file LICENSE.AGPL included in the packaging of this file.            #
+# The BEAT platform is distributed in the hope that it will be useful, but    #
+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY  #
+# or FITNESS FOR A PARTICULAR PURPOSE.                                        #
+#                                                                             #
+# You should have received a copy of the GNU Affero Public License along      #
+# with the BEAT platform. If not, see http://www.gnu.org/licenses/.           #
+#                                                                             #
+###############################################################################
+
+import os
 import numpy as np
 import bob.io.base
 import bob.io.image
 import bob.db.biowave_v1
 
 
-def str_to_bool(string):
-    if string == 'True':
-        return True
-    elif string == 'False':
-        return False
-    else:
-        raise ValueError
+#----------------------------------------------------------
+
+
+def get_client_end_index(objs, client_id, client_start_index,
+                         start_index, end_index):
+    client_end_index = client_start_index
+
+    while client_end_index + 1 <= end_index:
+        obj = objs[client_end_index + 1 - start_index]
+
+        if isinstance(obj, tuple):
+            obj = obj[1]
+
+        if obj.client_id != client_id:
+            return client_end_index
+
+        client_end_index += 1
+
+    return end_index
+
+
+#----------------------------------------------------------
+
+
+def get_model_end_index(objs, model_id, model_start_index,
+                        start_index, end_index):
+    model_end_index = model_start_index
+
+    while model_end_index + 1 <= end_index:
+        obj = objs[model_end_index + 1 - start_index]
+
+        if obj.model_id != model_id:
+            return model_end_index
+
+        model_end_index += 1
+
+    return end_index
+
+
+#----------------------------------------------------------
 
 
 class View:
-    def setup(self,
-              root_folder,
-              outputs,
-              parameters,
-              force_start_index=None,
-              force_end_index=None):
+    """Outputs:
+        - image: "{{ system_user.username }}/array_2d_uint8/1"
+        - client_id: "{{ system_user.username }}/uint64/1"
+
+    Several "image" are associated with a given "client_id".
+
+    --------------- --------------- --------------- --------------- --------------- ---------------
+    |    image    | |    image    | |    image    | |    image    | |    image    | |    image    |
+    --------------- --------------- --------------- --------------- --------------- ---------------
+    ----------------------------------------------- -----------------------------------------------
+    |                   client_id                 | |                   client_id                 |
+    ----------------------------------------------- -----------------------------------------------
+    """
 
-        self.root_folder = os.path.join(root_folder, '')
-        self.outputs = outputs
-        self.parameters = parameters
+    def setup(self, root_folder, outputs, parameters, force_start_index=None,
+              force_end_index=None):
 
-        self.parameters['annotated_images'] = \
-            str_to_bool(self.parameters.get('annotated_images', False))
+        # Initialisations
+        self.root_folder = root_folder
+        self.outputs     = outputs
+        self.parameters  = parameters
 
+        # Open the database and load the objects to provide via the outputs
         self.db = bob.db.biowave_v1.Database()
 
-        self.objs = self.db.objects(
-            protocol=self.parameters['protocol'],
-            purposes=self.parameters.get('purpose', None),
-            groups=[self.parameters['group']],
-            annotated_images=self.parameters['annotated_images'],
-            imagedir=self.root_folder)
-
-        self.next_index = 0
-
-        self.force_start_index = force_start_index
-        self.force_end_index = force_end_index
-
-        # Retrieve only 'useful' data
-        # End index
-        if self.force_end_index is not None:
-            self.objs = self.objs[:self.force_end_index+1]
-        # Start index
-        if self.force_start_index is not None:
-            self.objs = self.objs[self.force_start_index:]
-            self.next_index = self.force_start_index
-        else:
-            self.force_start_index = 0
+        self.objs = sorted(self.db.objects(protocol=self.parameters['protocol'],
+                                           groups=[self.parameters['group']],
+                                           purposes=self.parameters.get('purpose', None),
+                                           annotated_images=False,
+                                           imagedir=self.root_folder),
+                           key=lambda x: (x.client_id, x.id))
+
+        # Determine the range of indices that must be provided
+        self.start_index = force_start_index if force_start_index is not None else 0
+        self.end_index = force_end_index if force_end_index is not None else len(self.objs) - 1
+
+        self.objs = self.objs[self.start_index : self.end_index + 1]
+
+        self.next_index = self.start_index
 
         return True
 
 
-    def done(self):
-        return (self.next_index-self.force_start_index >= len(self.objs))
+    def done(self, last_data_index):
+        return last_data_index >= self.end_index
 
 
     def next(self):
-        obj = self.objs[self.next_index-self.force_start_index]
+        obj = self.objs[self.next_index - self.start_index]
 
-        if self.outputs['client_id'].isConnected():
-            client_id = obj.get_client_id
-            self.outputs['client_id'].write({'value':
-                                             np.uint64(client_id)},
-                                            self.next_index)
+        # Output: client_id (only provide data when the client_id change)
+        if self.outputs['client_id'].isConnected() and \
+           self.outputs['client_id'].last_written_data_index < self.next_index:
 
-        if "enroll" in self.parameters.get('purpose', ""):
-            if self.outputs['model_id'].isConnected():
+            client_end_index = get_client_end_index(self.objs, obj.client_id,
+                                                    self.next_index,
+                                                    self.start_index,
+                                                    self.end_index)
 
-                model_id = \
-                    self.db.file_model_id(file=obj,
-                                          protocol=self.parameters['protocol'])
-                model_id = model_id.encode('utf-8')
-                self.outputs['model_id'].write({'text':
-                                                model_id},
-                                               self.next_index)
+            self.outputs['client_id'].write(
+                {
+                    'value': np.uint64(obj.client_id)
+                },
+                client_end_index
+            )
 
+        # Output: image (provide data at each iteration)
         if self.outputs['image'].isConnected():
-            data = {
-                'value': obj.load(directory=self.root_folder)
-            }
-
-            self.outputs['image'].write(data, self.next_index)
+            self.outputs['image'].write(
+                {
+                    'value': obj.load(directory=self.root_folder)
+                },
+                self.next_index
+            )
 
-        self.next_index += 1
+        # Determine the next data index that must be provided
+        self.next_index = 1 + min([ x.last_written_data_index for x in self.outputs
+                                                              if x.isConnected() ]
+        )
 
         return True
 
+
+#----------------------------------------------------------
+
+
 class TemplateView:
-    # Reasoning: Each client may have a number of models in certain databases.
-    # So, each model receives an unique identifier. Those identifiers are
-    # linked to the client identifier and contain a number of images to
-    # generated the model from.
-    def setup(self,
-              root_folder,
-              outputs,
-              parameters,
-              force_start_index=None,
+    """Outputs:
+        - image: "{{ system_user.username }}/array_2d_uint8/1"
+        - client_id: "{{ system_user.username }}/uint64/1"
+        - model_id: "{{ system_user.username }}/text/1"
+
+    Several "image" are associated with a given "model_id".
+    Several "model_id" are associated with a given "client_id".
+
+    --------------- --------------- --------------- --------------- --------------- ---------------
+    |    image    | |    image    | |    image    | |    image    | |    image    | |    image    |
+    --------------- --------------- --------------- --------------- --------------- ---------------
+    ----------------------------------------------- -----------------------------------------------
+    |                   model_id                  | |                   model_id                  |
+    ----------------------------------------------- -----------------------------------------------
+    -----------------------------------------------------------------------------------------------
+    |                                          client_id                                          |
+    -----------------------------------------------------------------------------------------------
+
+    Note: for this particular database, there is only one "image"
+    per "model_id".
+    """
+
+    def setup(self, root_folder, outputs, parameters, force_start_index=None,
               force_end_index=None):
 
-        self.root_folder = os.path.join(root_folder, '')
-        self.outputs = outputs
-        self.parameters = parameters
-
-        self.parameters['annotated_images'] = \
-            str_to_bool(self.parameters.get('annotated_images', False))
+        # Initialisations
+        self.root_folder = root_folder
+        self.outputs     = outputs
+        self.parameters  = parameters
 
+        # Open the database and load the objects to provide via the outputs
         self.db = bob.db.biowave_v1.Database()
-        self.template_ids = \
-            sorted(self.db.model_ids(protocol=self.parameters['protocol'],
-                                     groups=[self.parameters['group']],
-                                     annotated_images=self.parameters['annotated_images'],
-                                     imagedir=self.root_folder))
-
-        self.objs = None
 
-        self.current_template_index = 0
-        self.current_obj_index = 0
-        self.next_index = 0
+        self.objs = sorted(self.db.objects(protocol=self.parameters['protocol'],
+                                           purposes=self.parameters['purpose'],
+                                           groups=[self.parameters['group']],
+                                           annotated_images=False,
+                                           imagedir=self.root_folder),
+                           key=lambda x: (x.client_id, x.model_id, x.id))
 
-        self.force_start_index = force_start_index
-        self.force_end_index = force_end_index
+        # Determine the range of indices that must be provided
+        self.start_index = force_start_index if force_start_index is not None else 0
+        self.end_index = force_end_index if force_end_index is not None else len(self.objs) - 1
 
-        # We don't know how many objects we will have, so we can't operate with
-        # self.force_end_index.
-        if self.force_start_index is None:
-            self.force_start_index = 0
+        self.objs = self.objs[self.start_index : self.end_index + 1]
 
-        # Example taxen from atnt/3 - idea to iterate through ``next`` method
-        # to get indexes right
-        while self.next_index < self.force_start_index:
-            self.next()
+        self.next_index = self.start_index
 
         return True
 
 
-    def done(self):
-        # return (self.next_index-self.force_start_index >= len(self.objs))
-        return ((self.current_template_index >= len(self.template_ids)) or
-                (self.force_end_index is not None and
-                 self.force_end_index < self.next_index))
+    def done(self, last_data_index):
+        return last_data_index >= self.end_index
 
 
     def next(self):
-        if self.objs is None:
-            # probe for the specific objects concerning a given client
-            self.objs = \
-                sorted(self.db.objects(protocol=self.parameters['protocol'],
-                                       purposes="enroll",  # We do this ONLY for templates
-                                       groups=[self.parameters['group']],
-                                       annotated_images=self.parameters['annotated_images'],
-                                       imagedir=self.root_folder,
-                                       model_ids=[self.template_ids[self.current_template_index]]),
-                       key=lambda x: x.id)
-
-            if (self.force_start_index <= self.next_index and
-                (self.force_end_index is None or
-                 self.force_end_index >= self.next_index)):
-                if self.outputs['model_id'].isConnected():
-                    # for this database the
-                    # ``self.template_ids[self.current_template_index]`` is the
-                    # ``model_id``:
-                    model_id = self.template_ids[self.current_template_index]
-                    model_id = model_id.encode('utf-8')
-                    self.outputs['model_id'].write({'text':
-                                                    model_id},
-                                                   self.next_index+len(self.objs)-1)
-
-                if self.outputs['client_id'].isConnected():
-                    client_id = self.objs[0].get_client_id
-                    self.outputs['client_id'].write({'value':
-                                                     np.uint64(client_id)},
-                                                    self.next_index+len(self.objs)-1)
-
-        obj = self.objs[self.current_obj_index]
-
+        obj = self.objs[self.next_index - self.start_index]
+
+        # Output: model_id (only provide data when the model_id change)
+        if self.outputs['model_id'].isConnected() and \
+           self.outputs['model_id'].last_written_data_index < self.next_index:
+
+            model_end_index = get_model_end_index(self.objs, obj.model_id,
+                                                  self.next_index,
+                                                  self.start_index,
+                                                  self.end_index)
+
+            self.outputs['model_id'].write(
+                {
+                    'text': obj.model_id.encode('utf-8')
+                },
+                model_end_index
+            )
+
+        # Output: client_id (only provide data when the client_id change)
+        if self.outputs['client_id'].isConnected() and \
+           self.outputs['client_id'].last_written_data_index < self.next_index:
+
+            # Please pay attention - we can use the object CLIENT ID as long as we
+            # don't use both hands data of the same client in the same protocol.
+            client_end_index = get_client_end_index(self.objs, obj.client_id,
+                                                    self.next_index,
+                                                    self.start_index,
+                                                    self.end_index)
+
+            self.outputs['client_id'].write(
+                {
+                    'value': np.uint64(obj.client_id)
+                },
+                client_end_index
+            )
+
+        # Output: image (provide data at each iteration)
         if self.outputs['image'].isConnected():
-            # This line is taken from the "atnt/3" database's view. It seams
-            # that this could cause problems, if model has N images, but
-            # ``self.force_end_index`` /= N*M, where M -- Natural number:
-            if (self.force_start_index <= self.next_index and
-                (self.force_end_index is None or
-                 self.force_end_index >= self.next_index)):
-                # No need to test if output is connected:
-                # if self.outputs['image'].isConnected():
-                data = {
+            self.outputs['image'].write(
+                {
                     'value': obj.load(directory=self.root_folder)
-                       }
-                self.outputs['image'].write(data, self.next_index)
+                },
+                self.next_index
+            )
 
-            self.next_index += 1
-            self.current_obj_index += 1
+        # Determine the next data index that must be provided
+        self.next_index = 1 + min([ x.last_written_data_index for x in self.outputs
+                                                              if x.isConnected() ]
+        )
 
-        else:
-            self.next_index += len(self.objs)
-            self.current_obj_index = len(self.objs)
+        return True
 
-        if self.current_obj_index == len(self.objs):
-            self.objs = None
-            self.current_obj_index = 0
-            self.current_template_index += 1
 
-        return True
+#----------------------------------------------------------
 
 
 class ViewAnnotations:
-    def setup(self,
-              root_folder,
-              outputs,
-              parameters,
-              force_start_index=None,
+    """Outputs:
+        - image: "{{ system_user.username }}/array_2d_uint8/1"
+        - vein_annotations: "{{ system_user.username }}/array_2d_uint8/1"
+        - ROI_annotations: "{{ system_user.username }}/array_2d_uint8/1"
+        - alignment_annotations: "{{ system_user.username }}/array_1d_coordinates/1"
+        - client_id: "{{ system_user.username }}/uint64/1"
+
+    One "vein_annotations" are associated with a given "image".
+    One "ROI_annotations" are associated with a given "image".
+    One "alignment_annotations" are associated with a given "image".
+    Several "image" are associated with a given "client_id".
+
+    ------------------------- ------------------------- ------------------------- -------------------------
+    |         image         | |         image         | |         image         | |         image         |
+    ------------------------- ------------------------- ------------------------- -------------------------
+    ------------------------- ------------------------- ------------------------- -------------------------
+    |    vein_annotations   | |    vein_annotations   | |    vein_annotations   | |    vein_annotations   |
+    ------------------------- ------------------------- ------------------------- -------------------------
+    ------------------------- ------------------------- ------------------------- -------------------------
+    |    ROI_annotations    | |    ROI_annotations    | |    ROI_annotations    | |    ROI_annotations    |
+    ------------------------- ------------------------- ------------------------- -------------------------
+    ------------------------- ------------------------- ------------------------- -------------------------
+    | alignment_annotations | | alignment_annotations | | alignment_annotations | | alignment_annotations |
+    ------------------------- ------------------------- ------------------------- -------------------------
+    --------------------------------------------------- ---------------------------------------------------
+    |                     client_id                   | |                     client_id                   |
+    --------------------------------------------------- ---------------------------------------------------
+    """
+
+    def setup(self, root_folder, outputs, parameters, force_start_index=None,
               force_end_index=None):
 
-        self.root_folder = os.path.join(root_folder, '')
-        self.outputs = outputs
-        self.parameters = parameters
-
-        self.parameters['annotated_images'] = \
-            str_to_bool(self.parameters.get('annotated_images', False))
+        # Initialisations
+        self.root_folder = root_folder
+        self.outputs     = outputs
+        self.parameters  = parameters
 
+        # Open the database and load the objects to provide via the outputs
         self.db = bob.db.biowave_v1.Database()
-        self.objs = self.db.objects(
-            protocol=self.parameters['protocol'],
-            purposes=self.parameters.get('purpose', None),
-            groups=[self.parameters['group']],
-            annotated_images=self.parameters['annotated_images'],
-            imagedir=self.root_folder)
-
-        self.next_index = 0
-
-        self.force_start_index = force_start_index
-        self.force_end_index = force_end_index
-
-        # Retrieve only 'useful' data
-        # End index
-        if self.force_end_index is not None:
-            self.objs = self.objs[:self.force_end_index+1]
-        # Start index
-        if self.force_start_index is not None:
-            self.objs = self.objs[self.force_start_index:]
-            self.next_index = self.force_start_index
-        else:
-            self.force_start_index = 0
+
+        self.objs = sorted(self.db.objects(protocol=self.parameters['protocol'],
+                                           groups=[self.parameters['group']],
+                                           purposes=self.parameters.get('purpose', None),
+                                           annotated_images=True,
+                                           imagedir=self.root_folder),
+                           key=lambda x: (x.client_id, x.id))
+
+        # Determine the range of indices that must be provided
+        self.start_index = force_start_index if force_start_index is not None else 0
+        self.end_index = force_end_index if force_end_index is not None else len(self.objs) - 1
+
+        self.objs = self.objs[self.start_index : self.end_index + 1]
+
+        self.next_index = self.start_index
 
         return True
 
 
-    def done(self):
-        return (self.next_index-self.force_start_index >= len(self.objs))
+    def done(self, last_data_index):
+        return last_data_index >= self.end_index
 
 
     def next(self):
-        obj = self.objs[self.next_index-self.force_start_index]
-        if self.outputs['client_id'].isConnected():
-            client_id = obj.get_client_id
-            self.outputs['client_id'].write({'value':
-                                             np.uint64(client_id)},
-                                            self.next_index)
-
-        if "enroll" in self.parameters.get('purpose', ""):
-            if self.outputs['model_id'].isConnected():
-                model_id = \
-                    self.db.file_model_id(file=obj,
-                                          protocol=self.parameters['protocol'])
-                model_id = model_id.encode('utf-8')
-                self.outputs['model_id'].write({'text':
-                                                model_id},
-                                               self.next_index)
+        obj = self.objs[self.next_index - self.start_index]
 
-        if self.outputs['image'].isConnected():
-            data = {
-                'value': obj.load(directory=self.root_folder)
-            }
-            self.outputs['image'].write(data, self.next_index)
+        # Output: client_id (only provide data when the client_id change)
+        if self.outputs['client_id'].isConnected() and \
+           self.outputs['client_id'].last_written_data_index < self.next_index:
 
-        if self.outputs['vein_annotations'].isConnected():
-            data = {
-                'value': obj.construct_vein_image(directory=self.root_folder)
-            }
-            self.outputs['vein_annotations'].write(data, self.next_index)
+            client_end_index = get_client_end_index(self.objs, obj.client_id,
+                                                    self.next_index,
+                                                    self.start_index,
+                                                    self.end_index)
 
-        if self.outputs['ROI_annotations'].isConnected():
-            data = {
-                'value': obj.construct_ROI_image(directory=self.root_folder)
-            }
-            self.outputs['ROI_annotations'].write(data, self.next_index)
+            self.outputs['client_id'].write(
+                {
+                    'value': np.uint64(obj.client_id)
+                },
+                client_end_index
+            )
 
+        # Output: vein_annotations (provide data at each iteration)
+        if self.outputs['vein_annotations'].isConnected():
+            self.outputs['vein_annotations'].write(
+                {
+                    'value': obj.construct_vein_image(directory=self.root_folder)
+                },
+                self.next_index
+            )
+
+        # Output: ROI_annotations (provide data at each iteration)
+        if self.outputs['ROI_annotations'].isConnected():
+            self.outputs['ROI_annotations'].write(
+                {
+                    'value': obj.construct_ROI_image(directory=self.root_folder)
+                },
+                self.next_index
+            )
+
+        # Output: alignment_annotations (provide data at each iteration)
         if self.outputs['alignment_annotations'].isConnected():
-            alignment_annotations = \
-                obj.alignment_annotations(directory=self.root_folder)
+            alignment_annotations = obj.alignment_annotations(directory=self.root_folder)
+
             coordinate_list = []
             for annotation in alignment_annotations:
                 coordinate = {
-                              "y": np.int32(annotation[0]),
-                              "x": np.int32(annotation[1])
-                             }
+                    "y": np.int32(annotation[0]),
+                    "x": np.int32(annotation[1])
+                }
                 coordinate_list.append(coordinate)
-            data = {'coordinate_list': coordinate_list}
 
-            self.outputs['alignment_annotations'].write(data, self.next_index)
+            self.outputs['alignment_annotations'].write(
+                {
+                    'value': coordinate_list
+                },
+                self.next_index
+            )
+
+        # Output: image (provide data at each iteration)
+        if self.outputs['image'].isConnected():
+            self.outputs['image'].write(
+                {
+                    'value': obj.load(directory=self.root_folder)
+                },
+                self.next_index
+            )
+
+        # Determine the next data index that must be provided
+        self.next_index = 1 + min([ x.last_written_data_index for x in self.outputs
+                                                              if x.isConnected() ]
+        )
 
-        self.next_index += 1
         return True
 
 
+#----------------------------------------------------------
+
 
 class TemplateViewAnnotations:
-    # Reasoning: Each client may have a number of models in certain databases.
-    # So, each model receives an unique identifier. Those identifiers are
-    # linked to the client identifier and contain a number of images to
-    # generated the model from.
-    def setup(self,
-              root_folder,
-              outputs,
-              parameters,
-              force_start_index=None,
+    """Outputs:
+        - image: "{{ system_user.username }}/array_2d_uint8/1"
+        - vein_annotations: "{{ system_user.username }}/array_2d_uint8/1"
+        - ROI_annotations: "{{ system_user.username }}/array_2d_uint8/1"
+        - alignment_annotations: "{{ system_user.username }}/array_1d_coordinates/1"
+        - model_id: "{{ system_user.username }}/model_id/1"
+        - client_id: "{{ system_user.username }}/uint64/1"
+
+    One "vein_annotations" are associated with a given "image".
+    One "ROI_annotations" are associated with a given "image".
+    One "alignment_annotations" are associated with a given "image".
+    Several "image" are associated with a given "model_id".
+    Several "model_id" are associated with a given "client_id".
+
+    ------------------------- ------------------------- ------------------------- -------------------------
+    |         image         | |         image         | |         image         | |         image         |
+    ------------------------- ------------------------- ------------------------- -------------------------
+    ------------------------- ------------------------- ------------------------- -------------------------
+    |    vein_annotations   | |    vein_annotations   | |    vein_annotations   | |    vein_annotations   |
+    ------------------------- ------------------------- ------------------------- -------------------------
+    ------------------------- ------------------------- ------------------------- -------------------------
+    |    ROI_annotations    | |    ROI_annotations    | |    ROI_annotations    | |    ROI_annotations    |
+    ------------------------- ------------------------- ------------------------- -------------------------
+    ------------------------- ------------------------- ------------------------- -------------------------
+    | alignment_annotations | | alignment_annotations | | alignment_annotations | | alignment_annotations |
+    ------------------------- ------------------------- ------------------------- -------------------------
+    --------------------------------------------------- ---------------------------------------------------
+    |                     model_id                    | |                     model_id                    |
+    --------------------------------------------------- ---------------------------------------------------
+    -------------------------------------------------------------------------------------------------------
+    |                                              client_id                                              |
+    -------------------------------------------------------------------------------------------------------
+
+    Note: for this particular database, there is only one "image"
+    per "model_id".
+    """
+
+    def setup(self, root_folder, outputs, parameters, force_start_index=None,
               force_end_index=None):
 
-        self.root_folder = os.path.join(root_folder, '')
-        self.outputs = outputs
-        self.parameters = parameters
-
-        self.parameters['annotated_images'] = \
-            str_to_bool(self.parameters.get('annotated_images', False))
+        # Initialisations
+        self.root_folder = root_folder
+        self.outputs     = outputs
+        self.parameters  = parameters
 
+        # Open the database and load the objects to provide via the outputs
         self.db = bob.db.biowave_v1.Database()
-        self.template_ids = \
-            sorted(self.db.model_ids(protocol=self.parameters['protocol'],
-                                     groups=[self.parameters['group']],
-                                     annotated_images=self.parameters['annotated_images'],
-                                     imagedir=self.root_folder))
-
-        self.objs = None
 
-        self.current_template_index = 0
-        self.current_obj_index = 0
-        self.next_index = 0
+        self.objs = sorted(self.db.objects(protocol=self.parameters['protocol'],
+                                           purposes=self.parameters['purpose'],
+                                           groups=[self.parameters['group']],
+                                           annotated_images=True,
+                                           imagedir=self.root_folder),
+                           key=lambda x: (x.client_id, x.model_id, x.id))
 
-        self.force_start_index = force_start_index
-        self.force_end_index = force_end_index
+        # Determine the range of indices that must be provided
+        self.start_index = force_start_index if force_start_index is not None else 0
+        self.end_index = force_end_index if force_end_index is not None else len(self.objs) - 1
 
-        # We don't know how many objects we will have, so we can't operate with
-        # self.force_end_index.
-        if self.force_start_index is None:
-            self.force_start_index = 0
+        self.objs = self.objs[self.start_index : self.end_index + 1]
 
-        # Example taxen from atnt/3 - idea to iterate through ``next`` method
-        # to get indexes right:
-        while self.next_index < self.force_start_index:
-            self.next()
+        self.next_index = self.start_index
 
         return True
 
 
-    def done(self):
-        # return (self.next_index-self.force_start_index >= len(self.objs))
-        return ((self.current_template_index >= len(self.template_ids)) or
-                (self.force_end_index is not None and
-                 self.force_end_index < self.next_index))
+    def done(self, last_data_index):
+        return last_data_index >= self.end_index
 
 
     def next(self):
-        if self.objs is None:
-            # probe for the specific objects concerning a given client
-            self.objs = \
-                sorted(self.db.objects(protocol=self.parameters['protocol'],
-                                       purposes="enroll",  # We do this ONLY for templates
-                                       groups=[self.parameters['group']],
-                                       annotated_images=self.parameters['annotated_images'],
-                                       imagedir=self.root_folder,
-                                       model_ids=[self.template_ids[self.current_template_index]]),
-                       key=lambda x: x.id)
-
-            if (self.force_start_index <= self.next_index and
-                (self.force_end_index is None or
-                 self.force_end_index >= self.next_index)):
-                if self.outputs['model_id'].isConnected():
-                    # for this database the
-                    # ``self.template_ids[self.current_template_index]`` is the
-                    # ``model_id``:
-                    model_id = self.template_ids[self.current_template_index]
-                    model_id = model_id.encode('utf-8')
-                    self.outputs['model_id'].write({'text':
-                                                    model_id},
-                                                   self.next_index+len(self.objs)-1)
-                if self.outputs['client_id'].isConnected():
-                    client_id = self.objs[0].get_client_id
-                    self.outputs['client_id'].write({'value':
-                                                     np.uint64(client_id)},
-                                                    self.next_index+len(self.objs)-1)
-
-        obj = self.objs[self.current_obj_index]
-
-        if (self.outputs['image'].isConnected() or
-           self.outputs['vein_annotations'].isConnected() or
-           self.outputs['ROI_annotations'].isConnected() or
-           self.outputs['alignment_annotations'].isConnected()):
-
-            # This line is taken from the "atnt/3" database's view. It seams
-            # that this could cause problems, if model has N images, but
-            # ``self.force_end_index`` /= N*M, where M -- Natural number:
-            if (self.force_start_index <= self.next_index and
-                (self.force_end_index is None or
-                 self.force_end_index >= self.next_index)):
-
-                if self.outputs['image'].isConnected():
-                    data = {
-                        'value': obj.load(directory=self.root_folder)
-                    }
-                    self.outputs['image'].write(data, self.next_index)
-
-                if self.outputs['vein_annotations'].isConnected():
-                    data = {
-                        'value': obj.construct_vein_image(directory=self.root_folder)
-                           }
-                    self.outputs['vein_annotations'].write(data,
-                                                           self.next_index)
-
-                if self.outputs['ROI_annotations'].isConnected():
-                    data = {
-                        'value': obj.construct_ROI_image(directory=self.root_folder)
-                    }
-                    self.outputs['ROI_annotations'].write(data,
-                                                          self.next_index)
-
-                if self.outputs['alignment_annotations'].isConnected():
-                    alignment_annotations = \
-                        obj.alignment_annotations(directory=self.root_folder)
-                    coordinate_list = []
-                    for annotation in alignment_annotations:
-                        coordinate = {
-                                      "y": np.int32(annotation[0]),
-                                      "x": np.int32(annotation[1])
-                                     }
-                        coordinate_list.append(coordinate)
-                    data = {'coordinate_list': coordinate_list}
-
-                    self.outputs['alignment_annotations'].write(data,
-                                                                self.next_index)
-
-            self.next_index += 1
-            self.current_obj_index += 1
-
-        else:
-            self.next_index += len(self.objs)
-            self.current_obj_index = len(self.objs)
-
-        if self.current_obj_index == len(self.objs):
-            self.objs = None
-            self.current_obj_index = 0
-            self.current_template_index += 1
+        obj = self.objs[self.next_index - self.start_index]
+
+        # Output: model_id (only provide data when the model_id change)
+        if self.outputs['model_id'].isConnected() and \
+           self.outputs['model_id'].last_written_data_index < self.next_index:
+
+            model_end_index = get_model_end_index(self.objs, obj.model_id,
+                                                  self.next_index,
+                                                  self.start_index,
+                                                  self.end_index)
+
+            self.outputs['model_id'].write(
+                {
+                    'text': obj.model_id.encode('utf-8')
+                },
+                model_end_index
+            )
+
+        # Output: client_id (only provide data when the client_id change)
+        if self.outputs['client_id'].isConnected() and \
+           self.outputs['client_id'].last_written_data_index < self.next_index:
+
+            # Please pay attention - we can use the object CLIENT ID as long as we
+            # don't use both hands data of the same client in the same protocol.
+            client_end_index = get_client_end_index(self.objs, obj.client_id,
+                                                    self.next_index,
+                                                    self.start_index,
+                                                    self.end_index)
+
+            self.outputs['client_id'].write(
+                {
+                    'value': np.uint64(obj.client_id)
+                },
+                client_end_index
+            )
+
+        # Output: vein_annotations (provide data at each iteration)
+        if self.outputs['vein_annotations'].isConnected():
+            self.outputs['vein_annotations'].write(
+                {
+                    'value': obj.construct_vein_image(directory=self.root_folder)
+                },
+                self.next_index
+            )
+
+        # Output: ROI_annotations (provide data at each iteration)
+        if self.outputs['ROI_annotations'].isConnected():
+            self.outputs['ROI_annotations'].write(
+                {
+                    'value': obj.construct_ROI_image(directory=self.root_folder)
+                },
+                self.next_index
+            )
+
+        # Output: alignment_annotations (provide data at each iteration)
+        if self.outputs['alignment_annotations'].isConnected():
+            alignment_annotations = obj.alignment_annotations(directory=self.root_folder)
+
+            coordinate_list = []
+            for annotation in alignment_annotations:
+                coordinate = {
+                    "y": np.int32(annotation[0]),
+                    "x": np.int32(annotation[1])
+                }
+                coordinate_list.append(coordinate)
+
+            self.outputs['alignment_annotations'].write(
+                {
+                    'value': coordinate_list
+                },
+                self.next_index
+            )
+
+        # Output: image (provide data at each iteration)
+        if self.outputs['image'].isConnected():
+            self.outputs['image'].write(
+                {
+                    'value': obj.load(directory=self.root_folder)
+                },
+                self.next_index
+            )
+
+        # Determine the next data index that must be provided
+        self.next_index = 1 + min([ x.last_written_data_index for x in self.outputs
+                                                              if x.isConnected() ]
+        )
 
         return True
 
 
-class AnnotationBenchmark:
-    def setup(self,
-              root_folder,
-              outputs,
-              parameters,
-              force_start_index=None,
-              force_end_index=None):
+#----------------------------------------------------------
 
-        self.parameters = parameters
 
-        self.parameters['annotated_images'] = \
-            str_to_bool(self.parameters.get('annotated_images', False))
+class AnnotationBenchmark:
+    """Outputs:
+        - image: "{{ system_user.username }}/array_2d_uint8/1"
+        - vein_annotations: "{{ system_user.username }}/array_2d_uint8/1"
+        - ROI_annotations: "{{ system_user.username }}/array_2d_uint8/1"
+        - alignment_annotations: "{{ system_user.username }}/array_1d_coordinates/1"
+
+    One "vein_annotations" are associated with a given "image".
+    One "ROI_annotations" are associated with a given "image".
+    One "alignment_annotations" are associated with a given "image".
+
+    ------------------------- ------------------------- ------------------------- -------------------------
+    |         image         | |         image         | |         image         | |         image         |
+    ------------------------- ------------------------- ------------------------- -------------------------
+    ------------------------- ------------------------- ------------------------- -------------------------
+    |    vein_annotations   | |    vein_annotations   | |    vein_annotations   | |    vein_annotations   |
+    ------------------------- ------------------------- ------------------------- -------------------------
+    ------------------------- ------------------------- ------------------------- -------------------------
+    |    ROI_annotations    | |    ROI_annotations    | |    ROI_annotations    | |    ROI_annotations    |
+    ------------------------- ------------------------- ------------------------- -------------------------
+    ------------------------- ------------------------- ------------------------- -------------------------
+    | alignment_annotations | | alignment_annotations | | alignment_annotations | | alignment_annotations |
+    ------------------------- ------------------------- ------------------------- -------------------------
+    """
+
+    def setup(self, root_folder, outputs, parameters, force_start_index=None,
+              force_end_index=None):
 
-        self.root_folder = os.path.join(root_folder, '')
-        self.outputs = outputs
+        # Initialisations
+        self.root_folder = root_folder
+        self.outputs     = outputs
+        self.parameters  = parameters
 
+        # Open the database and load the objects to provide via the outputs
         self.db = bob.db.biowave_v1.Database()
 
-        self.objs = \
-            self.db.objects(protocol=self.parameters['protocol'],
-                            annotated_images=self.parameters['annotated_images'],
-                            imagedir=self.root_folder)
+        self.objs = sorted(self.db.objects(protocol=self.parameters['protocol'],
+                                           annotated_images=True,
+                                           imagedir=self.root_folder),
+                           key=lambda x: x.id)
 
-        self.next_index = 0
+        # Determine the range of indices that must be provided
+        self.start_index = force_start_index if force_start_index is not None else 0
+        self.end_index = force_end_index if force_end_index is not None else len(self.objs) - 1
 
-        self.force_start_index = force_start_index
-        self.force_end_index = force_end_index
+        self.objs = self.objs[self.start_index : self.end_index + 1]
 
-        # Retrieve only 'useful' data
-        # End index
-        if self.force_end_index is not None:
-            self.objs = self.objs[:self.force_end_index+1]
-        # Start index
-        if self.force_start_index is not None:
-            self.objs = self.objs[self.force_start_index:]
-            self.next_index = self.force_start_index
-        else:
-            self.force_start_index = 0
+        self.next_index = self.start_index
 
         return True
 
 
-    def done(self):
-        return (self.next_index-self.force_start_index >= len(self.objs))
+    def done(self, last_data_index):
+        return last_data_index >= self.end_index
 
 
     def next(self):
-        obj = self.objs[self.next_index-self.force_start_index]
-
-        if self.outputs['image'].isConnected():
-            data = {
-                'value': obj.load(directory=self.root_folder)
-            }
-            self.outputs['image'].write(data, self.next_index)
+        obj = self.objs[self.next_index - self.start_index]
 
+        # Output: vein_annotations (provide data at each iteration)
         if self.outputs['vein_annotations'].isConnected():
-            data = {
-                'value': obj.construct_vein_image(directory=self.root_folder)
-            }
-            self.outputs['vein_annotations'].write(data, self.next_index)
-
+            self.outputs['vein_annotations'].write(
+                {
+                    'value': obj.construct_vein_image(directory=self.root_folder)
+                },
+                self.next_index
+            )
+
+        # Output: ROI_annotations (provide data at each iteration)
         if self.outputs['ROI_annotations'].isConnected():
-            data = {
-                'value': obj.construct_ROI_image(directory=self.root_folder)
-            }
-            self.outputs['ROI_annotations'].write(data, self.next_index)
-
+            self.outputs['ROI_annotations'].write(
+                {
+                    'value': obj.construct_ROI_image(directory=self.root_folder)
+                },
+                self.next_index
+            )
+
+        # Output: alignment_annotations (provide data at each iteration)
         if self.outputs['alignment_annotations'].isConnected():
-            alignment_annotations = \
-                obj.alignment_annotations(directory=self.root_folder)
+            alignment_annotations = obj.alignment_annotations(directory=self.root_folder)
+
             coordinate_list = []
             for annotation in alignment_annotations:
                 coordinate = {
-                              "y": np.int32(annotation[0]),
-                              "x": np.int32(annotation[1])
-                             }
+                    "y": np.int32(annotation[0]),
+                    "x": np.int32(annotation[1])
+                }
                 coordinate_list.append(coordinate)
-            data = {'coordinate_list': coordinate_list}
-            self.outputs['alignment_annotations'].write(data, self.next_index)
 
-        self.next_index += 1
+            self.outputs['alignment_annotations'].write(
+                {
+                    'value': coordinate_list
+                },
+                self.next_index
+            )
+
+        # Output: image (provide data at each iteration)
+        if self.outputs['image'].isConnected():
+            self.outputs['image'].write(
+                {
+                    'value': obj.load(directory=self.root_folder)
+                },
+                self.next_index
+            )
+
+        # Determine the next data index that must be provided
+        self.next_index = 1 + min([ x.last_written_data_index for x in self.outputs
+                                                              if x.isConnected() ]
+        )
+
         return True
 
 
-"""
-# example for class AnnotationBenchmark to get only annotated, not mirrored
-# files (total count - 666):
+#----------------------------------------------------------
 
-import bob.db.biowave_v1
-db = bob.db.biowave_v1.Database()
-obj = db.objects(protocol="Idiap_1_1_R",
-                 annotated_images=True,
-                 imagedir="/idiap/project/biowave/biowave_v1/data/"
-                 )
-print(len(obj))
-"""
-
-"""
-protocol = "Idiap_1_5_R_BEAT_test"
-import bob.db.biowave_v1
-db = bob.db.biowave_v1.Database()
-files = db.objects(protocol=protocol,
-                   annotated_images=True,
-                   imagedir="/idiap/project/biowave/biowave_v1/data/",
-                   groups="dev",
-                   purposes="probe")
-
-"""
+
+def setup_tests():
+    # Install a mock methods
+    def mock_load(obj, directory=''):
+        return np.ndarray((10, 20), dtype=np.uint8)
+
+    def mock_construct_vein_image(obj, directory=''):
+        return np.ndarray((10, 20), dtype=np.uint8)
+
+    def mock_construct_ROI_image(obj, directory=''):
+        return np.ndarray((10, 20), dtype=np.uint8)
+
+    bob.db.biowave_v1.models.File.load = mock_load
+    bob.db.biowave_v1.models.File.construct_vein_image = mock_construct_vein_image
+    bob.db.biowave_v1.models.File.construct_ROI_image = mock_construct_ROI_image
+
+
+#----------------------------------------------------------
+
+
+# Test the behavior of the views (on fake data)
+if __name__ == '__main__':
+
+    setup_tests()
+
+    from beat.backend.python.database import DatabaseTester
+
+    DatabaseTester('View', View,
+        [
+            'client_id',
+            'image',
+        ],
+        parameters=dict(
+            protocol="Idiap_1_1_R_BEAT_test",
+            group="world",
+        ),
+    )
+
+    DatabaseTester('TemplateView', TemplateView,
+        [
+            'client_id',
+            'model_id',
+            'image',
+        ],
+        parameters=dict(
+            protocol="Idiap_1_1_R_BEAT_test",
+            group="dev",
+            purpose="enroll",
+        ),
+        irregular_outputs=[
+            'model_id',
+        ]
+    )
diff --git a/advanced/databases/biowave/1.rst b/advanced/databases/biowave/1.rst
index da3553a..1d6b587 100644
--- a/advanced/databases/biowave/1.rst
+++ b/advanced/databases/biowave/1.rst
@@ -1,4 +1,4 @@
-.. Copyright (c) 2016 Idiap Research Institute, http://www.idiap.ch/          ..
+.. Copyright (c) 2017 Idiap Research Institute, http://www.idiap.ch/          ..
 .. Contact: beat.support@idiap.ch                                             ..
 ..                                                                            ..
 .. This file is part of the beat.examples module of the BEAT platform.        ..
@@ -24,7 +24,7 @@ BIOWAVE Vein Database
 Changelog
 =========
 
-* **Version 1**, 10/Feb/2017:
+* **Version 1**, 30/Oct/2017:
 
   - Initial release
 
diff --git a/advanced/databases/biowave/2.json b/advanced/databases/biowave/2.json
deleted file mode 100644
index 111a731..0000000
--- a/advanced/databases/biowave/2.json
+++ /dev/null
@@ -1,1502 +0,0 @@
-{
-    "root_folder": "/idiap/project/biowave/biowave_v1/data",
-    "description": "BIOWAVE Vein Database",
-    "protocols": [
-        {
-            "name": "Idiap_1_1_R_BEAT_test",
-            "template": "advanced_vein_recognition_2",
-            "sets": [
-                {
-                    "outputs": {
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "View",
-                    "template": "train",
-                    "parameters": {
-                        "protocol": "Idiap_1_1_R_BEAT_test",
-                        "group": "world"
-                    },
-                    "name": "train"
-                },
-                {
-                    "outputs": {
-                        "model_id": "{{ system_user.username }}/text/1",
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "TemplateView",
-                    "name": "dev_templates",
-                    "parameters": {
-                        "protocol": "Idiap_1_1_R_BEAT_test",
-                        "group": "dev",
-                        "purpose": "enroll"
-                    },
-                    "template": "enroll"
-                },
-                {
-                    "outputs": {
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "View",
-                    "name": "dev_probes",
-                    "parameters": {
-                        "protocol": "Idiap_1_1_R_BEAT_test",
-                        "group": "dev",
-                        "purpose": "probe"
-                    },
-                    "template": "probe"
-                },
-                {
-                    "outputs": {
-                        "model_id": "{{ system_user.username }}/text/1",
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "TemplateView",
-                    "name": "eval_templates",
-                    "parameters": {
-                        "protocol": "Idiap_1_1_R_BEAT_test",
-                        "group": "eval",
-                        "purpose": "enroll"
-                    },
-                    "template": "enroll"
-                },
-                {
-                    "outputs": {
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "View",
-                    "name": "eval_probes",
-                    "parameters": {
-                        "protocol": "Idiap_1_1_R_BEAT_test",
-                        "group": "eval",
-                        "purpose": "probe"
-                    },
-                    "template": "probe"
-                }
-            ]
-        },
-        {
-            "name": "Idiap_5_5_R_BEAT_test",
-            "template": "advanced_vein_recognition_2",
-            "sets": [
-                {
-                    "outputs": {
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "View",
-                    "template": "train",
-                    "parameters": {
-                        "protocol": "Idiap_5_5_R_BEAT_test",
-                        "group": "world"
-                    },
-                    "name": "train"
-                },
-                {
-                    "outputs": {
-                        "model_id": "{{ system_user.username }}/text/1",
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "TemplateView",
-                    "name": "dev_templates",
-                    "parameters": {
-                        "protocol": "Idiap_5_5_R_BEAT_test",
-                        "group": "dev",
-                        "purpose": "enroll"
-                    },
-                    "template": "enroll"
-                },
-                {
-                    "outputs": {
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "View",
-                    "name": "dev_probes",
-                    "parameters": {
-                        "protocol": "Idiap_5_5_R_BEAT_test",
-                        "group": "dev",
-                        "purpose": "probe"
-                    },
-                    "template": "probe"
-                },
-                {
-                    "outputs": {
-                        "model_id": "{{ system_user.username }}/text/1",
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "TemplateView",
-                    "name": "eval_templates",
-                    "parameters": {
-                        "protocol": "Idiap_5_5_R_BEAT_test",
-                        "group": "eval",
-                        "purpose": "enroll"
-                    },
-                    "template": "enroll"
-                },
-                {
-                    "outputs": {
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "View",
-                    "name": "eval_probes",
-                    "parameters": {
-                        "protocol": "Idiap_5_5_R_BEAT_test",
-                        "group": "eval",
-                        "purpose": "probe"
-                    },
-                    "template": "probe"
-                }
-            ]
-        },
-        {
-            "name": "Idiap_1_5_R_BEAT_test",
-            "template": "advanced_vein_recognition_2",
-            "sets": [
-                {
-                    "outputs": {
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "View",
-                    "template": "train",
-                    "parameters": {
-                        "protocol": "Idiap_1_5_R_BEAT_test",
-                        "group": "world"
-                    },
-                    "name": "train"
-                },
-                {
-                    "outputs": {
-                        "model_id": "{{ system_user.username }}/text/1",
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "TemplateView",
-                    "name": "dev_templates",
-                    "parameters": {
-                        "protocol": "Idiap_1_5_R_BEAT_test",
-                        "group": "dev",
-                        "purpose": "enroll"
-                    },
-                    "template": "enroll"
-                },
-                {
-                    "outputs": {
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "View",
-                    "name": "dev_probes",
-                    "parameters": {
-                        "protocol": "Idiap_1_5_R_BEAT_test",
-                        "group": "dev",
-                        "purpose": "probe"
-                    },
-                    "template": "probe"
-                },
-                {
-                    "outputs": {
-                        "model_id": "{{ system_user.username }}/text/1",
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "TemplateView",
-                    "name": "eval_templates",
-                    "parameters": {
-                        "protocol": "Idiap_1_5_R_BEAT_test",
-                        "group": "eval",
-                        "purpose": "enroll"
-                    },
-                    "template": "enroll"
-                },
-                {
-                    "outputs": {
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "View",
-                    "name": "eval_probes",
-                    "parameters": {
-                        "protocol": "Idiap_1_5_R_BEAT_test",
-                        "group": "eval",
-                        "purpose": "probe"
-                    },
-                    "template": "probe"
-                }
-            ]
-        },
-        {
-            "name": "Idiap_1_1_R",
-            "template": "advanced_vein_recognition_2",
-            "sets": [
-                {
-                    "outputs": {
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "View",
-                    "template": "train",
-                    "parameters": {
-                        "protocol": "Idiap_1_1_R",
-                        "group": "world"
-                    },
-                    "name": "train"
-                },
-                {
-                    "outputs": {
-                        "model_id": "{{ system_user.username }}/text/1",
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "TemplateView",
-                    "name": "dev_templates",
-                    "parameters": {
-                        "protocol": "Idiap_1_1_R",
-                        "group": "dev",
-                        "purpose": "enroll"
-                    },
-                    "template": "enroll"
-                },
-                {
-                    "outputs": {
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "View",
-                    "name": "dev_probes",
-                    "parameters": {
-                        "protocol": "Idiap_1_1_R",
-                        "group": "dev",
-                        "purpose": "probe"
-                    },
-                    "template": "probe"
-                },
-                {
-                    "outputs": {
-                        "model_id": "{{ system_user.username }}/text/1",
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "TemplateView",
-                    "name": "eval_templates",
-                    "parameters": {
-                        "protocol": "Idiap_1_1_R",
-                        "group": "eval",
-                        "purpose": "enroll"
-                    },
-                    "template": "enroll"
-                },
-                {
-                    "outputs": {
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "View",
-                    "name": "eval_probes",
-                    "parameters": {
-                        "protocol": "Idiap_1_1_R",
-                        "group": "eval",
-                        "purpose": "probe"
-                    },
-                    "template": "probe"
-                }
-            ]
-        },
-        {
-            "name": "Idiap_1_5_R",
-            "template": "advanced_vein_recognition_2",
-            "sets": [
-                {
-                    "outputs": {
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "View",
-                    "template": "train",
-                    "parameters": {
-                        "protocol": "Idiap_1_5_R",
-                        "group": "world"
-                    },
-                    "name": "train"
-                },
-                {
-                    "outputs": {
-                        "model_id": "{{ system_user.username }}/text/1",
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "TemplateView",
-                    "name": "dev_templates",
-                    "parameters": {
-                        "protocol": "Idiap_1_5_R",
-                        "group": "dev",
-                        "purpose": "enroll"
-                    },
-                    "template": "enroll"
-                },
-                {
-                    "outputs": {
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "View",
-                    "name": "dev_probes",
-                    "parameters": {
-                        "protocol": "Idiap_1_5_R",
-                        "group": "dev",
-                        "purpose": "probe"
-                    },
-                    "template": "probe"
-                },
-                {
-                    "outputs": {
-                        "model_id": "{{ system_user.username }}/text/1",
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "TemplateView",
-                    "name": "eval_templates",
-                    "parameters": {
-                        "protocol": "Idiap_1_5_R",
-                        "group": "eval",
-                        "purpose": "enroll"
-                    },
-                    "template": "enroll"
-                },
-                {
-                    "outputs": {
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "View",
-                    "name": "eval_probes",
-                    "parameters": {
-                        "protocol": "Idiap_1_5_R",
-                        "group": "eval",
-                        "purpose": "probe"
-                    },
-                    "template": "probe"
-                }
-            ]
-        },
-        {
-            "name": "Idiap_5_5_R",
-            "template": "advanced_vein_recognition_2",
-            "sets": [
-                {
-                    "outputs": {
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "View",
-                    "template": "train",
-                    "parameters": {
-                        "protocol": "Idiap_5_5_R",
-                        "group": "world"
-                    },
-                    "name": "train"
-                },
-                {
-                    "outputs": {
-                        "model_id": "{{ system_user.username }}/text/1",
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "TemplateView",
-                    "name": "dev_templates",
-                    "parameters": {
-                        "protocol": "Idiap_5_5_R",
-                        "group": "dev",
-                        "purpose": "enroll"
-                    },
-                    "template": "enroll"
-                },
-                {
-                    "outputs": {
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "View",
-                    "name": "dev_probes",
-                    "parameters": {
-                        "protocol": "Idiap_5_5_R",
-                        "group": "dev",
-                        "purpose": "probe"
-                    },
-                    "template": "probe"
-                },
-                {
-                    "outputs": {
-                        "model_id": "{{ system_user.username }}/text/1",
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "TemplateView",
-                    "name": "eval_templates",
-                    "parameters": {
-                        "protocol": "Idiap_5_5_R",
-                        "group": "eval",
-                        "purpose": "enroll"
-                    },
-                    "template": "enroll"
-                },
-                {
-                    "outputs": {
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "View",
-                    "name": "eval_probes",
-                    "parameters": {
-                        "protocol": "Idiap_5_5_R",
-                        "group": "eval",
-                        "purpose": "probe"
-                    },
-                    "template": "probe"
-                }
-            ]
-        },
-        {
-            "name": "Idiap_1_1_L",
-            "template": "advanced_vein_recognition_2",
-            "sets": [
-                {
-                    "outputs": {
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "View",
-                    "template": "train",
-                    "parameters": {
-                        "protocol": "Idiap_1_1_L",
-                        "group": "world"
-                    },
-                    "name": "train"
-                },
-                {
-                    "outputs": {
-                        "model_id": "{{ system_user.username }}/text/1",
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "TemplateView",
-                    "name": "dev_templates",
-                    "parameters": {
-                        "protocol": "Idiap_1_1_L",
-                        "group": "dev",
-                        "purpose": "enroll"
-                    },
-                    "template": "enroll"
-                },
-                {
-                    "outputs": {
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "View",
-                    "name": "dev_probes",
-                    "parameters": {
-                        "protocol": "Idiap_1_1_L",
-                        "group": "dev",
-                        "purpose": "probe"
-                    },
-                    "template": "probe"
-                },
-                {
-                    "outputs": {
-                        "model_id": "{{ system_user.username }}/text/1",
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "TemplateView",
-                    "name": "eval_templates",
-                    "parameters": {
-                        "protocol": "Idiap_1_1_L",
-                        "group": "eval",
-                        "purpose": "enroll"
-                    },
-                    "template": "enroll"
-                },
-                {
-                    "outputs": {
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "View",
-                    "name": "eval_probes",
-                    "parameters": {
-                        "protocol": "Idiap_1_1_L",
-                        "group": "eval",
-                        "purpose": "probe"
-                    },
-                    "template": "probe"
-                }
-            ]
-        },
-        {
-            "name": "Idiap_1_5_L",
-            "template": "advanced_vein_recognition_2",
-            "sets": [
-                {
-                    "outputs": {
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "View",
-                    "template": "train",
-                    "parameters": {
-                        "protocol": "Idiap_1_5_L",
-                        "group": "world"
-                    },
-                    "name": "train"
-                },
-                {
-                    "outputs": {
-                        "model_id": "{{ system_user.username }}/text/1",
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "TemplateView",
-                    "name": "dev_templates",
-                    "parameters": {
-                        "protocol": "Idiap_1_5_L",
-                        "group": "dev",
-                        "purpose": "enroll"
-                    },
-                    "template": "enroll"
-                },
-                {
-                    "outputs": {
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "View",
-                    "name": "dev_probes",
-                    "parameters": {
-                        "protocol": "Idiap_1_5_L",
-                        "group": "dev",
-                        "purpose": "probe"
-                    },
-                    "template": "probe"
-                },
-                {
-                    "outputs": {
-                        "model_id": "{{ system_user.username }}/text/1",
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "TemplateView",
-                    "name": "eval_templates",
-                    "parameters": {
-                        "protocol": "Idiap_1_5_L",
-                        "group": "eval",
-                        "purpose": "enroll"
-                    },
-                    "template": "enroll"
-                },
-                {
-                    "outputs": {
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "View",
-                    "name": "eval_probes",
-                    "parameters": {
-                        "protocol": "Idiap_1_5_L",
-                        "group": "eval",
-                        "purpose": "probe"
-                    },
-                    "template": "probe"
-                }
-            ]
-        },
-        {
-            "name": "Idiap_5_5_L",
-            "template": "advanced_vein_recognition_2",
-            "sets": [
-                {
-                    "outputs": {
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "View",
-                    "template": "train",
-                    "parameters": {
-                        "protocol": "Idiap_5_5_L",
-                        "group": "world"
-                    },
-                    "name": "train"
-                },
-                {
-                    "outputs": {
-                        "model_id": "{{ system_user.username }}/text/1",
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "TemplateView",
-                    "name": "dev_templates",
-                    "parameters": {
-                        "protocol": "Idiap_5_5_L",
-                        "group": "dev",
-                        "purpose": "enroll"
-                    },
-                    "template": "enroll"
-                },
-                {
-                    "outputs": {
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "View",
-                    "name": "dev_probes",
-                    "parameters": {
-                        "protocol": "Idiap_5_5_L",
-                        "group": "dev",
-                        "purpose": "probe"
-                    },
-                    "template": "probe"
-                },
-                {
-                    "outputs": {
-                        "model_id": "{{ system_user.username }}/text/1",
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "TemplateView",
-                    "name": "eval_templates",
-                    "parameters": {
-                        "protocol": "Idiap_5_5_L",
-                        "group": "eval",
-                        "purpose": "enroll"
-                    },
-                    "template": "enroll"
-                },
-                {
-                    "outputs": {
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "View",
-                    "name": "eval_probes",
-                    "parameters": {
-                        "protocol": "Idiap_5_5_L",
-                        "group": "eval",
-                        "purpose": "probe"
-                    },
-                    "template": "probe"
-                }
-            ]
-        },
-        {
-            "name": "Idiap_1_1_R_less",
-            "template": "advanced_vein_recognition_2",
-            "sets": [
-                {
-                    "outputs": {
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "View",
-                    "template": "train",
-                    "parameters": {
-                        "protocol": "Idiap_1_1_R_less",
-                        "group": "world"
-                    },
-                    "name": "train"
-                },
-                {
-                    "outputs": {
-                        "model_id": "{{ system_user.username }}/text/1",
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "TemplateView",
-                    "name": "dev_templates",
-                    "parameters": {
-                        "protocol": "Idiap_1_1_R_less",
-                        "group": "dev",
-                        "purpose": "enroll"
-                    },
-                    "template": "enroll"
-                },
-                {
-                    "outputs": {
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "View",
-                    "name": "dev_probes",
-                    "parameters": {
-                        "protocol": "Idiap_1_1_R_less",
-                        "group": "dev",
-                        "purpose": "probe"
-                    },
-                    "template": "probe"
-                },
-                {
-                    "outputs": {
-                        "model_id": "{{ system_user.username }}/text/1",
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "TemplateView",
-                    "name": "eval_templates",
-                    "parameters": {
-                        "protocol": "Idiap_1_1_R_less",
-                        "group": "eval",
-                        "purpose": "enroll"
-                    },
-                    "template": "enroll"
-                },
-                {
-                    "outputs": {
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "View",
-                    "name": "eval_probes",
-                    "parameters": {
-                        "protocol": "Idiap_1_1_R_less",
-                        "group": "eval",
-                        "purpose": "probe"
-                    },
-                    "template": "probe"
-                }
-            ]
-        },
-        {
-            "name": "Idiap_1_5_R_less",
-            "template": "advanced_vein_recognition_2",
-            "sets": [
-                {
-                    "outputs": {
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "View",
-                    "template": "train",
-                    "parameters": {
-                        "protocol": "Idiap_1_5_R_less",
-                        "group": "world"
-                    },
-                    "name": "train"
-                },
-                {
-                    "outputs": {
-                        "model_id": "{{ system_user.username }}/text/1",
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "TemplateView",
-                    "name": "dev_templates",
-                    "parameters": {
-                        "protocol": "Idiap_1_5_R_less",
-                        "group": "dev",
-                        "purpose": "enroll"
-                    },
-                    "template": "enroll"
-                },
-                {
-                    "outputs": {
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "View",
-                    "name": "dev_probes",
-                    "parameters": {
-                        "protocol": "Idiap_1_5_R_less",
-                        "group": "dev",
-                        "purpose": "probe"
-                    },
-                    "template": "probe"
-                },
-                {
-                    "outputs": {
-                        "model_id": "{{ system_user.username }}/text/1",
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "TemplateView",
-                    "name": "eval_templates",
-                    "parameters": {
-                        "protocol": "Idiap_1_5_R_less",
-                        "group": "eval",
-                        "purpose": "enroll"
-                    },
-                    "template": "enroll"
-                },
-                {
-                    "outputs": {
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "View",
-                    "name": "eval_probes",
-                    "parameters": {
-                        "protocol": "Idiap_1_5_R_less",
-                        "group": "eval",
-                        "purpose": "probe"
-                    },
-                    "template": "probe"
-                }
-            ]
-        },
-        {
-            "name": "Idiap_5_5_R_less",
-            "template": "advanced_vein_recognition_2",
-            "sets": [
-                {
-                    "outputs": {
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "View",
-                    "template": "train",
-                    "parameters": {
-                        "protocol": "Idiap_5_5_R_less",
-                        "group": "world"
-                    },
-                    "name": "train"
-                },
-                {
-                    "outputs": {
-                        "model_id": "{{ system_user.username }}/text/1",
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "TemplateView",
-                    "name": "dev_templates",
-                    "parameters": {
-                        "protocol": "Idiap_5_5_R_less",
-                        "group": "dev",
-                        "purpose": "enroll"
-                    },
-                    "template": "enroll"
-                },
-                {
-                    "outputs": {
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "View",
-                    "name": "dev_probes",
-                    "parameters": {
-                        "protocol": "Idiap_5_5_R_less",
-                        "group": "dev",
-                        "purpose": "probe"
-                    },
-                    "template": "probe"
-                },
-                {
-                    "outputs": {
-                        "model_id": "{{ system_user.username }}/text/1",
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "TemplateView",
-                    "name": "eval_templates",
-                    "parameters": {
-                        "protocol": "Idiap_5_5_R_less",
-                        "group": "eval",
-                        "purpose": "enroll"
-                    },
-                    "template": "enroll"
-                },
-                {
-                    "outputs": {
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "View",
-                    "name": "eval_probes",
-                    "parameters": {
-                        "protocol": "Idiap_5_5_R_less",
-                        "group": "eval",
-                        "purpose": "probe"
-                    },
-                    "template": "probe"
-                }
-            ]
-        },
-        {
-            "name": "Idiap_1_1_R_annotations_BEAT_test",
-            "template": "advanced_vein_annotations",
-            "sets": [
-                {
-                    "outputs": {
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "vein_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "ROI_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "alignment_annotations": "{{ user.username }}/coordinate_list/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "ViewAnnotations",
-                    "template": "train",
-                    "parameters": {
-                        "protocol": "Idiap_1_1_R_BEAT_test",
-                        "group": "world"
-                    },
-                    "name": "train"
-                },
-                {
-                    "outputs": {
-                        "model_id": "{{ system_user.username }}/text/1",
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "vein_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "ROI_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "alignment_annotations": "{{ user.username }}/coordinate_list/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "TemplateViewAnnotations",
-                    "name": "dev_templates",
-                    "parameters": {
-                        "protocol": "Idiap_1_1_R_BEAT_test",
-                        "group": "dev",
-                        "purpose": "enroll"
-                    },
-                    "template": "enroll"
-                },
-                {
-                    "outputs": {
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "vein_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "ROI_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "alignment_annotations": "{{ user.username }}/coordinate_list/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "ViewAnnotations",
-                    "name": "dev_probes",
-                    "parameters": {
-                        "protocol": "Idiap_1_1_R_BEAT_test",
-                        "group": "dev",
-                        "purpose": "probe"
-                    },
-                    "template": "probe"
-                },
-                {
-                    "outputs": {
-                        "model_id": "{{ system_user.username }}/text/1",
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "vein_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "ROI_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "alignment_annotations": "{{ user.username }}/coordinate_list/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "TemplateViewAnnotations",
-                    "name": "eval_templates",
-                    "parameters": {
-                        "protocol": "Idiap_1_1_R_BEAT_test",
-                        "group": "eval",
-                        "purpose": "enroll"
-                    },
-                    "template": "enroll"
-                },
-                {
-                    "outputs": {
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "vein_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "ROI_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "alignment_annotations": "{{ user.username }}/coordinate_list/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "TemplateViewAnnotations",
-                    "name": "eval_probes",
-                    "parameters": {
-                        "protocol": "Idiap_1_1_R_BEAT_test",
-                        "group": "eval",
-                        "purpose": "probe"
-                    },
-                    "template": "probe"
-                }
-            ]
-        },
-        {
-            "name": "Idiap_2_1_R_annotations_BEAT_test",
-            "template": "advanced_vein_annotations",
-            "sets": [
-                {
-                    "outputs": {
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "vein_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "ROI_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "alignment_annotations": "{{ user.username }}/coordinate_list/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "ViewAnnotations",
-                    "template": "train",
-                    "parameters": {
-                        "protocol": "Idiap_5_5_R_BEAT_test",
-                        "group": "world"
-                    },
-                    "name": "train"
-                },
-                {
-                    "outputs": {
-                        "model_id": "{{ system_user.username }}/text/1",
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "vein_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "ROI_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "alignment_annotations": "{{ user.username }}/coordinate_list/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "TemplateViewAnnotations",
-                    "name": "dev_templates",
-                    "parameters": {
-                        "protocol": "Idiap_5_5_R_BEAT_test",
-                        "group": "dev",
-                        "purpose": "enroll"
-                    },
-                    "template": "enroll"
-                },
-                {
-                    "outputs": {
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "vein_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "ROI_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "alignment_annotations": "{{ user.username }}/coordinate_list/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "ViewAnnotations",
-                    "name": "dev_probes",
-                    "parameters": {
-                        "protocol": "Idiap_5_5_R_BEAT_test",
-                        "group": "dev",
-                        "purpose": "probe"
-                    },
-                    "template": "probe"
-                },
-                {
-                    "outputs": {
-                        "model_id": "{{ system_user.username }}/text/1",
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "vein_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "ROI_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "alignment_annotations": "{{ user.username }}/coordinate_list/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "TemplateViewAnnotations",
-                    "name": "eval_templates",
-                    "parameters": {
-                        "protocol": "Idiap_5_5_R_BEAT_test",
-                        "group": "eval",
-                        "purpose": "enroll"
-                    },
-                    "template": "enroll"
-                },
-                {
-                    "outputs": {
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "vein_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "ROI_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "alignment_annotations": "{{ user.username }}/coordinate_list/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "TemplateViewAnnotations",
-                    "name": "eval_probes",
-                    "parameters": {
-                        "protocol": "Idiap_5_5_R_BEAT_test",
-                        "group": "eval",
-                        "purpose": "probe"
-                    },
-                    "template": "probe"
-                }
-            ]
-        },
-        {
-            "name": "Idiap_1_1_R_annotations",
-            "template": "advanced_vein_annotations",
-            "sets": [
-                {
-                    "outputs": {
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "vein_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "ROI_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "alignment_annotations": "{{ user.username }}/coordinate_list/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "ViewAnnotations",
-                    "template": "train",
-                    "parameters": {
-                        "protocol": "Idiap_1_1_R",
-                        "group": "world"
-                    },
-                    "name": "train"
-                },
-                {
-                    "outputs": {
-                        "model_id": "{{ system_user.username }}/text/1",
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "vein_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "ROI_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "alignment_annotations": "{{ user.username }}/coordinate_list/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "TemplateViewAnnotations",
-                    "name": "dev_templates",
-                    "parameters": {
-                        "protocol": "Idiap_1_1_R",
-                        "group": "dev",
-                        "purpose": "enroll"
-                    },
-                    "template": "enroll"
-                },
-                {
-                    "outputs": {
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "vein_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "ROI_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "alignment_annotations": "{{ user.username }}/coordinate_list/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "ViewAnnotations",
-                    "name": "dev_probes",
-                    "parameters": {
-                        "protocol": "Idiap_1_1_R",
-                        "group": "dev",
-                        "purpose": "probe"
-                    },
-                    "template": "probe"
-                },
-                {
-                    "outputs": {
-                        "model_id": "{{ system_user.username }}/text/1",
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "vein_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "ROI_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "alignment_annotations": "{{ user.username }}/coordinate_list/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "TemplateViewAnnotations",
-                    "name": "eval_templates",
-                    "parameters": {
-                        "protocol": "Idiap_1_1_R",
-                        "group": "eval",
-                        "purpose": "enroll"
-                    },
-                    "template": "enroll"
-                },
-                {
-                    "outputs": {
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "vein_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "ROI_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "alignment_annotations": "{{ user.username }}/coordinate_list/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "TemplateViewAnnotations",
-                    "name": "eval_probes",
-                    "parameters": {
-                        "protocol": "Idiap_1_1_R",
-                        "group": "eval",
-                        "purpose": "probe"
-                    },
-                    "template": "probe"
-                }
-            ]
-        },
-        {
-            "name": "Idiap_2_1_R_annotations",
-            "template": "advanced_vein_annotations",
-            "sets": [
-                {
-                    "outputs": {
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "vein_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "ROI_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "alignment_annotations": "{{ user.username }}/coordinate_list/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "ViewAnnotations",
-                    "template": "train",
-                    "parameters": {
-                        "protocol": "Idiap_5_5_R",
-                        "group": "world"
-                    },
-                    "name": "train"
-                },
-                {
-                    "outputs": {
-                        "model_id": "{{ system_user.username }}/text/1",
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "vein_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "ROI_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "alignment_annotations": "{{ user.username }}/coordinate_list/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "TemplateViewAnnotations",
-                    "name": "dev_templates",
-                    "parameters": {
-                        "protocol": "Idiap_5_5_R",
-                        "group": "dev",
-                        "purpose": "enroll"
-                    },
-                    "template": "enroll"
-                },
-                {
-                    "outputs": {
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "vein_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "ROI_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "alignment_annotations": "{{ user.username }}/coordinate_list/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "ViewAnnotations",
-                    "name": "dev_probes",
-                    "parameters": {
-                        "protocol": "Idiap_5_5_R",
-                        "group": "dev",
-                        "purpose": "probe"
-                    },
-                    "template": "probe"
-                },
-                {
-                    "outputs": {
-                        "model_id": "{{ system_user.username }}/text/1",
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "vein_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "ROI_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "alignment_annotations": "{{ user.username }}/coordinate_list/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "TemplateViewAnnotations",
-                    "name": "eval_templates",
-                    "parameters": {
-                        "protocol": "Idiap_5_5_R",
-                        "group": "eval",
-                        "purpose": "enroll"
-                    },
-                    "template": "enroll"
-                },
-                {
-                    "outputs": {
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "vein_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "ROI_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "alignment_annotations": "{{ user.username }}/coordinate_list/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "TemplateViewAnnotations",
-                    "name": "eval_probes",
-                    "parameters": {
-                        "protocol": "Idiap_5_5_R",
-                        "group": "eval",
-                        "purpose": "probe"
-                    },
-                    "template": "probe"
-                }
-            ]
-        },
-        {
-            "name": "Idiap_1_1_L_annotations",
-            "template": "advanced_vein_annotations",
-            "sets": [
-                {
-                    "outputs": {
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "vein_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "ROI_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "alignment_annotations": "{{ user.username }}/coordinate_list/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "ViewAnnotations",
-                    "template": "train",
-                    "parameters": {
-                        "protocol": "Idiap_1_1_L",
-                        "group": "world"
-                    },
-                    "name": "train"
-                },
-                {
-                    "outputs": {
-                        "model_id": "{{ system_user.username }}/text/1",
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "vein_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "ROI_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "alignment_annotations": "{{ user.username }}/coordinate_list/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "TemplateViewAnnotations",
-                    "name": "dev_templates",
-                    "parameters": {
-                        "protocol": "Idiap_1_1_L",
-                        "group": "dev",
-                        "purpose": "enroll"
-                    },
-                    "template": "enroll"
-                },
-                {
-                    "outputs": {
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "vein_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "ROI_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "alignment_annotations": "{{ user.username }}/coordinate_list/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "ViewAnnotations",
-                    "name": "dev_probes",
-                    "parameters": {
-                        "protocol": "Idiap_1_1_L",
-                        "group": "dev",
-                        "purpose": "probe"
-                    },
-                    "template": "probe"
-                },
-                {
-                    "outputs": {
-                        "model_id": "{{ system_user.username }}/text/1",
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "vein_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "ROI_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "alignment_annotations": "{{ user.username }}/coordinate_list/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "TemplateViewAnnotations",
-                    "name": "eval_templates",
-                    "parameters": {
-                        "protocol": "Idiap_1_1_L",
-                        "group": "eval",
-                        "purpose": "enroll"
-                    },
-                    "template": "enroll"
-                },
-                {
-                    "outputs": {
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "vein_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "ROI_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "alignment_annotations": "{{ user.username }}/coordinate_list/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "TemplateViewAnnotations",
-                    "name": "eval_probes",
-                    "parameters": {
-                        "protocol": "Idiap_1_1_L",
-                        "group": "eval",
-                        "purpose": "probe"
-                    },
-                    "template": "probe"
-                }
-            ]
-        },
-        {
-            "name": "Idiap_2_1_L_annotations",
-            "template": "advanced_vein_annotations",
-            "sets": [
-                {
-                    "outputs": {
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "vein_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "ROI_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "alignment_annotations": "{{ user.username }}/coordinate_list/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "ViewAnnotations",
-                    "template": "train",
-                    "parameters": {
-                        "protocol": "Idiap_5_5_L",
-                        "group": "world"
-                    },
-                    "name": "train"
-                },
-                {
-                    "outputs": {
-                        "model_id": "{{ system_user.username }}/text/1",
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "vein_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "ROI_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "alignment_annotations": "{{ user.username }}/coordinate_list/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "TemplateViewAnnotations",
-                    "name": "dev_templates",
-                    "parameters": {
-                        "protocol": "Idiap_5_5_L",
-                        "group": "dev",
-                        "purpose": "enroll"
-                    },
-                    "template": "enroll"
-                },
-                {
-                    "outputs": {
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "vein_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "ROI_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "alignment_annotations": "{{ user.username }}/coordinate_list/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "ViewAnnotations",
-                    "name": "dev_probes",
-                    "parameters": {
-                        "protocol": "Idiap_5_5_L",
-                        "group": "dev",
-                        "purpose": "probe"
-                    },
-                    "template": "probe"
-                },
-                {
-                    "outputs": {
-                        "model_id": "{{ system_user.username }}/text/1",
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "vein_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "ROI_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "alignment_annotations": "{{ user.username }}/coordinate_list/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "TemplateViewAnnotations",
-                    "name": "eval_templates",
-                    "parameters": {
-                        "protocol": "Idiap_5_5_L",
-                        "group": "eval",
-                        "purpose": "enroll"
-                    },
-                    "template": "enroll"
-                },
-                {
-                    "outputs": {
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "vein_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "ROI_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "alignment_annotations": "{{ user.username }}/coordinate_list/1",
-                        "client_id": "{{ system_user.username }}/uint64/1"
-                    },
-                    "view": "TemplateViewAnnotations",
-                    "name": "eval_probes",
-                    "parameters": {
-                        "protocol": "Idiap_5_5_L",
-                        "group": "eval",
-                        "purpose": "probe"
-                    },
-                    "template": "probe"
-                }
-            ]
-        },
-        {
-            "name": "annotation_benchmark",
-            "template": "advanced_annotation_benchmark",
-            "sets": [
-                {
-                    "outputs": {
-                        "image": "{{ system_user.username }}/array_2d_uint8/1",
-                        "vein_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "ROI_annotations": "{{ system_user.username }}/array_2d_uint8/1",
-                        "alignment_annotations": "{{ user.username }}/coordinate_list/1"
-                    },
-                    "view": "AnnotationBenchmark",
-                    "template": "annotation_benchmark",
-                    "parameters": {
-                        "protocol": "Idiap_1_1_R"
-                    },
-                    "name": "annotations"
-                }
-            ]
-        }
-    ]
-}
diff --git a/advanced/databases/biowave/2.py b/advanced/databases/biowave/2.py
deleted file mode 100644
index 05f6cbe..0000000
--- a/advanced/databases/biowave/2.py
+++ /dev/null
@@ -1,745 +0,0 @@
-###############################################################################
-#                                                                             #
-# Copyright (c) 2017 Idiap Research Institute, http://www.idiap.ch/           #
-# Contact: beat.support@idiap.ch                                              #
-#                                                                             #
-# This file is part of the beat.examples module of the BEAT platform.         #
-#                                                                             #
-# Commercial License Usage                                                    #
-# Licensees holding valid commercial BEAT licenses may use this file in       #
-# accordance with the terms contained in a written agreement between you      #
-# and Idiap. For further information contact tto@idiap.ch                     #
-#                                                                             #
-# Alternatively, this file may be used under the terms of the GNU Affero      #
-# Public License version 3 as published by the Free Software and appearing    #
-# in the file LICENSE.AGPL included in the packaging of this file.            #
-# The BEAT platform is distributed in the hope that it will be useful, but    #
-# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY  #
-# or FITNESS FOR A PARTICULAR PURPOSE.                                        #
-#                                                                             #
-# You should have received a copy of the GNU Affero Public License along      #
-# with the BEAT platform. If not, see http://www.gnu.org/licenses/.           #
-#                                                                             #
-###############################################################################
-
-import os
-import numpy as np
-import bob.io.base
-import bob.io.image
-import bob.db.biowave_v1
-
-
-#----------------------------------------------------------
-
-
-def get_client_end_index(objs, client_id, client_start_index,
-                         start_index, end_index):
-    client_end_index = client_start_index
-
-    while client_end_index + 1 <= end_index:
-        obj = objs[client_end_index + 1 - start_index]
-
-        if isinstance(obj, tuple):
-            obj = obj[1]
-
-        if obj.client_id != client_id:
-            return client_end_index
-
-        client_end_index += 1
-
-    return end_index
-
-
-#----------------------------------------------------------
-
-
-def get_model_end_index(objs, model_id, model_start_index,
-                        start_index, end_index):
-    model_end_index = model_start_index
-
-    while model_end_index + 1 <= end_index:
-        obj = objs[model_end_index + 1 - start_index]
-
-        if obj.model_id != model_id:
-            return model_end_index
-
-        model_end_index += 1
-
-    return end_index
-
-
-#----------------------------------------------------------
-
-
-class View:
-    """Outputs:
-        - image: "{{ system_user.username }}/array_2d_uint8/1"
-        - client_id: "{{ system_user.username }}/uint64/1"
-
-    Several "image" are associated with a given "client_id".
-
-    --------------- --------------- --------------- --------------- --------------- ---------------
-    |    image    | |    image    | |    image    | |    image    | |    image    | |    image    |
-    --------------- --------------- --------------- --------------- --------------- ---------------
-    ----------------------------------------------- -----------------------------------------------
-    |                   client_id                 | |                   client_id                 |
-    ----------------------------------------------- -----------------------------------------------
-    """
-
-    def setup(self, root_folder, outputs, parameters, force_start_index=None,
-              force_end_index=None):
-
-        # Initialisations
-        self.root_folder = root_folder
-        self.outputs     = outputs
-        self.parameters  = parameters
-
-        # Open the database and load the objects to provide via the outputs
-        self.db = bob.db.biowave_v1.Database()
-
-        self.objs = sorted(self.db.objects(protocol=self.parameters['protocol'],
-                                           groups=[self.parameters['group']],
-                                           purposes=self.parameters.get('purpose', None),
-                                           annotated_images=False,
-                                           imagedir=self.root_folder),
-                           key=lambda x: (x.client_id, x.id))
-
-        # Determine the range of indices that must be provided
-        self.start_index = force_start_index if force_start_index is not None else 0
-        self.end_index = force_end_index if force_end_index is not None else len(self.objs) - 1
-
-        self.objs = self.objs[self.start_index : self.end_index + 1]
-
-        self.next_index = self.start_index
-
-        return True
-
-
-    def done(self, last_data_index):
-        return last_data_index >= self.end_index
-
-
-    def next(self):
-        obj = self.objs[self.next_index - self.start_index]
-
-        # Output: client_id (only provide data when the client_id change)
-        if self.outputs['client_id'].isConnected() and \
-           self.outputs['client_id'].last_written_data_index < self.next_index:
-
-            client_end_index = get_client_end_index(self.objs, obj.client_id,
-                                                    self.next_index,
-                                                    self.start_index,
-                                                    self.end_index)
-
-            self.outputs['client_id'].write(
-                {
-                    'value': np.uint64(obj.client_id)
-                },
-                client_end_index
-            )
-
-        # Output: image (provide data at each iteration)
-        if self.outputs['image'].isConnected():
-            self.outputs['image'].write(
-                {
-                    'value': obj.load(directory=self.root_folder)
-                },
-                self.next_index
-            )
-
-        # Determine the next data index that must be provided
-        self.next_index = 1 + min([ x.last_written_data_index for x in self.outputs
-                                                              if x.isConnected() ]
-        )
-
-        return True
-
-
-#----------------------------------------------------------
-
-
-class TemplateView:
-    """Outputs:
-        - image: "{{ system_user.username }}/array_2d_uint8/1"
-        - client_id: "{{ system_user.username }}/uint64/1"
-        - model_id: "{{ system_user.username }}/text/1"
-
-    Several "image" are associated with a given "model_id".
-    Several "model_id" are associated with a given "client_id".
-
-    --------------- --------------- --------------- --------------- --------------- ---------------
-    |    image    | |    image    | |    image    | |    image    | |    image    | |    image    |
-    --------------- --------------- --------------- --------------- --------------- ---------------
-    ----------------------------------------------- -----------------------------------------------
-    |                   model_id                  | |                   model_id                  |
-    ----------------------------------------------- -----------------------------------------------
-    -----------------------------------------------------------------------------------------------
-    |                                          client_id                                          |
-    -----------------------------------------------------------------------------------------------
-
-    Note: for this particular database, there is only one "image"
-    per "model_id".
-    """
-
-    def setup(self, root_folder, outputs, parameters, force_start_index=None,
-              force_end_index=None):
-
-        # Initialisations
-        self.root_folder = root_folder
-        self.outputs     = outputs
-        self.parameters  = parameters
-
-        # Open the database and load the objects to provide via the outputs
-        self.db = bob.db.biowave_v1.Database()
-
-        self.objs = sorted(self.db.objects(protocol=self.parameters['protocol'],
-                                           purposes=self.parameters['purpose'],
-                                           groups=[self.parameters['group']],
-                                           annotated_images=False,
-                                           imagedir=self.root_folder),
-                           key=lambda x: (x.client_id, x.model_id, x.id))
-
-        # Determine the range of indices that must be provided
-        self.start_index = force_start_index if force_start_index is not None else 0
-        self.end_index = force_end_index if force_end_index is not None else len(self.objs) - 1
-
-        self.objs = self.objs[self.start_index : self.end_index + 1]
-
-        self.next_index = self.start_index
-
-        return True
-
-
-    def done(self, last_data_index):
-        return last_data_index >= self.end_index
-
-
-    def next(self):
-        obj = self.objs[self.next_index - self.start_index]
-
-        # Output: model_id (only provide data when the model_id change)
-        if self.outputs['model_id'].isConnected() and \
-           self.outputs['model_id'].last_written_data_index < self.next_index:
-
-            model_end_index = get_model_end_index(self.objs, obj.model_id,
-                                                  self.next_index,
-                                                  self.start_index,
-                                                  self.end_index)
-
-            self.outputs['model_id'].write(
-                {
-                    'text': obj.model_id.encode('utf-8')
-                },
-                model_end_index
-            )
-
-        # Output: client_id (only provide data when the client_id change)
-        if self.outputs['client_id'].isConnected() and \
-           self.outputs['client_id'].last_written_data_index < self.next_index:
-
-            # Please pay attention - we can use the object CLIENT ID as long as we
-            # don't use both hands data of the same client in the same protocol.
-            client_end_index = get_client_end_index(self.objs, obj.client_id,
-                                                    self.next_index,
-                                                    self.start_index,
-                                                    self.end_index)
-
-            self.outputs['client_id'].write(
-                {
-                    'value': np.uint64(obj.client_id)
-                },
-                client_end_index
-            )
-
-        # Output: image (provide data at each iteration)
-        if self.outputs['image'].isConnected():
-            self.outputs['image'].write(
-                {
-                    'value': obj.load(directory=self.root_folder)
-                },
-                self.next_index
-            )
-
-        # Determine the next data index that must be provided
-        self.next_index = 1 + min([ x.last_written_data_index for x in self.outputs
-                                                              if x.isConnected() ]
-        )
-
-        return True
-
-
-#----------------------------------------------------------
-
-
-class ViewAnnotations:
-    """Outputs:
-        - image: "{{ system_user.username }}/array_2d_uint8/1"
-        - vein_annotations: "{{ system_user.username }}/array_2d_uint8/1"
-        - ROI_annotations: "{{ system_user.username }}/array_2d_uint8/1"
-        - alignment_annotations: "{{ user.username }}/coordinate_list/1"
-        - client_id: "{{ system_user.username }}/uint64/1"
-
-    One "vein_annotations" are associated with a given "image".
-    One "ROI_annotations" are associated with a given "image".
-    One "alignment_annotations" are associated with a given "image".
-    Several "image" are associated with a given "client_id".
-
-    ------------------------- ------------------------- ------------------------- -------------------------
-    |         image         | |         image         | |         image         | |         image         |
-    ------------------------- ------------------------- ------------------------- -------------------------
-    ------------------------- ------------------------- ------------------------- -------------------------
-    |    vein_annotations   | |    vein_annotations   | |    vein_annotations   | |    vein_annotations   |
-    ------------------------- ------------------------- ------------------------- -------------------------
-    ------------------------- ------------------------- ------------------------- -------------------------
-    |    ROI_annotations    | |    ROI_annotations    | |    ROI_annotations    | |    ROI_annotations    |
-    ------------------------- ------------------------- ------------------------- -------------------------
-    ------------------------- ------------------------- ------------------------- -------------------------
-    | alignment_annotations | | alignment_annotations | | alignment_annotations | | alignment_annotations |
-    ------------------------- ------------------------- ------------------------- -------------------------
-    --------------------------------------------------- ---------------------------------------------------
-    |                     client_id                   | |                     client_id                   |
-    --------------------------------------------------- ---------------------------------------------------
-    """
-
-    def setup(self, root_folder, outputs, parameters, force_start_index=None,
-              force_end_index=None):
-
-        # Initialisations
-        self.root_folder = root_folder
-        self.outputs     = outputs
-        self.parameters  = parameters
-
-        # Open the database and load the objects to provide via the outputs
-        self.db = bob.db.biowave_v1.Database()
-
-        self.objs = sorted(self.db.objects(protocol=self.parameters['protocol'],
-                                           groups=[self.parameters['group']],
-                                           purposes=self.parameters.get('purpose', None),
-                                           annotated_images=True,
-                                           imagedir=self.root_folder),
-                           key=lambda x: (x.client_id, x.id))
-
-        # Determine the range of indices that must be provided
-        self.start_index = force_start_index if force_start_index is not None else 0
-        self.end_index = force_end_index if force_end_index is not None else len(self.objs) - 1
-
-        self.objs = self.objs[self.start_index : self.end_index + 1]
-
-        self.next_index = self.start_index
-
-        return True
-
-
-    def done(self, last_data_index):
-        return last_data_index >= self.end_index
-
-
-    def next(self):
-        obj = self.objs[self.next_index - self.start_index]
-
-        # Output: client_id (only provide data when the client_id change)
-        if self.outputs['client_id'].isConnected() and \
-           self.outputs['client_id'].last_written_data_index < self.next_index:
-
-            client_end_index = get_client_end_index(self.objs, obj.client_id,
-                                                    self.next_index,
-                                                    self.start_index,
-                                                    self.end_index)
-
-            self.outputs['client_id'].write(
-                {
-                    'value': np.uint64(obj.client_id)
-                },
-                client_end_index
-            )
-
-        # Output: vein_annotations (provide data at each iteration)
-        if self.outputs['vein_annotations'].isConnected():
-            self.outputs['vein_annotations'].write(
-                {
-                    'value': obj.construct_vein_image(directory=self.root_folder)
-                },
-                self.next_index
-            )
-
-        # Output: ROI_annotations (provide data at each iteration)
-        if self.outputs['ROI_annotations'].isConnected():
-            self.outputs['ROI_annotations'].write(
-                {
-                    'value': obj.construct_ROI_image(directory=self.root_folder)
-                },
-                self.next_index
-            )
-
-        # Output: alignment_annotations (provide data at each iteration)
-        if self.outputs['alignment_annotations'].isConnected():
-            alignment_annotations = obj.alignment_annotations(directory=self.root_folder)
-
-            coordinate_list = []
-            for annotation in alignment_annotations:
-                coordinate = {
-                    "y": np.int32(annotation[0]),
-                    "x": np.int32(annotation[1])
-                }
-                coordinate_list.append(coordinate)
-
-            self.outputs['alignment_annotations'].write(
-                {
-                    'coordinate_list': coordinate_list
-                },
-                self.next_index
-            )
-
-        # Output: image (provide data at each iteration)
-        if self.outputs['image'].isConnected():
-            self.outputs['image'].write(
-                {
-                    'value': obj.load(directory=self.root_folder)
-                },
-                self.next_index
-            )
-
-        # Determine the next data index that must be provided
-        self.next_index = 1 + min([ x.last_written_data_index for x in self.outputs
-                                                              if x.isConnected() ]
-        )
-
-        return True
-
-
-#----------------------------------------------------------
-
-
-class TemplateViewAnnotations:
-    """Outputs:
-        - image: "{{ system_user.username }}/array_2d_uint8/1"
-        - vein_annotations: "{{ system_user.username }}/array_2d_uint8/1"
-        - ROI_annotations: "{{ system_user.username }}/array_2d_uint8/1"
-        - alignment_annotations: "{{ user.username }}/coordinate_list/1"
-        - model_id: "{{ system_user.username }}/model_id/1"
-        - client_id: "{{ system_user.username }}/uint64/1"
-
-    One "vein_annotations" are associated with a given "image".
-    One "ROI_annotations" are associated with a given "image".
-    One "alignment_annotations" are associated with a given "image".
-    Several "image" are associated with a given "model_id".
-    Several "model_id" are associated with a given "client_id".
-
-    ------------------------- ------------------------- ------------------------- -------------------------
-    |         image         | |         image         | |         image         | |         image         |
-    ------------------------- ------------------------- ------------------------- -------------------------
-    ------------------------- ------------------------- ------------------------- -------------------------
-    |    vein_annotations   | |    vein_annotations   | |    vein_annotations   | |    vein_annotations   |
-    ------------------------- ------------------------- ------------------------- -------------------------
-    ------------------------- ------------------------- ------------------------- -------------------------
-    |    ROI_annotations    | |    ROI_annotations    | |    ROI_annotations    | |    ROI_annotations    |
-    ------------------------- ------------------------- ------------------------- -------------------------
-    ------------------------- ------------------------- ------------------------- -------------------------
-    | alignment_annotations | | alignment_annotations | | alignment_annotations | | alignment_annotations |
-    ------------------------- ------------------------- ------------------------- -------------------------
-    --------------------------------------------------- ---------------------------------------------------
-    |                     model_id                    | |                     model_id                    |
-    --------------------------------------------------- ---------------------------------------------------
-    -------------------------------------------------------------------------------------------------------
-    |                                              client_id                                              |
-    -------------------------------------------------------------------------------------------------------
-
-    Note: for this particular database, there is only one "image"
-    per "model_id".
-    """
-
-    def setup(self, root_folder, outputs, parameters, force_start_index=None,
-              force_end_index=None):
-
-        # Initialisations
-        self.root_folder = root_folder
-        self.outputs     = outputs
-        self.parameters  = parameters
-
-        # Open the database and load the objects to provide via the outputs
-        self.db = bob.db.biowave_v1.Database()
-
-        self.objs = sorted(self.db.objects(protocol=self.parameters['protocol'],
-                                           purposes=self.parameters['purpose'],
-                                           groups=[self.parameters['group']],
-                                           annotated_images=True,
-                                           imagedir=self.root_folder),
-                           key=lambda x: (x.client_id, x.model_id, x.id))
-
-        # Determine the range of indices that must be provided
-        self.start_index = force_start_index if force_start_index is not None else 0
-        self.end_index = force_end_index if force_end_index is not None else len(self.objs) - 1
-
-        self.objs = self.objs[self.start_index : self.end_index + 1]
-
-        self.next_index = self.start_index
-
-        return True
-
-
-    def done(self, last_data_index):
-        return last_data_index >= self.end_index
-
-
-    def next(self):
-        obj = self.objs[self.next_index - self.start_index]
-
-        # Output: model_id (only provide data when the model_id change)
-        if self.outputs['model_id'].isConnected() and \
-           self.outputs['model_id'].last_written_data_index < self.next_index:
-
-            model_end_index = get_model_end_index(self.objs, obj.model_id,
-                                                  self.next_index,
-                                                  self.start_index,
-                                                  self.end_index)
-
-            self.outputs['model_id'].write(
-                {
-                    'text': obj.model_id.encode('utf-8')
-                },
-                model_end_index
-            )
-
-        # Output: client_id (only provide data when the client_id change)
-        if self.outputs['client_id'].isConnected() and \
-           self.outputs['client_id'].last_written_data_index < self.next_index:
-
-            # Please pay attention - we can use the object CLIENT ID as long as we
-            # don't use both hands data of the same client in the same protocol.
-            client_end_index = get_client_end_index(self.objs, obj.client_id,
-                                                    self.next_index,
-                                                    self.start_index,
-                                                    self.end_index)
-
-            self.outputs['client_id'].write(
-                {
-                    'value': np.uint64(obj.client_id)
-                },
-                client_end_index
-            )
-
-        # Output: vein_annotations (provide data at each iteration)
-        if self.outputs['vein_annotations'].isConnected():
-            self.outputs['vein_annotations'].write(
-                {
-                    'value': obj.construct_vein_image(directory=self.root_folder)
-                },
-                self.next_index
-            )
-
-        # Output: ROI_annotations (provide data at each iteration)
-        if self.outputs['ROI_annotations'].isConnected():
-            self.outputs['ROI_annotations'].write(
-                {
-                    'value': obj.construct_ROI_image(directory=self.root_folder)
-                },
-                self.next_index
-            )
-
-        # Output: alignment_annotations (provide data at each iteration)
-        if self.outputs['alignment_annotations'].isConnected():
-            alignment_annotations = obj.alignment_annotations(directory=self.root_folder)
-
-            coordinate_list = []
-            for annotation in alignment_annotations:
-                coordinate = {
-                    "y": np.int32(annotation[0]),
-                    "x": np.int32(annotation[1])
-                }
-                coordinate_list.append(coordinate)
-
-            self.outputs['alignment_annotations'].write(
-                {
-                    'coordinate_list': coordinate_list
-                },
-                self.next_index
-            )
-
-        # Output: image (provide data at each iteration)
-        if self.outputs['image'].isConnected():
-            self.outputs['image'].write(
-                {
-                    'value': obj.load(directory=self.root_folder)
-                },
-                self.next_index
-            )
-
-        # Determine the next data index that must be provided
-        self.next_index = 1 + min([ x.last_written_data_index for x in self.outputs
-                                                              if x.isConnected() ]
-        )
-
-        return True
-
-
-#----------------------------------------------------------
-
-
-class AnnotationBenchmark:
-    """Outputs:
-        - image: "{{ system_user.username }}/array_2d_uint8/1"
-        - vein_annotations: "{{ system_user.username }}/array_2d_uint8/1"
-        - ROI_annotations: "{{ system_user.username }}/array_2d_uint8/1"
-        - alignment_annotations: "{{ user.username }}/coordinate_list/1"
-
-    One "vein_annotations" are associated with a given "image".
-    One "ROI_annotations" are associated with a given "image".
-    One "alignment_annotations" are associated with a given "image".
-
-    ------------------------- ------------------------- ------------------------- -------------------------
-    |         image         | |         image         | |         image         | |         image         |
-    ------------------------- ------------------------- ------------------------- -------------------------
-    ------------------------- ------------------------- ------------------------- -------------------------
-    |    vein_annotations   | |    vein_annotations   | |    vein_annotations   | |    vein_annotations   |
-    ------------------------- ------------------------- ------------------------- -------------------------
-    ------------------------- ------------------------- ------------------------- -------------------------
-    |    ROI_annotations    | |    ROI_annotations    | |    ROI_annotations    | |    ROI_annotations    |
-    ------------------------- ------------------------- ------------------------- -------------------------
-    ------------------------- ------------------------- ------------------------- -------------------------
-    | alignment_annotations | | alignment_annotations | | alignment_annotations | | alignment_annotations |
-    ------------------------- ------------------------- ------------------------- -------------------------
-    """
-
-    def setup(self, root_folder, outputs, parameters, force_start_index=None,
-              force_end_index=None):
-
-        # Initialisations
-        self.root_folder = root_folder
-        self.outputs     = outputs
-        self.parameters  = parameters
-
-        # Open the database and load the objects to provide via the outputs
-        self.db = bob.db.biowave_v1.Database()
-
-        self.objs = sorted(self.db.objects(protocol=self.parameters['protocol'],
-                                           annotated_images=True,
-                                           imagedir=self.root_folder),
-                           key=lambda x: x.id)
-
-        # Determine the range of indices that must be provided
-        self.start_index = force_start_index if force_start_index is not None else 0
-        self.end_index = force_end_index if force_end_index is not None else len(self.objs) - 1
-
-        self.objs = self.objs[self.start_index : self.end_index + 1]
-
-        self.next_index = self.start_index
-
-        return True
-
-
-    def done(self, last_data_index):
-        return last_data_index >= self.end_index
-
-
-    def next(self):
-        obj = self.objs[self.next_index - self.start_index]
-
-        # Output: vein_annotations (provide data at each iteration)
-        if self.outputs['vein_annotations'].isConnected():
-            self.outputs['vein_annotations'].write(
-                {
-                    'value': obj.construct_vein_image(directory=self.root_folder)
-                },
-                self.next_index
-            )
-
-        # Output: ROI_annotations (provide data at each iteration)
-        if self.outputs['ROI_annotations'].isConnected():
-            self.outputs['ROI_annotations'].write(
-                {
-                    'value': obj.construct_ROI_image(directory=self.root_folder)
-                },
-                self.next_index
-            )
-
-        # Output: alignment_annotations (provide data at each iteration)
-        if self.outputs['alignment_annotations'].isConnected():
-            alignment_annotations = obj.alignment_annotations(directory=self.root_folder)
-
-            coordinate_list = []
-            for annotation in alignment_annotations:
-                coordinate = {
-                    "y": np.int32(annotation[0]),
-                    "x": np.int32(annotation[1])
-                }
-                coordinate_list.append(coordinate)
-
-            self.outputs['alignment_annotations'].write(
-                {
-                    'coordinate_list': coordinate_list
-                },
-                self.next_index
-            )
-
-        # Output: image (provide data at each iteration)
-        if self.outputs['image'].isConnected():
-            self.outputs['image'].write(
-                {
-                    'value': obj.load(directory=self.root_folder)
-                },
-                self.next_index
-            )
-
-        # Determine the next data index that must be provided
-        self.next_index = 1 + min([ x.last_written_data_index for x in self.outputs
-                                                              if x.isConnected() ]
-        )
-
-        return True
-
-
-#----------------------------------------------------------
-
-
-def setup_tests():
-    # Install a mock methods
-    def mock_load(obj, directory=''):
-        return np.ndarray((10, 20), dtype=np.uint8)
-
-    def mock_construct_vein_image(obj, directory=''):
-        return np.ndarray((10, 20), dtype=np.uint8)
-
-    def mock_construct_ROI_image(obj, directory=''):
-        return np.ndarray((10, 20), dtype=np.uint8)
-
-    bob.db.biowave_v1.models.File.load = mock_load
-    bob.db.biowave_v1.models.File.construct_vein_image = mock_construct_vein_image
-    bob.db.biowave_v1.models.File.construct_ROI_image = mock_construct_ROI_image
-
-
-#----------------------------------------------------------
-
-
-# Test the behavior of the views (on fake data)
-if __name__ == '__main__':
-
-    setup_tests()
-
-    from beat.backend.python.database import DatabaseTester
-
-    DatabaseTester('View', View,
-        [
-            'client_id',
-            'image',
-        ],
-        parameters=dict(
-            protocol="Idiap_1_1_R_BEAT_test",
-            group="world",
-        ),
-    )
-
-    DatabaseTester('TemplateView', TemplateView,
-        [
-            'client_id',
-            'model_id',
-            'image',
-        ],
-        parameters=dict(
-            protocol="Idiap_1_1_R_BEAT_test",
-            group="dev",
-            purpose="enroll",
-        ),
-        irregular_outputs=[
-            'model_id',
-        ]
-    )
diff --git a/advanced/databases/biowave/2.rst b/advanced/databases/biowave/2.rst
deleted file mode 100644
index 83b1b8e..0000000
--- a/advanced/databases/biowave/2.rst
+++ /dev/null
@@ -1,208 +0,0 @@
-.. Copyright (c) 2016 Idiap Research Institute, http://www.idiap.ch/          ..
-.. Contact: beat.support@idiap.ch                                             ..
-..                                                                            ..
-.. This file is part of the beat.examples module of the BEAT platform.        ..
-..                                                                            ..
-.. Commercial License Usage                                                   ..
-.. Licensees holding valid commercial BEAT licenses may use this file in      ..
-.. accordance with the terms contained in a written agreement between you     ..
-.. and Idiap. For further information contact tto@idiap.ch                    ..
-..                                                                            ..
-.. Alternatively, this file may be used under the terms of the GNU Affero     ..
-.. Public License version 3 as published by the Free Software and appearing   ..
-.. in the file LICENSE.AGPL included in the packaging of this file.           ..
-.. The BEAT platform is distributed in the hope that it will be useful, but   ..
-.. WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ..
-.. or FITNESS FOR A PARTICULAR PURPOSE.                                       ..
-..                                                                            ..
-.. You should have received a copy of the GNU Affero Public License along     ..
-.. with the BEAT platform. If not, see http://www.gnu.org/licenses/.          ..
-
-BIOWAVE Vein Database
----------------------
-
-Changelog
-=========
-
-* **Version 2**, 30/Oct/2017:
-
-  - Port to beat.backend.python v1.4.2
-
-* **Version 1**, 10/Feb/2017:
-
-  - Initial release
-
-
-Description
-===========
-
-
-The ``BIOWAVE`` database contains wrist vein images that are acquired using
-BIOWATCH biometric sensor. For each subject of the database there are 3 session
-images (sessions were held at least 24 hours apart). Each session consists of 5
-attempts, in each attempt 5 images were acquired, meaning, that there are
-``3 sessions x 5 attempts x 5 images = 75`` images per each person's hand,
-``75 x 2 images`` per person.
-
-Images were previously manually evaluated, and if any of the 75 one hand's
-images were unusable (too blurred, veins couldn't be seen, etc), than all hand
-data were discarded. That is way some persons has only 1 hand's images in the
-database.
-
-Statistics of the data - in total 111 hands:
-
-1) Users with both hands images - 53
-2) Users with only R hand images - 4
-3) Users with only L hand images - 1
-
-
-
-Data division in ``groups`` and ``purposes``
-############################################
-
-
-In the BIOWAVE database there are following groups and purposes:
-
-
-+-------------+-----------+-----------------------+------------------------+
-| **groups**  | ``world`` |         ``dev``       |         ``eval``       |
-+-------------+-----------+-----------------------+------------------------+
-|**purposes** | ``train`` |``enroll`` / ``probe`` | ``enroll`` / ``probe`` |
-+-------------+-----------+-----------------------+------------------------+
-
-
-Data are divided into training, development and evolution data sets:
-
-1) ``dev`` data set -- ``20`` persons with both hand images;
-2) ``eval`` data set -- ``20`` persons with both hand images;
-3) ``world`` data set -- the rest of ``13`` persons with both hand images + ``4`` persons with only ``right`` hand and the ``1`` person with only ``left`` hand images.
-
-Data are divided as follows (the number means original persons ``ID`` (as in
-data collection)):
-
-1) ``dev`` data - [1, 3, 5, 6, 12, 15, 22, 23, 25, 45, 69, 71, 74, 76, 77, 78, 84, 129, 132, 134]
-2) ``eval`` data - [4, 7, 21, 42, 43, 48, 54, 57, 58, 72, 73, 75, 83, 90, 99, 130, 131, 138, 141, 143]
-3) ``world`` data - [13, 14, 17, 20, 24, 28, 31, 39, 51, 60, 68, 128, 133] + [37] + [2, 11, 46, 70]
-
-In the ``enroll`` data sets are images only from session ``1`` whereas in
-``probe`` data sets -- session's ``2`` and ``3`` data.
-
-
-Protocols
-#########
-
-There currently are 6 *standard* protocols:
-
-- ``Idiap_1_1_R``
-- ``Idiap_1_5_R``
-- ``Idiap_5_5_R``
-- ``Idiap_1_1_L``
-- ``Idiap_1_5_L``
-- ``Idiap_5_5_L``
-
-The general form::
-
-    Idiap_<a>_<b>_<c>
-
-* a -- number of attempts used to construct model;
-* b -- number of attempt images used to construct model;
-* c -- hand (``L`` or ``R``). Always all images are used, the opposite hand's images are mirrored.
-
-E.g. in protocol ``Idiap_5_5_R`` per one hand only one enroll model is
-constructed using all session ``1`` images (``5 attempt x 5 images``). In this
-protocol ``right`` hands are included unchanged, but ``left`` hands are
-mirrored.
-
-After data alignment were annotated, that included common point finding between
-each person images, we noted that some of the person data were almost impossible
-to annotate. Hands were:
-
-- Person_002/Right
-- Person_005/Left
-- Person_015/Right
-- Person_046/Right
-- Person_068/Right
-- Person_068/Left
-- Person_129/Right
-- Person_138/Left
-
-For protocols:
-
-- ``Idiap_1_1_R_less``
-- ``Idiap_1_5_R_less``
-- ``Idiap_5_5_R_less``
-
-also listed hand data were removed.
-
-
-Protocol ``Idiap_3_5_R`` is not *standard* - in this protocol enroll model is
-constructed using all 3 session 1st attempt images (thus each model consists of
-``3x5=15`` images). This protocol is made to understand the enroll image
-variabilities impact on the recognition rate.
-
-Finally, the protocols:
-
-- ``Idiap_1_1_R_BEAT_test``
-- ``Idiap_1_5_R_BEAT_test``
-- ``Idiap_5_5_R_BEAT_test``
-
-are made as test protocols mainly for the BEAT platform. Again, the numbers in
-the name indicates number of images per attempt and attempt count per each
-enroll model. Each of the protocol groups consists of only 2 person data:
-
--  train -- [128, 133],
--  dev -- [132, 134],
--  eval -- [141, 143].
-
-All these protocols uses the ``advanced_vein_recognition_2`` template.
-
-Annotations
-###########
-
-
-8% of database files have annotations (2 images per session, 6 images per hand,
-altogether 666 images). There are:
-
-- vein pattern binary annotations;
-- ROI binary annotations;
-- alignment point annotations (for each hand 3-5 points marked).
-
-
-Annotations to replace extractors
-#################################
-
-
-Special protocols that consists only the files that have annotations are made.
-Meaning, these protocols can be used to run !!!!! TBD
-
-
-
-
-
-The organisation of the database is the same as before, only now, because there
-are only 2 annotated images per session, protocols are renamed accordingly (also
-note, that now protocols ``Idiap_1_5_R`` and ``Idiap_1_5_L`` doesn't make any
-sense and are removed, because there are only 1 image per attempt that is
-annotated):
-
-- ``Idiap_1_1_R`` -> renamed as ``Idiap_1_1_R_annotations``;
-- ``Idiap_5_5_R`` -> renamed as ``Idiap_2_1_R_annotations``;
-- ``Idiap_1_1_L`` -> renamed as ``Idiap_1_1_L_annotations``;
-- ``Idiap_5_5_L`` -> renamed as ``Idiap_2_1_L_annotations``;
-
-
-Also, the same as ``Idiap_<a>_<b>_<c>_BEAT_test`` protocols were created to
-speedy test BEAT implementation and compare results with ``bob.bio.vein``, also
-test protocols for annotations are implemented:
-
-- ``Idiap_1_1_R_annotations_BEAT_test``;
-- ``Idiap_2_1_R_annotations_BEAT_test``;
-- ``Idiap_1_1_L_annotations_BEAT_test``;
-- ``Idiap_2_1_L_annotations_BEAT_test``;
-
-These protocols uses the ``advanced_vein_annotations`` template.
-
-Also, to benchmark different algorithms against **all** image annotations, there
-are implemented protocol ``annotations_benchmark`` that is implemented using
-``advanced_annotation_benchmark`` template.
-
diff --git a/system/dataformats/system_username/array_1d_coordinates/1.json b/system/dataformats/system_username/array_1d_coordinates/1.json
new file mode 100644
index 0000000..6e08869
--- /dev/null
+++ b/system/dataformats/system_username/array_1d_coordinates/1.json
@@ -0,0 +1,7 @@
+{
+  "#description": "One-dimensional array of 2D integer coordinates",
+  "value": [
+    0,
+    "{{ system_user.username }}/coordinates/1"
+  ]
+}
-- 
GitLab