Image loading - #17
Conversation
|
Below one single run of bg_subtractor_mog2_h500_v16_heatmap grandqc_tissue_detection_mpp10_heatmap |
|
I probably broke some other examples other than |
|
I validated the workflow of adding a new algorithm. With this setup requires only a few lines and some import statements here and there. https://github.com/RTLucassen/slidesegmenter The model itself has a shift issue though, I don't think there's something we can do about it. EDIT: well, maybe we can do something about it. It looks like it is more so a scaling issue. But haven't seen it with other algorithms. I can open an issue for that later. |
this actually highlights a bug. With the |
















fixes #3 #20
This PR changes the way the framework loads images. Images are loaded as part of the algorithm. The image loading strategy can be shared across multiple algorithms, but algorithms are not required to use it. An algorithm should adhere to the
BaseSegmenterProtocol, but algorithms can use a predefined abstract base class if they require a numpy array (NumpySegmenter) or simply a path (PathSegmenter).NumpySegmenters need to be initialized with mpp (among other things). This loads the image at that exact mpp. This relies on an unreleased PR to MONAI. The exact current commit sha that currently implements it is added to the dependencies. Ideally, this should be addressed later once Project-MONAI/MONAI#7574 is merged. Choosing specific mpp allows to better finetune the ideal hyperparameters for the algorithms and to circumvent the issue where images can different resolutions at level 0. Of course users can pick an mpp that is already in the pyramid, then no interpolation will be performed.Segmenter.segment()requires to input aPathand output ageojson.FeatureCollection. This allows for multiple things:Any issues with the environment are now fixed, albeit somewhat unsafe via
uv sync --all-extrasis able to solve the environment with this change. Especially useful for thelarge_imagedependency ofhistomicstk.