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):
269269 """
270270 # We don't use the data layout - this just in case we do later
271271 data_layout = 'C'
272- sizeof_hdr = 4
273272
274273 def data_to_fileobj (self , data , fileobj , rescale = True ):
275274 """ See Header class for an implementation we can't use """
@@ -283,11 +282,10 @@ def data_from_fileobj(self, fileobj):
283282class Minc1Header (MincHeader ):
284283 @classmethod
285284 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' )
289287
290- return binaryblock [:klass . sizeof_hdr ] == b'CDF\x01 '
288+ return binaryblock [:4 ] == b'CDF\x01 '
291289
292290
293291class Minc1Image (SpatialImage ):
Original file line number Diff line number Diff line change @@ -137,11 +137,10 @@ def get_scaled_data(self, sliceobj=()):
137137class Minc2Header (MincHeader ):
138138 @classmethod
139139 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' )
143142
144- return binaryblock [:klass . sizeof_hdr ] == b'\211 HDF'
143+ return binaryblock [:4 ] == b'\211 HDF'
145144
146145
147146class Minc2Image (Minc1Image ):
You can’t perform that action at this time.
0 commit comments