Closed h-mayorquin closed 4 months ago
@rly what do you think? Should we allow for now roi mask? @h-mayorquin has a use-case where no segmentation was done.
@h-mayorquin Could you describe the use case further? I don't totally see the use of adding an ROI without any image mask, pixel mask, or voxel mask. Is the ROI defined using custom columns? Third-party tools already have to fork their behavior based on whether an image, pixel, or voxel mask is provided. So, if the ROI is defined in some other way using custom columns, I think it would probably be fine to amend the schema and API to allow none of those datasets to be defined.
@h-mayorquin Could you describe the use case further? I don't totally see the use of adding an ROI without any image mask, pixel mask, or voxel mask.
It's an edge case where a single 'ROI' is defined by the experimenter and is essentially an image_mask
that is equal to an array of equal weight at every pixel
I.e., the related RoiResponseSeries
is simply the summed activity of all the pixels in the TwoPhotonSeries
over time
I see - so the ROI is the entire image. I think that should be explicitly defined, and it is OK to have an image_mask
with an array of equal weight at every pixel. Alternatively, we could:
image_mask
, pixel_mask
, or voxel_mask
are provided, then the ROI is the entire image"entire_image"
to the table (or just to the method PlaneSegmentation.add_roi
) that signals that the ROI is the entire imageI think that should be explicitly defined, and it is OK to have an image_mask
I'm perfectly fine with this, too. It'll maintain compatibility with other more standard interpretations without adding any special conditions (this seems like a fairly rare case)
I think that should be explicitly defined, and it is OK to have an
image_mask
with an array of equal weight at every pixel
I agree. I like that this is a very explicit solution and maintains compatibility without introducing special cases.
I think this was resolved in discussion here but please re-open if not.
The following code does not throw an error:
But the following does:
Trace:
My understanding is that the first block of code should also thrown an error. Something else to do here is to add clear documentation to
add_roi
to indicate that at least one of 'image_mask', 'pixel_mask' or 'voxel_mask' is to be stored: https://pynwb.readthedocs.io/en/stable/pynwb.ophys.html#pynwb.ophys.PlaneSegmentation.add_roi