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

Map multiple functions to images in ImageGrid #236

Merged
merged 14 commits into from
Jul 22, 2021
Merged

Conversation

SarthakJariwala
Copy link
Owner

@SarthakJariwala SarthakJariwala commented Jul 20, 2021

ImageGrid gains the ability to map multiple functions to the input image/s. Overall, there are 4 use cases :

  • List of map_func mapped to a List of 2D images
g = isns.ImageGrid([img1, img2, img3], map_func=[f1, f2, f3])
  • List of map_func applied to a single 2D image
g = isns.ImageGrid(img_2d, map_func=[f1, f2, f3])
  • Single map_func applied to a list of 2D images
g = isns.ImageGrid([img1, img2, img3], map_func=f3)
  • Single map_func applied to a 3D image
g = isns.ImageGrid(img_3d, map_func=f1)

Parameters for individual functions can also be passed as a Dict or List of Dicts to map_func_kw parameter in ImageGrid

For eg -

from skimage.filters import gaussian, hessian, median

g = isns.ImageGrid(
    [img1, img2],
    map_func=[gaussian, median, hessian],
    map_func_kw=[{"sigma" : 2}, None, {"mode" : "reflect"}]
)

This PR also adds a new dataset retina-gray for documentation purposes.

retina = isns.load_image("retina-gray")

@SarthakJariwala SarthakJariwala added the enhancement New feature or request label Jul 20, 2021
@SarthakJariwala SarthakJariwala added this to the v0.5 milestone Jul 20, 2021
@codecov-commenter
Copy link

codecov-commenter commented Jul 21, 2021

Codecov Report

Merging #236 (ee73cc8) into master (787122f) will increase coverage by 1.65%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #236      +/-   ##
==========================================
+ Coverage   95.24%   96.89%   +1.65%     
==========================================
  Files           9        9              
  Lines         715      773      +58     
  Branches      171      202      +31     
==========================================
+ Hits          681      749      +68     
+ Misses         17       11       -6     
+ Partials       17       13       -4     
Impacted Files Coverage Δ
src/seaborn_image/_datasets.py 100.00% <100.00%> (ø)
src/seaborn_image/_grid.py 98.52% <100.00%> (+3.83%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 787122f...ee73cc8. Read the comment docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants