siibra.features.feature

Handles multimodal data features and related queries.

Attributes

TypeDataset

Exceptions

EncodeLiveQueryIdException

Common base class for all non-exit exceptions.

NotFoundException

Common base class for all non-exit exceptions.

ParseLiveQueryIdException

Common base class for all non-exit exceptions.

Classes

Feature

Base class for anatomically anchored data features.

Module Contents

exception siibra.features.feature.EncodeLiveQueryIdException
Inheritance diagram of siibra.features.feature.EncodeLiveQueryIdException

Common base class for all non-exit exceptions.

exception siibra.features.feature.NotFoundException
Inheritance diagram of siibra.features.feature.NotFoundException

Common base class for all non-exit exceptions.

exception siibra.features.feature.ParseLiveQueryIdException
Inheritance diagram of siibra.features.feature.ParseLiveQueryIdException

Common base class for all non-exit exceptions.

class siibra.features.feature.Feature(modality: str, description: str, anchor: siibra.features.anchor.AnatomicalAnchor, datasets: List[TypeDataset] = [], prerelease: bool = False, id: str = None)

Base class for anatomically anchored data features.

classmethod clean_instances()

Removes all instantiated object instances

classmethod deserialize_query_context(feature_id: str) Tuple[Type[Feature], Feature.deserialize_query_context.concept, str]

Deserialize id into query context.

See docstring of serialize_query_context for context.

export(filelike: str | BinaryIO)

Export as a zip archive.

Args:

filelike (string or filelike): name or filehandle to write the zip file. User is responsible to ensure the correct extension (.zip) is set.

classmethod get_ascii_tree()
classmethod get_instance_by_id(feature_id: str, **kwargs)
classmethod get_instances(**kwargs) List[Feature]

Retrieve objects of a particular feature subclass. Objects can be preconfigured in the configuration, or delivered by Live queries.

classmethod livequery(concept: siibra.core.region.Region | siibra.core.parcellation.Parcellation | siibra.core.space.Space, **kwargs) List[Feature]
classmethod match(concept: siibra.core.region.Region | siibra.core.parcellation.Parcellation | siibra.core.space.Space, feature_type: str | Type[Feature] | list, **kwargs) List[Feature]

Retrieve data features of the desired modality.

Parameters:
  • concept (AtlasConcept) – An anatomical concept, typically a brain region or parcellation.

  • modality (subclass of Feature) – specififies the type of features (“modality”)

matches(concept: Feature.matches.concept) bool
classmethod parse_featuretype(feature_type: str) List[Type[Feature]]
abstract plot(*args, **kwargs)

Feature subclasses override this with their customized plot methods.

static serialize_query_context(feat: Feature, concept: Feature.serialize_query_context.concept) str

Serialize feature from livequery and query context.

It is currently impossible to retrieve a livequery with a generic UUID. As such, the query context (e.g. region, space or parcellation) needs to be encoded in the id.

Whilst it is possible to (de)serialize any queries, the method is setup to only serialize livequery features.

The serialized livequery id follows the following pattern:

<livequeryid_version>::<feature_cls_name>::<query_context>::<unserialized_id>

Where:

  • livequeryid_version: version of the serialization. (e.g. lq0)

  • feature_cls_name: class name to query. (e.g. BigBrainIntensityProfile)

  • query_context: string to retrieve atlas concept in the query context. Can be one of the following:
    • s:<space_id>

    • p:<parcellation_id>

    • p:<parcellation_id>::r:<region_id>

  • unserialized_id: id prior to serialization

See test/features/test_feature.py for tests and usages.

static wrap_livequery_feature(feature: Feature, fid: str)

Wrap live query features, override only the id attribute.

Some features do not have setters for the id property. The ProxyFeature class allow the id property to be overridden without touching the underlying class.

See docstring of serialize_query_context for further context.

CATEGORIZED: Dict[str, Type[siibra.commons.InstanceTable]]
property LICENSE: str
SUBCLASSES: Dict[Type[Feature], List[Type[Feature]]]
property anchor
property authors
category: str = None
datasets = []
property description

Allows subclasses to overwrite the description with a function call.

property doi_or_url: str
property id
property last_match_description
property last_match_result
property modality
property name

Returns a short human-readable name of this feature.

siibra.features.feature.TypeDataset