File tree Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Original file line number Diff line number Diff line change 54
54
from .arraywriters import make_array_writer
55
55
from .wrapstruct import WrapStruct
56
56
from .fileslice import canonical_slicers , predict_shape , slice2outax
57
+ from .keywordonly import kw_only_meth
57
58
from .deprecated import deprecate_with_version
58
59
59
60
BLOCK_SIZE = 512
@@ -873,7 +874,8 @@ def _get_fileholders(file_map):
873
874
return file_map ['header' ], file_map ['image' ]
874
875
875
876
@classmethod
876
- def from_file_map (klass , file_map ):
877
+ @kw_only_meth (1 )
878
+ def from_file_map (klass , file_map , mmap = True , keep_file_open = None ):
877
879
"""class method to create image from mapping
878
880
specified in file_map
879
881
"""
Original file line number Diff line number Diff line change 17
17
from .spatialimages import SpatialHeader , SpatialImage
18
18
from .fileslice import canonical_slicers
19
19
20
+ from .keywordonly import kw_only_meth
20
21
from .deprecated import FutureWarningMixin
21
22
22
23
_dt_dict = {
@@ -310,7 +311,9 @@ class Minc1Image(SpatialImage):
310
311
ImageArrayProxy = MincImageArrayProxy
311
312
312
313
@classmethod
313
- def from_file_map (klass , file_map ):
314
+ @kw_only_meth (1 )
315
+ def from_file_map (klass , file_map , mmap = True , keep_file_open = None ):
316
+ # Note that mmap and keep_file_open are included for proper
314
317
with file_map ['image' ].get_prepare_fileobj () as fobj :
315
318
minc_file = Minc1File (netcdf_file (fobj ))
316
319
affine = minc_file .get_affine ()
Original file line number Diff line number Diff line change 27
27
"""
28
28
import numpy as np
29
29
30
+ from .keywordonly import kw_only_meth
30
31
from .optpkg import optional_package
31
32
h5py , have_h5py , setup_module = optional_package ('h5py' )
32
33
@@ -158,7 +159,8 @@ class Minc2Image(Minc1Image):
158
159
header_class = Minc2Header
159
160
160
161
@classmethod
161
- def from_file_map (klass , file_map ):
162
+ @kw_only_meth (1 )
163
+ def from_file_map (klass , file_map , mmap = True , keep_file_open = None ):
162
164
holder = file_map ['image' ]
163
165
if holder .filename is None :
164
166
raise MincError ('MINC2 needs filename for load' )
You can’t perform that action at this time.
0 commit comments