-
Notifications
You must be signed in to change notification settings - Fork 84
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
Add images tutorial #1470
Conversation
@weiglszonja let's move forward with this. I think the content we already have here is good. It doesn't cover everything yet but let's get this out before the user days to increase our tutorial coverage |
Co-authored-by: Ben Dichter <[email protected]>
Codecov Report
@@ Coverage Diff @@
## dev #1470 +/- ##
=======================================
Coverage 90.52% 90.52%
=======================================
Files 25 25
Lines 2460 2460
Branches 456 456
=======================================
Hits 2227 2227
Misses 148 148
Partials 85 85
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report at Codecov.
|
This content would need to be removed from NWBFile basics |
…tBorders/pynwb into docs/add_images_tutorial
docs/gallery/domain/images.py
Outdated
unit="n.a.", | ||
external_file=external_file, | ||
format="external", | ||
starting_frame=[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.
If you use multiple movie files, I believe you would need a starting_frame value for each file.
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.
I'm not sure how many frames are in each movie file, but assuming "file_1.tiff" and "file_2.tiff" contain 2 frames and "file_2.tiff" contains 3 frames, I believe the correct value for starting_frame should bestarting_frame=[0, 2, 6],
According to the schema of ImageSeries:
Each external image may contain one or more consecutive frames of the full
ImageSeries. This attribute serves as an index to indicate which frames each file
contains, to faciliate random access. The 'starting_frame' attribute, hence,
contains a list of frame numbers within the full ImageSeries of the first frame
of each file listed in the parent 'external_file' dataset. Zero-based indexing is
used (hence, the first element will always be zero). For example, if the
'external_file' dataset has three paths to files and the first file has 5 frames,
the second file has 10 frames, and the third file has 20 frames, then this
attribute will have values [0, 5, 15]. If there is a single external file that
holds all of the frames of the ImageSeries (and so there is a single element in
the 'external_file' dataset), then this attribute should have value [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.
Related to #1318 - if we get an answer on that issue I can close it
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.
@CodyCBakerPhD thanks for pointing us to this issue. I just added a response based on my understanding of the schema. I hope this helps clarify things a bit.
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.
@oruebel thank you for this example! I'll extend the external file section with this description (or a shorter version of it) to make this clear.
Co-authored-by: Oliver Ruebel <[email protected]>
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.
Looks good to me. Thanks for creating this tutorial and for your patients in iterating on edits.
@oruebel I learnt a lot from the suggestions, thank you for them! Now only the thumbnail image is missing, do you have an idea how it should look like? |
That's great! The PowerPoint file with the source of all the other thumbnails is here |
@oruebel how about this? |
Looks great! |
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.
This looks all good to me! Thanks for the hard work!
@oruebel @bendichter thank you for the suggestions! |
Motivation
Create a new tutorial that demonstrates how to use the image module for adding images to an NWB File.
The images tutorial covers the following data types:
pynwb.image.GrayscaleImage
,pynwb.image.RGBImage
,pynwb.image.RGBAImage
pynwb.image.OpticalSeries
pynwb.image.ImageSeries
,pynwb.image.ImageMaskSeries
,pynwb.image.IndexSeries
(which was changed recently)Checklist
flake8
from the source directory.