-
Notifications
You must be signed in to change notification settings - Fork 143
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
Problem in saving Array{Float16, 3} into Tiff #1057
Comments
Did you do the following?
Basically we're expecting all your floating point values to be between 0 and 1. |
I did, the transformed image julia> size(img), typeof(img)
((512, 512, 100), Array{UInt16, 3})
julia> unique(img)
96-element Vector{Int64}:
1791
1983
⋮
7039
6975
julia> img2 = Float16.(img); typeof(img2)
Array{Float16, 3}
julia> unique(img2)
96-element Vector{Float16}:
1.791e3
1.983e3
⋮
7.04e3
6.976e3
julia> img3 = map(clamp01, img2); unique(img3)
1-element Vector{Float16}:
1.0
julia> img3 = map(clamp01nan, img2); unique(img3)
1-element Vector{Float16}:
1.0
julia> img3 = clamp01nan.(img2); unique(img3)
1-element Vector{Float16}:
1.0
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
I have original 4D data
typeof(data) = Array{UInt16, 3}
,size(data) = (512, 512, 5, 100)
.I reshape, permute to
(512, 512, 100, 5)
and take as 3Dimg = data[:, :, :, 1]
,size(img) = (512, 512, 100)
.It is ok if I directly save this Array{UInt16, 3} as tiff
FileIO.save("img.tif", img)
But if I convert it into floating point
img = Float16.(img)
,typeof(img) = Array{Float16, 3}
and try to saveFileIO.save("img.tif", img)
.Here the problem and error come,
I tried
map(clamp01nan, img)
,FileIO.save("img.tif", img)
again, and got same error.but there is no problem to save random data
img= rand(Float16, 512, 512, 100);
.what can I do?
thanks in advacne.
The text was updated successfully, but these errors were encountered: