-
Notifications
You must be signed in to change notification settings - Fork 5
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
Refactor invertible mapping functions? #32
Comments
Thanks you for your suggestion. Please could you clarify a few more details. Do you have in mind a function adjust_intensity(img, algo::AbstractIntensityMappingAlgorithm) so that one writes things such as: adjust_intensity(img, LinearStretching(...))
adjust_intensity(img, ContrastStretching(...))
adjust_intensity(img, GammaCorrection(...)) In #33 it seems that you want to If I understood you correctly, you want to introduce a standalone function as an alias for span_contrast(img, Percentiles(1, 99)) |
The refactored algos would be dispatched through a top-level But this is a better discussion for #33 - I'm trying to separate the bikesheddy interface design of #33 from the type hierarchy question raised in this issue. |
I think your suggestion of introducing |
Having a convenient method adjust_histogram(img) = adjust_histogram(img, best_algorithm_and_parameter(img)) Moving/re-implementing I'm not rejecting it, but introducing a new name |
I use Images.jl to process quantitative experimental data, and I would rather not have the default option for intensity adjustment be 'best guess!'. The default should be stable and sensible, and if a user is feeling lucky, they should have to choose that explicitly. Imagine a case where the user intensity-adjusts a time series of images, only to find that a different algorithm has been used on each frame! I'm of the opinion that there's no harm in another minor v0.x release to reinforce a solid interface and type hierarchy, since once we hit 1.0, it becomes much more challenging to revise the API. @timholy, thoughts? |
My point about adaptiveness is, if you're too lazy to even choose an algorithm, then by default this package makes a guess for you; if you do care about the algorithm, then write it down explicitly. TBH, I don't really think this is inconvenient in practice. adjust_histogram.(imgs, Ref(LinearStretching())) Said that, I don't have a strong opinion on whether it should be adaptive or fixed(adaptiveness=0). |
I like the idea of renaming to help?> adjust_histogram
search: adjust_histogram adjust_histogram!
adjust_histogram([T::Type,] img, f::AbstractHistogramAdjustmentAlgorithm, args...; kwargs...)
Adjust histogram of img using algorithm f. This summary could confuse naive readers in several ways:
A more approachable one-line summary might be something like "Compute an intensity-adjusted version of |
I've been mentally bikeshedding the linear contrast stretching interface discussed in this thread. I'd planned to just add a few methods to
scaleminmax
in ImageCore, but I think the functionality fits better in this sub-package.I think
adjust_histogram
is a misnomer for the functions within this module that don't involve the construction or adjustment of an image histogram. Looking at scikit-image'sexposure
module, a distinction is made between histogram-based and non-histogram-based intensity adjustment functions. The same is true for Matlab's image processing toolbox.With that in mind, I'd like to propose that the non-histogram-based algorithms be moved to a new category
AbstractIntensityMappingAlgorithm <: AbstractImageFilter
. This would includeLinearStretching
,ConstrastStretching
,GammaCorrection
, and other non-binning, invertible maps.The text was updated successfully, but these errors were encountered: