Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/ImagineFormat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,9 @@ 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]-1)
else dz = 0.0 end
#Setting dz to something > 0.0 prevents an error when creating an AxisArray with a zero step
dz = (pstart == pstop) ? 1.0 : abs(pstart - pstop)/(sz[3]-1)
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I failed to notice this.

Should we also check that sz[3] == 1? In such cases would it be better to return a space × space × time array?

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also see fcda3d2

end

axisnames = havez ? (:x, :l, :z) : (:x, :l)
pixelspacing = havez ? (um_per_pixel, um_per_pixel, dz) : (um_per_pixel, um_per_pixel)
Expand Down