392 label and select distinct rois#406
Conversation
|
@JulietteFrancovich I changed the base to merge to to develop. |
psomhorst
left a comment
There was a problem hiding this comment.
I think the general design of this class is good. I think the structure is good. It has a separate function to do validation/conversion work in init. It splits setup and application.
The documentation is a bit minimal. Especially around the structure it could use more information. Also, it's not really explained what the selector does: selecting regions based on size.
The class should be a dataclass with some extra requirements.
The tests cover most use cases. I have some small suggestions to improve especially the readability.
There was a problem hiding this comment.
Thanks for the improvements!
I have some more suggestions. Some of those are about how the docstrings render in the documentation. I pushed a single commit adding the class to the documentation. I added a footnote about rendering the docs locally to one of the comments.
The module name feels a bit clunky. from eitprocessing.roi.roi_size_filter import FilterROIBySize has too many ROIs in it.
Maybe eitprocessing.roi.size_filter or eitprocessing.roi.filter_by_size?
8c2503e to
9736a46
Compare
psomhorst
left a comment
There was a problem hiding this comment.
This looks great! I have a few more comments, but you can go ahead and merge if you think it's done.
I added a commit allowing PixelMaskCollection() without arguments. I think that is much cleaner than PixelMaskCollection({}).
I also added a commit to prevent a warning when comparing all-nan arrays with values.
PS: GitHub rebased the branch after develop was updated. You then merged that branch into your own. That results in many duplicated commits in the history. It is better to run "Pull (Rebase)" in VSCode or rebase locally and then force-push instead of rebasing on GitHub.
Co-authored-by: Peter Somhorst <127968566+psomhorst@users.noreply.github.com>
Co-authored-by: Peter Somhorst <127968566+psomhorst@users.noreply.github.com>
Co-authored-by: Peter Somhorst <127968566+psomhorst@users.noreply.github.com>
58129a9 to
eab1993
Compare
Created a class to label and select distinct ROIs based on a minimum pixel size and connectivity.
The class now returns a PixelMask that uses .combine from PixelMaskCollection. An alternative could be to return the PixelMaskCollection and use .combine afterwards. What do you think?