korbinian90 / ROMEO

Executables for ROMEO unwrapping for Linux, Windows and Mac OSX
40 stars 0 forks source link

AssertionError() #2

Closed idevicente closed 4 years ago

idevicente commented 4 years ago

Hello @korbinian90, First of all, I would like to acknowledge the amazing unwrapping tool you guys developed!

I was trying to use it in some single-echo fMRI data that I need to analyze. However, I appear to get an error when using it with a binary mask file. It works fine without a mask or with the "robustmask" option. Do you have any idea why does the error arise?

Thank you very much! Cheers. Iñigo

Here is the code I used: romeo -m magnitude.nii -o unwrapped.nii -k mask_file.nii phase.nii And here is the error I get: ERROR: AssertionError: Unwrap-weights are all zero! Stacktrace: [1] unwrap!(::SubArray{Float32,3,Array{Float32,4},Tuple{Base.Slice{Base.OneTo{Int64}},Base.Slice{Base.OneTo{Int64}},Base.Slice{Base.OneTo{Int64}},Int64},true}; weights::Symbol, keyargs::Base.Iterators.Pairs{Symbol,AbstractArray,NTuple{4,Symbol},NamedTuple{(:TEs, :phase2, :mag, :mask),Tuple{Array{Int64,1},Array{Float32,3},Array{Int16,3},BitArray{3}}}}) at /home/korbinian90/.julia/dev/ROMEO/src/unwrapping.jl:5 [2] unwrap!(::Array{Float32,4}; TEs::UnitRange{Int64}, template::Int64, p2ref::Int64, keyargs::Base.Iterators.Pairs{Symbol,Any,Tuple{Symbol,Symbol,Symbol},NamedTuple{(:weights, :mag, :mask),Tuple{Symbol,SubArray{Int16,4,Array{Int16,4},Tuple{Base.Slice{Base.OneTo{Int64}},Base.Slice{Base.OneTo{Int64}},Base.Slice{Base.OneTo{Int64}},UnitRange{Int64}},true},BitArray{3}}}}) at /home/korbinian90/.julia/dev/ROMEO/src/unwrapping.jl:55 [3] unwrapping_main(::Array{String,1}) at /home/korbinian90/.julia/dev/RomeoApp/src/caller.jl:76 [4] julia_main() at /home/korbinian90/.julia/dev/RomeoApp/src/RomeoApp.jl:14 [5] julia_main() at ./none:29

korbinian90 commented 4 years ago

Great that you like the unwrapping tool and thanks for reporting the problem!

I found the problem in the JuliaIO/NIfTI.jl package and fixed it. I uploaded a new release v2.0.1 of ROMEO.

Details: The support for binary datatype was not implemented in the NIfTI.jl package. I added the binary type to the package and recompiled ROMEO. I also created a pull request for NIfTI.jl to include the changes.

idevicente commented 4 years ago

Alright! Glad to hear that

Thanks!