Skip to content

Commit 400520d

Browse files
committed
parcellationmaps raise NoPredifinedColormapException for no preconfigured cmap
1 parent f742d7e commit 400520d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

siibra/volumes/parcellationmap.py

+5
Original file line numberDiff line numberDiff line change
@@ -730,6 +730,11 @@ def get_colormap(self, region_specs: Iterable = None):
730730
region = self.get_region(index=index)
731731
if region.rgb is not None:
732732
colors[index.label] = region.rgb
733+
if len(colors) == 0:
734+
raise exceptions.NoPredifinedColormapException(
735+
f"There is no predefined/preconfigured colormap for '{self}'."
736+
"Set `allow_random_colors=True` to a colormap with random values"
737+
)
733738

734739
palette = np.array(
735740
[

0 commit comments

Comments
 (0)