Skip to content

Add BCT metrics projection widget - #103

Open
deeptive wants to merge 3 commits into
mainfrom
bct-metrics-projection-pr
Open

Add BCT metrics projection widget#103
deeptive wants to merge 3 commits into
mainfrom
bct-metrics-projection-pr

Conversation

@deeptive

@deeptive deeptive commented Jul 5, 2026

Copy link
Copy Markdown
Collaborator

Adds a BCT metrics projection widget for interactive execution and visualization of Brain Connectivity ToolBox metrics on TVB Connectivity data.

Comment thread notebooks/BCT_metrics_projection.ipynb Outdated
"outputs": [],
"source": [
"from tvb.datatypes.connectivity import Connectivity\n",
"from tvbwidgets.ui.bct.bct_metrics_widget import BCTMetricsProjectionWidget\n",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you could expose BCTMetricsProjectionWidget in tvbwidgets.api and import it from there here in the notebook, to stay consistent with the other widgets examples.

@liadomide liadomide added the enhancement New feature or request label Jul 10, 2026
"outputs": [],
"source": [
"from tvb.datatypes.connectivity import Connectivity\n",
"from tvbwidgets.api import BCTMetricsProjectionWidget\n",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reverse order of imports should avoid the library issue:

from tvbwidgets.api import BCTMetricsProjectionWidget
from tvb.datatypes.connectivity import Connectivity

@liadomide

Copy link
Copy Markdown
Member

As the default connectivity does not have the main diagonal 0, and this conflicts with some analyzers, could we add a step to make the diagonal zero at a user-action? Maybe a button in the widget, or a cell in the notebook ?

@liadomide

Copy link
Copy Markdown
Member

I merged another PR recently in main
I suggest a rebase in this branch before merging the PR

@deeptive

Copy link
Copy Markdown
Collaborator Author

As the default connectivity does not have the main diagonal 0, and this conflicts with some analyzers, could we add a step to make the diagonal zero at a user-action? Maybe a button in the widget, or a cell in the notebook ?

Currently, the widget checks whether the connectivity matrix has non-zero diagonal entries (which conflict with all analyzers). If so, it displays a confirmation dialog asking the user whether to set the diagonal to zero, and only proceeds with the modification if the user confirms. Would this be considered the intended user-triggered step, or would you prefer a separate Zero Diagonal button instead?

@deeptive
deeptive force-pushed the bct-metrics-projection-pr branch from df24a7e to 591faf5 Compare July 23, 2026 05:44
@sonarqubecloud

Copy link
Copy Markdown

@915-Misan-Teodora

915-Misan-Teodora commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Dear @deeptive, the widget looks good!
I just have a few small suggestions before merging this:

  • when running the analysis, all modified cells are printed. This list can become quite long, especially because it also includes the diagonal values that are set to 0. Maybe we could either remove the detailed list or just print the total number of modified cells
  • I think a clear title and a short description at the top of the notebook explaining what the BCT metrics widget does would help users understand the purpose of the notebook before running the cells
  • there are still a few old messages for loading the connectivity: 'Load your connectivity below, ...', 'Hit Load first to load the connectivity editor', you could update them to refer to the new edit connectivity button

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants