You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This creates an abstract `AbstractColorChannels` type and two types,
`ColorChannels` and `ColorMixture`. `ColorChannels` is a "bare"
multichannel color that lacks conversion to other color types;
it is intended to be used in conjunction with MappedArrays if one
wishes to visualize these as RGB images. `ColorMixture` is the
weighted-RGB color type.
This package defines [color types](https://github.com/JuliaGraphics/ColorTypes.jl) for use with multichannel fluorescence imaging. Briefly, you can specify the intensity of each color channel plus an RGB value associated with the peak emission
7
7
wavelength of each fluorophore.
@@ -11,7 +11,7 @@ wavelength of each fluorophore.
11
11
Perhaps the easiest way to learn the package is by example. Suppose we are imaging two fluorophores, EGFP and tdTomato.
Compat.@constprop:aggressiveColorMixture{T}(Cs::NTuple{N,AbstractRGB}, channels::NTuple{N,Real}) where {T,N} =ColorMixture{T,N,RGB{N0f8}.(Cs)}(channels)
61
126
Compat.@constprop:aggressiveColorMixture{T}(Cs::NTuple{N,AbstractRGB}, channels::Vararg{Real,N}) where {T,N} =ColorMixture{T}(Cs, channels)
62
127
128
+
Compat.@constprop:aggressiveColorMixture(Cs::NTuple{N,AbstractRGB}, channels::NTuple{N,Integer}) where {N} =ColorMixture{N0f8}(Cs, channels)
63
129
Compat.@constprop:aggressiveColorMixture(Cs::NTuple{N,AbstractRGB}, channels::NTuple{N,Real}) where {N} =ColorMixture{eltype(map(z -> zero(N0f8)*z, channels))}(Cs, channels)
64
130
Compat.@constprop:aggressiveColorMixture(Cs::NTuple{N,AbstractRGB}, channels::Vararg{Real,N}) where {N} =ColorMixture(Cs, channels)
65
131
@@ -74,37 +140,27 @@ Create a ColorMixture `c` from a "template" `cobj`. `c` will be the same type as
74
140
is known. In conjunction with a [function barrier](https://docs.julialang.org/en/v1/manual/performance-tips/#kernel-functions),
75
141
this form can be used to circumvent performance problems due to poor inferrability.
76
142
"""
77
-
ColorMixture{T}(Cs::NTuple{N,AbstractRGB}) where {T,N} =ColorMixture{T}(Cs, ntuple(_ ->zero(T), N))
143
+
ColorMixture{T}(Cs::NTuple{N,AbstractRGB}) where {T<:Number,N} =ColorMixture{T}(Cs, ntuple(_ ->zero(T), N))
78
144
ColorMixture(Cs::NTuple{N,RGB{N0f8}}) where {N} =ColorMixture{N0f8}(Cs)
79
145
80
146
(::ColorMixture{T,N,Cs})(channels::NTuple{N,Real}) where {T,N,Cs} =ColorMixture{T,N,Cs}(channels)
81
147
(::ColorMixture{T,N,Cs})(channels::Vararg{Real,N}) where {T,N,Cs} =ColorMixture{T,N,Cs}(channels)
82
148
83
149
84
-
Base.:(==)(a::ColorMixture{Ta,N,Cs}, b::ColorMixture{Tb,N,Cs}) where {Ta,Tb,N,Cs} = a.channels == b.channels
150
+
Base.:(==)(a::ColorMixture{Ta,N,Cs}, b::ColorMixture{Tb,N,Cs}) where {Ta<:Number,Tb<:Number,N,Cs} = a.channels == b.channels
0 commit comments