Skip to content
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

Add images tutorial #1470

Merged
merged 36 commits into from
Jul 18, 2022
Merged
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
f10d266
add work in progress version of the images tutorial
weiglszonja May 4, 2022
2caa64c
Merge branch 'dev' into docs/add_images_tutorial
weiglszonja May 17, 2022
cd662a4
rearrange tutorial
weiglszonja May 17, 2022
24440e9
add newline at end of file
weiglszonja May 17, 2022
db98a4e
Merge branch 'dev' into docs/add_images_tutorial
bendichter Jul 13, 2022
b6e7ccb
Apply suggestions from code review
weiglszonja Jul 13, 2022
8241383
change unit to n.a.
weiglszonja Jul 13, 2022
c17d451
change image dtype to uint8
weiglszonja Jul 13, 2022
d819f66
fix incorrect import from PIL
weiglszonja Jul 13, 2022
e939e4d
mention expected color channel order in imageseries
weiglszonja Jul 13, 2022
d523176
fix image resolution values to be floats
weiglszonja Jul 13, 2022
14a59dd
add io section
weiglszonja Jul 14, 2022
bda80c2
remove images section from file basics tutorial
weiglszonja Jul 14, 2022
9f521a8
demonstrate external_file mode with ImageSeries
weiglszonja Jul 14, 2022
9a8cab9
demonstrate external_file mode with ImageSeries
weiglszonja Jul 14, 2022
06a7f7a
Merge branch 'dev' into docs/add_images_tutorial
bendichter Jul 14, 2022
ce3e24b
Apply suggestions from code review
weiglszonja Jul 14, 2022
f578ae5
Apply suggestions from code review
weiglszonja Jul 14, 2022
b013721
apply suggestions from code review
weiglszonja Jul 14, 2022
17bb733
Apply suggestions from code review
weiglszonja Jul 15, 2022
78fda5e
Update docs/gallery/domain/images.py
oruebel Jul 15, 2022
52d5aae
add dandiarchive as external link
weiglszonja Jul 15, 2022
ab6ef2a
changes based on code review
weiglszonja Jul 15, 2022
0fefe7f
Merge remote-tracking branch 'origin/docs/add_images_tutorial' into d…
weiglszonja Jul 15, 2022
ee79f52
Update docs/gallery/domain/images.py
weiglszonja Jul 15, 2022
27fbd51
Merge branch 'docs/add_images_tutorial' of github.com:NeurodataWithou…
weiglszonja Jul 15, 2022
40fcdf1
shorten dandi external link
weiglszonja Jul 15, 2022
e158df1
Merge branch 'dev' into docs/add_images_tutorial
bendichter Jul 15, 2022
bf94a9c
flake8
weiglszonja Jul 15, 2022
2c70d43
Apply suggestions from code review
weiglszonja Jul 18, 2022
786c798
extend external files description
weiglszonja Jul 18, 2022
694c39a
flake8
weiglszonja Jul 18, 2022
9b92b50
Merge branch 'dev' into docs/add_images_tutorial
weiglszonja Jul 18, 2022
789ab8a
update CHANGELOG.md
weiglszonja Jul 18, 2022
2a479a5
add thumbnail image
weiglszonja Jul 18, 2022
b44598e
Merge branch 'dev' into docs/add_images_tutorial
oruebel Jul 18, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions docs/gallery/domain/images.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,18 @@
# ^^^^^^^^^^^^^^
#
# External files (e.g. video files of the behaving animal) can be added to the :py:class:`~pynwb.file.NWBFile` by creating
# an :py:class:`~pynwb.image.ImageSeries` object using the ``external_file`` attribute that specifies the
# an :py:class:`~pynwb.image.ImageSeries` object using the :py:attr:`~pynwb.image.ImageSeries.external_file` attribute that specifies the
# path to the external file(s) on disk. The file(s) path must be relative to the path of the NWB file.
# Either ``external_file`` or ``data`` must be specified, but not both.
#
# If the sampling rate is constant, use ``rate`` and ``strating_time`` to specify time.
# For irregularly sampled recordings, use ``timestamps`` to specify time for each sample image.
# If the sampling rate is constant, use :py:attr:`~pynwb.base.TimeSeries.rate` and :py:attr:`~pynwb.base.TimeSeries.starting_time` to specify time.
# For irregularly sampled recordings, use :py:attr:`~pynwb.base.TimeSeries.timestamps` to specify time for each sample image.
#
# Each external image may contain one or more consecutive frames of the full :py:class:`~pynwb.image.ImageSeries`.
# The :py:attr:`~pynwb.image.ImageSeries.starting_frame` attribute serves as an index to indicate which frame
# each file contains.
# For example, if the ``external_file`` dataset has three paths to files and the first and the second file have 2 frames,
# and the third file has 3 frames, then this attribute will have values `[0, 2, 4]`.
oruebel marked this conversation as resolved.
Show resolved Hide resolved

external_file = [
os.path.relpath(movie_path, nwbfile_path) for movie_path in moviefiles_path
Expand All @@ -148,7 +154,7 @@
unit="n.a.",
external_file=external_file,
format="external",
starting_frame=[0],
starting_frame=[0, 2, 4],
timestamps=timestamps,
)

Expand Down