FZJ-INM1-BDA / siibra-python

Software interfaces for interacting with brain atlases - Python client
Apache License 2.0
46 stars 8 forks source link

TypeError: RegionalTimeseriesActivity.__init__() got an unexpected keyword argument 'files' #586

Closed xgui3783 closed 2 months ago

xgui3783 commented 2 months ago

as of 3d3b74798157f0e5762b0a2e75fe53425fb2a197 (used by siibra-api rc build)

sample code

import siibra
feature = siibra.features.Feature._get_instance_by_id("cf0::RegionalBOLD::p:minds/core/parcellationatlas/v1.0.0/94c1125b-b87e-45e4-901c-00daee7f2579-290::r:Area hOc1 (V1, 17, CalcS) left::164b7564-1730-4b51-9c98-308005b620dd::2a993ff2650c1a95e9c331e6a33c4325")
feature.plot()

expected result: return plot object

actual result:

Loading preconfigured RegionalBOLD instances: 100%|████████████████████████████| 8/8 [00:00<00:00, 827.34RegionalBOLD/s]
Matching RegionalBOLD to Area hOc1 (V1, 17, CalcS) left: 100%|████████████████████| 1600/1600 [00:00<00:00, 4482.02it/s]
>>> f.plot()
[siibra:INFO] CompoundFeature.data averages the data of each element.
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/xiao/dev/projects/siibra-api/venv/lib/python3.10/site-packages/siibra/features/feature.py", line 779, in plot
    return self._get_merged_feature().plot(*args, **kwargs)
  File "/home/xiao/dev/projects/siibra-api/venv/lib/python3.10/site-packages/siibra/features/feature.py", line 785, in _get_merged_feature
    self._merged_feature_cached = self.feature_type._merge_elements(
  File "/home/xiao/dev/projects/siibra-api/venv/lib/python3.10/site-packages/siibra/features/tabular/regional_timeseries_activity.py", line 105, in _merge_elements
    merged = cls(
  File "/home/xiao/dev/projects/siibra-api/venv/lib/python3.10/site-packages/siibra/features/tabular/regional_timeseries_activity.py", line 273, in __init__
    RegionalTimeseriesActivity.__init__(self, **kwargs)
TypeError: RegionalTimeseriesActivity.__init__() got an unexpected keyword argument 'files'
AhmetNSimsek commented 2 months ago

I found the issue but, on another note, how you did obtain this feature ID?

xgui3783 commented 2 months ago

I found the issue but, on another note, how you did obtain this feature ID?

Judging from the id, something like

import siibra
region = siibra.get_region("julich brain 2.9", "hoc1 left")
features = siibra.features.get(region, "BOLD")

and it's one of the features

AhmetNSimsek commented 2 months ago

The bold features are anchored at the parcellations so the query should be with a parcellation. But there is no get_profile as in connectivity features. I can add this functionality but could you remind me how siibra-api queries connectivity profiles? (or the flowchart)

xgui3783 commented 2 months ago

do you mean that I shouldn't be able to get any bold features?

AhmetNSimsek commented 2 months ago

do you mean that I shouldn't be able to get any bold features?

You can but it is inefficient as it is not designed this way.

AhmetNSimsek commented 2 months ago

Fixed as of 1777ded9e68d28542ca4caf95f08f49ed3645c94