-
Notifications
You must be signed in to change notification settings - Fork 7
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
Refactor Miniscope Extractor Naming #374
Merged
Merged
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
daf62dc
rename legacy extractor
h-mayorquin 9e9dfcf
Merge branch 'main' into new_miniscope_interface
weiglszonja d4bc98d
docstring and name correction
h-mayorquin f6ec161
name change on init
h-mayorquin bdd857e
Merge branch 'main' into new_miniscope_interface
weiglszonja c194d02
changelog
h-mayorquin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -18,14 +18,14 @@ | |||||
from ...extraction_tools import PathType, DtypeType, get_package | ||||||
|
||||||
|
||||||
class MiniscopeImagingExtractor(MultiImagingExtractor): # TODO: rename to MiniscopeMultiImagingExtractor | ||||||
class MiniscopeMultiSegmentExtractor(MultiImagingExtractor): | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
"""An ImagingExtractor for the Miniscope video (.avi) format. | ||||||
|
||||||
This format consists of video (.avi) file(s) and configuration files (.json). | ||||||
One _MiniscopeImagingExtractor is created for each video file and then combined into the MiniscopeImagingExtractor. | ||||||
One _MiniscopeSingleVideoExtractor is created for each video file and then combined into the MiniscopeImagingExtractor. | ||||||
""" | ||||||
|
||||||
extractor_name = "MiniscopeImaging" | ||||||
extractor_name = "MiniscopeMultiImaging" | ||||||
is_writable = True | ||||||
mode = "folder" | ||||||
|
||||||
|
@@ -58,24 +58,28 @@ def __init__(self, folder_path: PathType): | |||||
|
||||||
imaging_extractors = [] | ||||||
for file_path in miniscope_avi_file_paths: | ||||||
extractor = _MiniscopeImagingExtractor(file_path=file_path) | ||||||
extractor = _MiniscopeSingleVideoExtractor(file_path=file_path) | ||||||
extractor._sampling_frequency = self._sampling_frequency | ||||||
imaging_extractors.append(extractor) | ||||||
|
||||||
super().__init__(imaging_extractors=imaging_extractors) | ||||||
|
||||||
|
||||||
class _MiniscopeImagingExtractor(ImagingExtractor): | ||||||
"""An ImagingExtractor for the Miniscope video (.avi) format. | ||||||
# Temporal renaming to keep backwards compatibility | ||||||
h-mayorquin marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
MiniscopeImagingExtractor = MiniscopeMultiSegmentExtractor | ||||||
h-mayorquin marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
||||||
|
||||||
class _MiniscopeSingleVideoExtractor(ImagingExtractor): | ||||||
"""An auxiliar extractor to get data from a single Miniscope video (.avi) file. | ||||||
|
||||||
This format consists of a single video (.avi) file and configuration file (.json). | ||||||
Multiple _MiniscopeImagingExtractor are combined into the MiniscopeImagingExtractor for public access. | ||||||
This format consists of a single video (.avi) | ||||||
Multiple _MiniscopeSingleVideoExtractor are combined into the MiniscopeImagingExtractor for public access. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
""" | ||||||
|
||||||
extractor_name = "_MiniscopeImaging" | ||||||
extractor_name = "_MiniscopeSingleVideo" | ||||||
|
||||||
def __init__(self, file_path: PathType): | ||||||
"""Create a _MiniscopeImagingExtractor instance from a file path. | ||||||
"""Create a _MiniscopeSingleVideoExtractor instance from a file path. | ||||||
|
||||||
Parameters | ||||||
---------- | ||||||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Is this a typo? This is still an imaging extractor and not a segmentation right?
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.
[EDIT]
Sorry, no, it was nos a typo.
I am thinking on the concept of multi segment in spikeinterface when a session of the same data is divided with possible gaps in between. That said, it is missing the imaging word on 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.
@weiglszonja thanks for pointing this out. Now that I think about it, MultiSegment is also a bad name because in Spikeinterface multi-segment recordings do not extract the different recordings within the session as a single continuous recording. I settled for
MiniscopeMultiRecordingImagingExtractor
to avoid this possible confusion.Can you take a look at the new naming and the new docstrings to see if it makes sense?