-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ImageSeriesWidget fixes #196
base: master
Are you sure you want to change the base?
Conversation
… improve_plane_seg_coverage
Codecov Report
@@ Coverage Diff @@
## master #196 +/- ##
==========================================
+ Coverage 67.72% 69.54% +1.81%
==========================================
Files 32 33 +1
Lines 2947 3067 +120
==========================================
+ Hits 1996 2133 +137
+ Misses 951 934 -17
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
nwbwidgets/image.py
Outdated
imageseries.starting_time | ||
+ get_frame_count(path_ext_file) / imageseries.rate | ||
) | ||
tmin = 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why reset tmin to 0 every update?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
knowing the starting_time
for video files other than the first one is not possible. Unless we assume the starting time to the end time for the last video in the sequence. But I don't think this would be a good approximation, so I have made the time_slider
widget to span the video frames (0, num_frames) instead, only when the user requests video other than the first one. What do you think of this approach?
Check here https://github.com/NeurodataWithoutBorders/nwb-jupyter-widgets/blob/3add69ade68d62a7790abeac45f538e11c7ea7dc/nwbwidgets/image.py#L114
nwbwidgets/image.py
Outdated
self.controls.update({key: widgets.fixed(val) for key, val in kwargs.items()}) | ||
def get_children(self, *widgets): | ||
set_widgets = [wid for wid in widgets if wid is not None] | ||
return [self.figure, self.time_slider, *set_widgets] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a foreign time slider should not be included in the children
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In case there is a foreign_time_slider
, then what is the best way to add another callback (update figure) ? The usual way of using foreign_time_slider.observe(set_figure)
would overwrite the old callbacks.
One possible solution would be to link the values of foreign_time_slider
to the new time_slider
: widgets.jslink((foreign_time_slider,"value"),(time_slider,"value"))
In effect, the time_slider would now be controlled by the foreign slider while keeping the functionality of being changed independently.
Check ae8e9cc
Updating the
ImageSeriesWidget
and makingTwoPhotonSeriesWidget
as a child class.ImageSeriesWidget
:external_file
:external_file
needs to be viz.TwoPhotonSeriesWidget
:ImageSeriesWidget