Generalise graph algorithm to work for any fetal structure. Important: \r\n* still some hardcoded bit in reading the mask inventory file, still crucial to obey order of id list! \r\n* all outcoming data seems to be binary (label probs, confidence, etc), still need to figure out what went wrong there.