Index Image with BitArray

Is it no longer possible to index an image with a BitArray?

I see the following example on the Images.jl doc page https://github.com/JuliaImages/ImageView.jl:

using ImageView, TestImages, Colors

# Prepare the data
mri = testimage("mri")
mriseg = RGB.(mri)
mriseg[mri .> 0.5] = colorant"red"

But get the following error when I try to replicate it:

MethodError: no method matching setindex_shape_check(::RGB{Normed{UInt8,8}}, ::Int64)
Closest candidates are:
  setindex_shape_check(!Matched::AbstractArray{#s72,1} where #s72, ::Integer) at indices.jl:218
  setindex_shape_check(!Matched::AbstractArray{#s72,1} where #s72, ::Integer, !Matched::Integer) at indices.jl:221
  setindex_shape_check(!Matched::AbstractArray{#s72,2} where #s72, ::Integer, !Matched::Integer) at indices.jl:225
  ...

Stacktrace:
 [1] macro expansion at .\multidimensional.jl:694 [inlined]
 [2] _unsafe_setindex!(::IndexLinear, ::Array{RGB{Normed{UInt8,8}},2}, ::RGB{Normed{UInt8,8}}, ::Base.LogicalIndex{Int64,BitArray{2}}) at .\multidimensional.jl:689
 [3] _setindex! at .\multidimensional.jl:684 [inlined]
 [4] setindex!(::Array{RGB{Normed{UInt8,8}},2}, ::RGB{Normed{UInt8,8}}, ::BitArray{2}) at .\abstractarray.jl:1020
 [5] top-level scope at In[66]:3

Since Julia 0.7, if you want to set an array elementwise, you need to use .=

julia> x = rand(5, 5)
5×5 Array{Float64,2}:
 0.867726   0.790569  0.586163  0.851478  0.51114 
 0.281574   0.619415  0.495319  0.181507  0.908403
 0.0461658  0.435964  0.796173  0.593969  0.208124
 0.434098   0.614399  0.276483  0.47161   0.620724
 0.323744   0.321267  0.483477  0.739554  0.635631

julia> x[x .> 0.5] = 2
ERROR: MethodError: no method matching setindex_shape_check(::Int64, ::Int64)
Closest candidates are:
  setindex_shape_check(::AbstractArray{#s72,1} where #s72, ::Integer) at indices.jl:218
  setindex_shape_check(::AbstractArray{#s72,1} where #s72, ::Integer, ::Integer) at indices.jl:221
  setindex_shape_check(::AbstractArray{#s72,2} where #s72, ::Integer, ::Integer) at indices.jl:225
  ...
Stacktrace:
 [1] macro expansion at ./multidimensional.jl:694 [inlined]
 [2] _unsafe_setindex!(::IndexLinear, ::Array{Float64,2}, ::Int64, ::Base.LogicalIndex{Int64,BitArray{2}}) at ./multidimensional.jl:689
 [3] _setindex! at ./multidimensional.jl:684 [inlined]
 [4] setindex!(::Array{Float64,2}, ::Int64, ::BitArray{2}) at ./abstractarray.jl:1020
 [5] top-level scope at none:0

julia> x[x .> 0.5] .= 2
13-element view(::Array{Float64,1}, [1, 6, 7, 9, 11, 13, 16, 18, 20, 21, 22, 24, 25]) with eltype Float64:
 2.0                                                                                                                                                                                                                                                                                                                                  
 2.0                                                                                                                                                                                                                                                                                                                                  
 2.0                                                                                                                                                                                                                                                                                                                                  
 2.0                                                                                                                                                                                                                                                                                                                                  
 2.0
 2.0
 2.0
 2.0
 2.0
 2.0
 2.0
 2.0
 2.0

julia> x
5×5 Array{Float64,2}:
 2.0        2.0       2.0       2.0       2.0     
 0.281574   2.0       0.495319  0.181507  2.0     
 0.0461658  0.435964  2.0       2.0       0.208124
 0.434098   2.0       0.276483  0.47161   2.0     
 0.323744   0.321267  0.483477  2.0       2.0   

The same thing works in your case:

julia> mriseg[mri .> 0.5] .= colorant"red"

Thank you!