diff --git a/nrrd.py b/nrrd.py
index <HASH>..<HASH> 100644
--- a/nrrd.py
+++ b/nrrd.py
@@ -288,11 +288,12 @@ def read_header(nrrdfile):
 
     it = iter(nrrdfile)
 
-    headerSize += _validate_magic_line(it.next())
+    headerSize += _validate_magic_line(next(it).decode('ascii'))
 
     header = { 'keyvaluepairs': {} }
     for raw_line in it:
         headerSize += len(raw_line)
+        raw_line = raw_line.decode('ascii')
 
         # Trailing whitespace ignored per the NRRD spec
         line = raw_line.rstrip()
Python 3 compatibility

- Decode header as ASCII to work with Python 3 (as is assumed in NRRD format, <URL>)

- next(it) instead of it.next()



Changes work for Python 2 & 3