Skip to content

Commit 05756b9

Browse files
authored
Merge pull request #620 from FZJ-INM1-BDA/maint_dif_spaced_vol_intersection
Prevent the intersection of volumes from different spaces
2 parents eb0a519 + d250546 commit 05756b9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

siibra/volumes/volume.py

+2
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,8 @@ def intersection(self, other: structure.BrainStructure, **fetch_kwargs) -> struc
400400
elif isinstance(other, boundingbox.BoundingBox):
401401
return self.get_boundingbox(clip=True, background=0.0, **fetch_kwargs).intersection(other)
402402
elif isinstance(other, Volume):
403+
if self.space != other.space:
404+
raise NotImplementedError("Cannot intersect volumes from different spaces. Try comparing their boudning boxes.")
403405
format = fetch_kwargs.pop('format', 'image')
404406
v1 = self.fetch(format=format, **fetch_kwargs)
405407
v2 = other.fetch(format=format, **fetch_kwargs)

0 commit comments

Comments
 (0)