Closed pauladkisson closed 1 year ago
@CodyCBakerPhD @h-mayorquin @weiglszonja @alessandratrapani Please let me know what you all think!
@pauladkisson Thanks for writing this all up, I'll look deeper and leave more comments over next couple days
BrukerTiff specifies channel during the init but all other IE's specify channel during the call to get_video. Not sure which is better, but we should be consistent.
Strongly against having it in the get_video
call because it leads to the 4D ambiguity; much clearer to have separate objects for each channel if you want to do anything with them side-by-side, which makes it a field specified at __init__
So totally on board with that solution
This will require refactoring of all the existing IE's
Yes and no - their code will have to be changed, but it was also code that was never tested or used perhaps outside of the .sbx
case? Which we've also not seen used in quite a while
It also simplifies get_video to only take start_frame and end_frame, which I think is a good thing.
👍
'streams' are a low-cohesion concept to represent optical channels and depth planes.
Yeah, been talking with @h-mayorquin about this lately. It's purposely ambiguous to also allow any other type of future formatting distinction we might need to add while remainig universal across the API
It's also flatter and simpler, though what it really does is shift the complexity of structure to the string itself, but as long as we have a convenient fetcher get_stream_names
that is less complicated than breaking the approach into separate calls per plane/channel option.
Multiple optic channels found? It shows up as a series of structured strings. Multiple planes found? They show up as another part of the string structure. Want to initialize an extractor? Just specify a single string that matches one of the selections.
Specify channel and plane separately by index (or ID?)
Strongly against the ID/index route. Neo supports both at the same time and the ID is the annoying one, the bane of many a stream index issue. Strongly recommend using a human-readable identifier. Less strongly against splitting stream_name
into channel_name
+ plane_name
if others think that is worth it compared to my 'single argument is simpler' point above
I agree with @pauladkisson that we should break streams. As a note, Streams are not about different types of preprocessing. It is basically stuff that can be processed together in the context of spikeitnerface and raw.io in neo (same sampling_rate, start and duration). The concept is not documented but you can find some details here.
How to break depth, channel and whatever else might come?
PhotonSeries
in pynwb accepts and other related modalities take for granted (e.g. brain imaging). I think is a solid well defined concept so it gets a specification.As for this:
Combining multiple SinglePlaneImagingExtractors with MultiImagingExtractor is a bit hacky and confusing. MultiImagingExtractor was designed to concatenate ImagingExtractors along the frames axis, but here we want to combine multiple IEs along a separate depth axis.
This is not the original intention: https://github.com/catalystneuro/roiextractors/issues/11 But I think it was changed here: https://github.com/catalystneuro/roiextractors/pull/127
I agree that we are conflating a tool to concatenate data extractors in time with some internal machinery to assemble extractors from channels, planes or sub-extractors in time. We came to need the latter because some formats provide multiple files and we judged (corrrectly?) that composing in this way is easier than ad-hoc parsing. I think it makes sense separting assembling in time, channels and depth.
The analgous in spikeinterface are concatenation and channel agregation.
Using MultiImagingExtractor for this purpose leads to wonky stuff like start_frames = [0, 0, ..., 0].
Can you point out to where does this show up and also add other wonky stuff / difficulties? I feel this point should be more descriptive of the existing problems.
I will add something about the third point later.
@h-mayorquin
Using MultiImagingExtractor for this purpose leads to wonky stuff like start_frames = [0, 0, ..., 0].
Can you point out to where does this show up and also add other wonky stuff / difficulties? I feel this point should be more descriptive of the existing problems.
This is from the BrukerTiffMultiPlaneImagingExtractor
which uses MultiImagingExtractor
to concat multiple BrukerTiffSinglePlaneImagingExtractor
over depth
Thanks for the pointer @weiglszonja. I still would like to see more confusions that arise from this use. This is the only case that we have for Paul's second point.
Current Behavior
Right now, the only imaging extractor that supports 3D imaging is BrukerTiff. It does so by taking a list of
SinglePlaneImagingExtractors
and combines them a laMultiImagingExtractor
. Note that eachSinglePlaneImagingExtractor
is itself aMultiImagingExtractor
that combines multiple 'chunked' files corresponding to a single depth plane. EachSinglePlaneImagingExtractor
instance only supports 1 channel and 1 plane, which are passed viastream_name
during the__init__
. EachMultiPlaneImagingExtractor
instance supports 1 channel (but all planes) which is passed viastream_name
during the__init__
.Issues
MultiPlaneImagingExtractor
(which only needs to specify the channel) and theSinglePlaneImagingExtractor
(which needs to specify some formatted combination of channel and plane).SinglePlaneImagingExtractors
withMultiImagingExtractor
is a bit hacky and confusing.MultiImagingExtractor
was designed to concatenateImagingExtractors
along theframes
axis, but here we want to combine multipleIEs
along a separate depth axis.MultiImagingExtractor
for this purpose leads to wonky stuff likestart_frames = [0, 0, ..., 0]
.__init__
but all other IE's specify channel during the call toget_video
.Proposed Solutions
MultiPlaneImagingExtractor
base class to handle the combination of IE's along the depth axis. Could come with extra metadata properties likeget_plane_depth
.__init__
time so that SinglePlaneImagingExtractors can be appropriately combined into MultiPlaneImagingExtractors. So, to keep it consistent we should specify channel also at__init__
time. This will require refactoring of all the existing IE's but I think it is the most convenient implementation agnostic to file structure. It also simplifiesget_video
to only takestart_frame
andend_frame
, which I think is a good thing.Do you have any interest in helping implement the feature?
Yes.
Code of Conduct