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

Update neo structure #1026

Closed
wants to merge 9 commits into from

Conversation

JuliaSprenger
Copy link
Member

This PR is a suggestion on how to update the neo object linking to include RegionsOfInterest and ChannelView in a consistent manner.
Currently, Groups accept also Segments as child objects, which I think is confounding the neo structure. Also RegionOfInterest was not considered as part of a neo structure yet. Since these are supposed to basically fulfill a masking functionality for ImageSequence their functionality is very similar to the one of ChannelViews for Signals. So my suggestion is to have Group and Segment at the same level and RegionOfInterest as well as ChannelView as optional level before linking to data object. This results in the following neo dependencies:
https://github.com/JuliaSprenger/python-neo/raw/fix/1024/doc/source/images/simple_generated_diagram.png

This PR also updates the corresponding neo structure diagram (as well as generation script).

@samuelgarcia @apdavison What do you think of this?

Fixes #1024

@pep8speaks
Copy link

pep8speaks commented Sep 3, 2021

Hello @JuliaSprenger! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2022-05-13 11:18:49 UTC

@JuliaSprenger
Copy link
Member Author

The failing test is already fixed in #1025

@samuelgarcia
Copy link
Contributor

Hi Julia.

Thank you for updating the new diagram.

About the hierachy place for RegionOfInterest I don't known what to say.
I don't have in mind totally the goal for this.
Today in calcium Imaging a ROIs can be

  • "some zone I want to anaylse" in that case the hierachy is OK for me.
  • "some neuron that have been detected by an algo" : in that case the number of neuron can be enormous
    and dealing then as a list of element is a bad choice from the begining. (like we did from spiketrain instead of
    spiketrainlist). In that case we should a RegionOfInterestList I think.

I let @apdavison check this new RegionOfInterest place in the tree.

@JuliaSprenger
Copy link
Member Author

I think it would be good to discuss the missing links and pieces in the Neo structure rather sooner than later. @apdavison What is your opinion on the suggestions here? Do you have an alternative organization in mind?

@JuliaSprenger
Copy link
Member Author

JuliaSprenger commented Mar 31, 2022

Here's a summary of the last discussion with @samuelgarcia @apdavison and @mdenker on this topic

  • there is no consensus on whether Groups should permit Segments as child objects. The strongest argument so far is to keep the object structure as little convoluted as possible for discovery/export/import purposes. Therefore I suggest keeping the current version in which Groups only can contain other Groups, DataObjects or masks of data objects (RegionOfInterest, ChannelView).
  • Another important point to be added (in another PR) would be the (optional) automatic linking of Spiketrains and Analogsignal traces upon loading. This link will not be explicitly saved when the block exported, but is on request generated when a block is loaded. We still need to decide on what criteria need to be fulfilled for a link to be generated. Is an identical channel_index annotation sufficient?
    Extension: Channel_index should be a 2-dim sparse matrix linking a SpikeTrainList with traces of an Analogsignal

- do not accept segments as child objects, but accept regionsofinterest
- expand base class RegionOfInterest
- add ImageSequence and RegionOfInterest
- remove outdated fake_neo reference
- take into account if necessary attributes contain references to neo objects
- shorted lines if too long for text box
@apdavison apdavison modified the milestones: 0.10.3, 0.11.0 Aug 30, 2022
@apdavison apdavison modified the milestones: 0.11.0, 0.12.0 Sep 29, 2022
@JuliaSprenger JuliaSprenger modified the milestones: 0.12.0, 0.12.1 Apr 2, 2023
@JuliaSprenger JuliaSprenger modified the milestones: 0.12.1, 0.13.0 Apr 2, 2023


class RegionOfInterest:
class RegionOfInterest(Container):
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be BaseNeo

from .basesignal import BaseSignal
from .dataobject import ArrayDict


class ChannelView(BaseNeo):
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to be reverted or inherit from a BaseView class

@apdavison
Copy link
Member

apdavison commented Jul 27, 2023

This PR is doing a lot of things. I think we should break it up into several PRs, then we can discuss each of them separately.

  1. make the handling of RegionOfInterest subclasses consistent with ChannelView #1313
  2. do not allow Groups to contain Segments #1314

I'll follow up with PRs to:

  • fix the figure generation script
  • remove old documentation

@alejoe91
Copy link
Contributor

@apdavison can we clos this in favor of #1313 and #1314 ?

@apdavison
Copy link
Member

@alejoe91 we're still missing a PR to fix the figure generation script (the one which shows the Neo object relationship diagram). (That would need #1313 to be merged first.) I'd prefer to keep this PR open until we have either a PR or an issue for the figure generation, in case it gets forgotten.

@apdavison
Copy link
Member

#1384 fixes the figure generation script, and is the final PR needed to replace this one.

@apdavison apdavison closed this Jan 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

remaining fake_neo reference
5 participants