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

[Feature]: Add new.processing.ImageSementation.PlaneSegmentation remove feature (function) #1798

Open
3 tasks done
amine789 opened this issue Dec 11, 2023 · 1 comment
Open
3 tasks done
Assignees
Labels
category: enhancement improvements of code or code behavior priority: low alternative solution already working and/or relevant to only specific user(s)

Comments

@amine789
Copy link

What would you like to see added to PyNWB?

Hi i want to ask you to add a feature to remove PlaneSegmentations object, or any other objects without having to remove all the ImagePlane

Is your feature request related to a problem?

No it can be used across all objects

What solution would you like?

i want to have a pop method that delete an PlaneSegmentation object or any other object within same scope

Do you have any interest in helping implement the feature?

Yes.

Code of Conduct

@amine789 amine789 changed the title [Feature]: remove new.processing.ImageSementation.PlaneSegmentation [Feature]: Add new.processing.ImageSementation.PlaneSegmentation remove feature (function) Dec 11, 2023
@rly rly added category: enhancement improvements of code or code behavior priority: low alternative solution already working and/or relevant to only specific user(s) labels Dec 14, 2023
@rly rly self-assigned this Dec 14, 2023
@rly
Copy link
Contributor

rly commented Dec 14, 2023

Hi @amine789 if I understand your request correctly, you should already be able to do this:

Let's say you already have an NWBFile object with an ImagingPlane and you have an ImageSegmentation object called img_seg that contains a PlaneSegmentation object with name "PS". You can run the following:

img_seg.plane_segmentations.pop("PS")

The ImagingPlane remains in the file, but the PlaneSegmentation has been removed.

Here is a demonstration of that, following the ophys tutorial https://gist.github.com/rly/43f67f86c4bb3145efc785c01074bf1d

Let me know if that solves your issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: enhancement improvements of code or code behavior priority: low alternative solution already working and/or relevant to only specific user(s)
Projects
None yet
Development

No branches or pull requests

2 participants