JuliaIO / NRRD.jl

Julia support for the Nearly Raw Raster Data (NRRD) image file format
Other
10 stars 9 forks source link

Fix division by zero error when a dim is size 1 #49

Open kamesy opened 11 months ago

kamesy commented 11 months ago

When one of the sizes in the header is 1, startstoplen divides by 0. An example header:

...
dimension: 4
space: right-anterior-superior
sizes: 64 128 128 1
space directions: none (-0.12,0,0) (0,0,0.12) (0,0.12,0)
kinds: list domain domain domain
...

I ended up replacing startstep/startstop altogether in favour of Base.range.

codecov[bot] commented 11 months ago

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (9578df7) 86.64% compared to head (d0e837f) 85.85%. Report is 1 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #49 +/- ## ========================================== - Coverage 86.64% 85.85% -0.80% ========================================== Files 1 1 Lines 644 608 -36 ========================================== - Hits 558 522 -36 Misses 86 86 ``` | [Files](https://app.codecov.io/gh/JuliaIO/NRRD.jl/pull/49?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=JuliaIO) | Coverage Δ | | |---|---|---| | [src/NRRD.jl](https://app.codecov.io/gh/JuliaIO/NRRD.jl/pull/49?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=JuliaIO#diff-c3JjL05SUkQuamw=) | `85.85% <94.33%> (-0.80%)` | :arrow_down: |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.