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

switching dependency to magick #4

Open
MahShaaban opened this issue Oct 2, 2018 · 0 comments
Open

switching dependency to magick #4

MahShaaban opened this issue Oct 2, 2018 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@MahShaaban
Copy link
Collaborator

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
@MahShaaban MahShaaban added enhancement New feature or request help wanted Extra attention is needed labels Nov 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant