From 97219b15f0e935f907f6e1e71ca016c5a266df9e Mon Sep 17 00:00:00 2001 From: polarbean Date: Wed, 21 Aug 2024 17:31:46 +0200 Subject: [PATCH] custom atlasing functions --- PyNutil/main.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/PyNutil/main.py b/PyNutil/main.py index 320776e..4a024ec 100644 --- a/PyNutil/main.py +++ b/PyNutil/main.py @@ -79,6 +79,8 @@ def __init__( alignment_json=None, colour=None, atlas_name=None, + atlas_path=None, + label_path=None, atlas_resolution_micron=None, settings_file=None, ) -> None: @@ -109,7 +111,12 @@ def __init__( self.alignment_json = alignment_json self.colour = colour self.atlas_name = atlas_name - self.atlas_volume, self.atlas_labels = self.load_atlas_data(atlas_name=atlas_name) + if (atlas_path or label_path) and atlas_name: + raise ValueError("Please only specify an atlas_path and a label_path or an atlas_name, atlas and label paths are only used for loading custom atlases") + if atlas_path and label_path: + self.atlas_volume, self.atlas_labels = self.load_custom_atlas(atlas_path, label_path) + else: + self.atlas_volume, self.atlas_labels = self.load_atlas_data(atlas_name=atlas_name) ###This is just because of the migration to BrainGlobe def load_atlas_data(self, atlas_name):