• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

nipy / nibabel / 30 / 4
93%
master: 93%

Build:
DEFAULT BRANCH: master
Ran 09 Dec 2013 05:10PM UTC
Files 128
Run time –
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

09 Dec 2013 05:06PM UTC coverage: 90.308% (+0.09%) from 90.222%
COVERAGE=--with-coverage

push

travis-ci

matthew-brett
Merge pull request #213 from matthew-brett/zero-offset-on-load

MRG: reset file offset to zero creating image

This is a minor API break.

Before this PR, you would read an image, and the header would contain the data
offset value. For single file images, the data offset would typically point to
the end of the header, but it's also possible to have data at the beginning of
a file that is not part of the image. So the 'offset' field would be non-zero -
say 400.

When using this header to write out an image, or initialize a new image, the
offset field gets maintained - so the newly written image, and any image based
on the same header, also have an offset of e.g. 400.

This doesn't make much sense usually - because - if we save images to
filenames, we open 'wb' and write the whole file, so even if an existing output
image file had something interesting from 0-400, it would get overwritten with
zeros in the default write process.

The only time this doesn't happen is if you open the file object in append mode
and pass that into the image creation - but this is obviously rather rare.

This PR sets the offset to 0 in the header each time we create a new image or
load an image. The 0 signifies 'modify at will' to the code. The writing code
then sets the offset to whatever value is necessary.

If you really want to set the offset to a specific value, you can do that by
hand with:

img.header.set_data_offset(400)

in which case the writing code uses that offset, or raises an error if the
offset is too low.

This PR addresses : #105

13716 of 15188 relevant lines covered (90.31%)

0.9 hits per line

Source Files on job 30.4 (COVERAGE=--with-coverage)
  • Tree
  • List 0
  • Changed 6
  • Source Changed 6
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 30
  • Travis Job 30.4
  • d9482eeb on github
  • Prev Job for COVERAGE=--with-coverage on master (#28.4)
  • Next Job for COVERAGE=--with-coverage on master (#34.4)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc