@@ -270,8 +270,20 @@ def __init__(self, lower_threshold=0.):
270270 self .lower_threshold = lower_threshold
271271 query .LiveQuery .__init__ (self )
272272
273- def _get_volume_boundingbox (self , vol : Volume ):
274- """Extract query bounding box from image volume."""
273+ def query (
274+ self , concept : structure .BrainStructure , ** kwargs
275+ ) -> List [BigBrain1MicronPatch ]:
276+
277+ # make sure input is an image volume
278+ # TODO function should be extended to deal with other concepts as well
279+ if not isinstance (concept , Volume ):
280+ logger .warning (
281+ "Querying BigBrain1MicronPatch features requires to "
282+ "query with an image volume."
283+ )
284+ return []
285+
286+ # threshold image volume, if requested
275287 if self .lower_threshold > 0.0 :
276288 logger .info (
277289 f"Applying lower threshold of { self .lower_threshold } "
@@ -285,24 +297,6 @@ def _get_volume_boundingbox(self, vol: Volume):
285297 query_vol = concept
286298 bb_bbox = query_vol .get_boundingbox ().warp ('bigbrain' )
287299
288- def query (
289- self , concept : structure .BrainStructure , ** kwargs
290- ) -> List [BigBrain1MicronPatch ]:
291-
292- # make sure input is an image volume
293- # TODO function should be extended to deal with other concepts as well
294- if isinstance (concept , Volume ):
295- bb_bbox = get_volume_boundingbox (concept )
296- if isinstance (concept , BoundingBox ):
297- bb_bbox = concept
298- else :
299- logger .warning (
300- "Querying BigBrain1MicronPatch features "
301- f"by { concept .__class__ .name } is not supported."
302- )
303- return []
304-
305-
306300 # find 1 micron BigBrain sections intersecting the thresholded volume
307301 sections : List [CellbodyStainedSection ] = [
308302 s
0 commit comments