Skip to content

Commit

Permalink
Merge pull request #7 from Cody-G/cjg/fix_dz
Browse files Browse the repository at this point in the history
Fixed error in calculation of pixel spacing of the z axis: Because Im…
  • Loading branch information
timholy authored Mar 13, 2017
2 parents 2e953ef + 302cac4 commit b9e17be
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/ImagineFormat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function load(io::Stream{format"Imagine"}; mode="r")
pstart = h["piezo"]["stop position"]
pstop = h["piezo"]["start position"]
if length(sz)>2
dz = abs(pstart - pstop)/sz[3]
dz = abs(pstart - pstop)/(sz[3]-1)
else dz = 0.0 end

axisnames = havez ? (:x, :l, :z) : (:x, :l)
Expand Down
2 changes: 1 addition & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ img = load("test.imagine")
@test timedim(img) == 4
@test axisnames(img) == (:x, :l, :z, :time)
@test pixelspacing(img)[1:2] == (0.71μm, 0.71μm)
@test pixelspacing(img)[3] (2/3)*100μm
@test pixelspacing(img)[3] 100μm

bn = joinpath(tempdir(), randstring())
ifn = string(bn, ".imagine")
Expand Down

0 comments on commit b9e17be

Please sign in to comment.