Skip to content

Commit

Permalink
TVB-2757: Add filters to the surface and volume time series viewers.
Browse files Browse the repository at this point in the history
  • Loading branch information
VinczeRobert committed Jan 20, 2021
1 parent 641c418 commit 6027002
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
6 changes: 3 additions & 3 deletions framework_tvb/tvb/adapters/visualizers/annotations_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,13 @@ class ConnectivityAnnotationsViewForm(ABCAdapterForm):
def __init__(self):
super(ConnectivityAnnotationsViewForm, self).__init__()
# Used for filtering
annotations_index_filter = FilterChain(fields=[FilterChain.datatype + '.number_of_regions'], operations=["=="],
values=['fk_connectivity_gid'])
connectivity_index_filter = FilterChain(fields=[FilterChain.datatype + '.number_of_regions'], operations=["=="],
values=['fk_connectivity_gid'])

self.connectivity_index = TraitDataTypeSelectField(ConnectivityAnnotationsViewModel.connectivity_index,
'connectivity_index',
runtime_conditions=('annotations_index',
annotations_index_filter))
connectivity_index_filter))

self.annotations_index = TraitDataTypeSelectField(ConnectivityAnnotationsViewModel.annotations_index,
'annotations_index', conditions=self.get_filters())
Expand Down
8 changes: 7 additions & 1 deletion framework_tvb/tvb/adapters/visualizers/surface_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,18 @@ class BaseSurfaceViewerForm(ABCAdapterForm):

def __init__(self):
super(BaseSurfaceViewerForm, self).__init__()
self.region_map = TraitDataTypeSelectField(BaseSurfaceViewerModel.region_map, name='region_map')
rm_runtime_condition = FilterChain(fields=[FilterChain.datatype + '.fk_surface_gid'], operations=["=="],
values=[FilterChain.DEFAULT_RUNTIME_VALUE])

self.region_map = TraitDataTypeSelectField(BaseSurfaceViewerModel.region_map, name='region_map',
runtime_conditions=('surface', rm_runtime_condition))

conn_filter = FilterChain(
fields=[FilterChain.datatype + '.ndim', FilterChain.datatype + '.has_surface_mapping'],
operations=["==", "=="], values=[1, True])
self.connectivity_measure = TraitDataTypeSelectField(BaseSurfaceViewerModel.connectivity_measure,
name='connectivity_measure', conditions=conn_filter)

self.shell_surface = TraitDataTypeSelectField(BaseSurfaceViewerModel.shell_surface, name='shell_surface')

@staticmethod
Expand Down
6 changes: 5 additions & 1 deletion framework_tvb/tvb/adapters/visualizers/time_series_volume.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,11 @@ def __init__(self):
super(TimeSeriesVolumeVisualiserForm, self).__init__()
self.time_series = TraitDataTypeSelectField(TimeSeriesVolumeVisualiserModel.time_series, name='time_series',
conditions=self.get_filters())
self.background = TraitDataTypeSelectField(TimeSeriesVolumeVisualiserModel.background, name='background')

volume_index_filter = FilterChain(fields=[FilterChain.datatype + '.voxel_size'], operations=["=="],
values=['fk_volume_gid'])
self.background = TraitDataTypeSelectField(TimeSeriesVolumeVisualiserModel.background, name='background',
runtime_conditions=('time_series', volume_index_filter))

@staticmethod
def get_view_model():
Expand Down

0 comments on commit 6027002

Please sign in to comment.