File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 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):
21802180 self .set_data_dtype (datatype ) # Clears the alias
21812181 return super ().get_data_dtype ()
21822182
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+
21832201 def as_reoriented (self , ornt ):
21842202 """Apply an orientation change and return a new image
21852203
You can’t perform that action at this time.
0 commit comments