Skip to content

switching dependency to magick #4

Open
@MahShaaban

Description

@MahShaaban

Summary

As it stands, colocr is functional but switching the main dependency from imager to magick has been proposed ropensci/software-review#243 (comment). The two main changes would include:

  • Changing the S3 cimg/pixset class to the magick-image
  • Applying the morphological operations using image_morphology()

The data structures

I am currently using two S3 classes from imager. These are cimg and pixset. Both are layers over arrays of numeric or logical values. The advantage here is that the two classes can be transformed from one to the other and math operations can be directly applied to them.
magick-image is an externalptr and I think would relace cimg(I am not sure what to do about the pixset, or whether an equivalent would be needed at all). I am having a hard time getting data in and out of magick-image. This certainly needs more work on my part. I wish there were more information in the magick's vignette on how to manipulate the image objects.
These changes will obviously affect all the functions in colocr as which objects they dispatch on, the way the manipulations are done and the return value.

Applying morphological operations

The main functions I use from imager are grow, shrink, fill and clean. In the development version of magick there is image_morphology() which can these operations and more ropensci/software-review#243 (comment). These changes would mainly affect roi_select().

Other

Two other functions I use from imager and still don't see how to replace them are

  • label to label each pixel for the region they belong to
  • highlight to highlight the selected area on the image

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions