kharchenkolab / Baysor

Bayesian Segmentation of Spatial Transcriptomics Data
MIT License
142 stars 29 forks source link

Loading binary image sementation mask as prior: MethodError: no method matching sparse #119

Open Sengels24 opened 2 months ago

Sengels24 commented 2 months ago

Hi,

First of all, thanks for making Baysor, its amazing! Baysor works for me without prior segmentation, but when I add a binary image with a segmentation mask (Black background, cell segmentation = red) as a prior (in tif. format), I get the following error:

Info: Excluding genes: Info: Loaded 8329256 transcripts Info: Loading segmentation mask... ERROR: LoadError: MethodError: no method matching sparse(::MappedArrays.MappedArray{UInt8, 3, Base.ReinterpretArray{FixedPointNumbers.N0f8, 3, ColorTypes.RGBA{FixedPointNumbers.N0f8}, Matrix{ColorTypes.RGBA{FixedPointNumbers.N0f8}}, true}, typeof(reinterpret), ImageCore.var"#39#40"{FixedPointNumbers.N0f8}})

Closest candidates are: sparse(::Any, !Matched::Any, !Matched::Number, !Matched::Any, !Matched::Any, !Matched::Function) @ SparseArrays ~/.julia/juliaup/julia-1.10.2+0.x64.linux.gnu/share/julia/stdlib/v1.10/SparseArrays/src/sparsematrix.jl:1322 sparse(::Any, !Matched::Any, !Matched::AbstractVector{Bool}, !Matched::Any, !Matched::Any) @ SparseArrays ~/.julia/juliaup/julia-1.10.2+0.x64.linux.gnu/share/julia/stdlib/v1.10/SparseArrays/src/sparsematrix.jl:1320 sparse(::Any, !Matched::Any, !Matched::AbstractVector, !Matched::Any, !Matched::Any) @ SparseArrays ~/.julia/juliaup/julia-1.10.2+0.x64.linux.gnu/share/julia/stdlib/v1.10/SparseArrays/src/sparsematrix.jl:1318`

It seems like there is no method matching sparse. Did u encounter this issue before?

Many thanks :)

saito-k1 commented 1 month ago

I'm having the same issue when I add a tif file as my prior segmentation. Were you able to find a workaround?