File tree 1 file changed +18
-0
lines changed
1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -2180,6 +2180,24 @@ def get_data_dtype(self, finalize=False):
2180
2180
self .set_data_dtype (datatype ) # Clears the alias
2181
2181
return super ().get_data_dtype ()
2182
2182
2183
+ def to_file_map (self , file_map = None , dtype = None ):
2184
+ """ Write image to `file_map` or contained ``self.file_map``
2185
+
2186
+ Parameters
2187
+ ----------
2188
+ file_map : None or mapping, optional
2189
+ files mapping. If None (default) use object's ``file_map``
2190
+ attribute instead
2191
+ dtype : dtype-like, optional
2192
+ The on-disk data type to coerce the data array.
2193
+ """
2194
+ img_dtype = self .get_data_dtype ()
2195
+ self .get_data_dtype (finalize = True )
2196
+ try :
2197
+ super ().to_file_map (file_map , dtype )
2198
+ finally :
2199
+ self .set_data_dtype (img_dtype )
2200
+
2183
2201
def as_reoriented (self , ornt ):
2184
2202
"""Apply an orientation change and return a new image
2185
2203
You can’t perform that action at this time.
0 commit comments