File tree Expand file tree Collapse file tree 2 files changed +6
-9
lines changed Expand file tree Collapse file tree 2 files changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -269,7 +269,6 @@ class MincHeader(Header):
269
269
"""
270
270
# We don't use the data layout - this just in case we do later
271
271
data_layout = 'C'
272
- sizeof_hdr = 4
273
272
274
273
def data_to_fileobj (self , data , fileobj , rescale = True ):
275
274
""" See Header class for an implementation we can't use """
@@ -283,11 +282,10 @@ def data_from_fileobj(self, fileobj):
283
282
class Minc1Header (MincHeader ):
284
283
@classmethod
285
284
def may_contain_header (klass , binaryblock ):
286
- if len (binaryblock ) < klass .sizeof_hdr :
287
- raise ValueError ('Must pass a binary block >= %d bytes' %
288
- klass .sizeof_hdr )
285
+ if len (binaryblock ) < 4 :
286
+ raise ValueError ('Must pass a binary block >= 4 bytes' )
289
287
290
- return binaryblock [:klass . sizeof_hdr ] == b'CDF\x01 '
288
+ return binaryblock [:4 ] == b'CDF\x01 '
291
289
292
290
293
291
class Minc1Image (SpatialImage ):
Original file line number Diff line number Diff line change @@ -137,11 +137,10 @@ def get_scaled_data(self, sliceobj=()):
137
137
class Minc2Header (MincHeader ):
138
138
@classmethod
139
139
def may_contain_header (klass , binaryblock ):
140
- if len (binaryblock ) < klass .sizeof_hdr :
141
- raise ValueError ('Must pass a binary block >= %d bytes' %
142
- klass .sizeof_hdr )
140
+ if len (binaryblock ) < 4 :
141
+ raise ValueError ('Must pass a binary block >= 4 bytes' )
143
142
144
- return binaryblock [:klass . sizeof_hdr ] == b'\211 HDF'
143
+ return binaryblock [:4 ] == b'\211 HDF'
145
144
146
145
147
146
class Minc2Image (Minc1Image ):
You can’t perform that action at this time.
0 commit comments