File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010import pyqtgraph as pg
1111from pyqtgraph .graphicsItems .ROI import Handle
1212import numpy as np
13- from tifffile import imsave
13+ from tifffile import imwrite
1414from numba import jit , prange
1515import stempy .io as stio
1616
@@ -400,18 +400,20 @@ def _on_export(self):
400400 out_path = Path (file_name )
401401 else :
402402 return
403-
403+
404404 # Get the data and change to float
405405 if action .text () == 'Export diffraction (TIF)' :
406406 if out_path .suffix != '.tif' :
407407 out_path = out_path .with_suffix ('.tif' )
408- imsave (out_path , self .dp .reshape (self .frame_dimensions ).astype (np .float32 ))
408+ imwrite (out_path , self .dp .reshape (self .frame_dimensions ).astype (np .float32 ))
409409 elif action .text () == 'Export diffraction (SMV)' :
410410 if out_path .suffix != '.img' :
411411 out_path = out_path .with_suffix ('.img' )
412412 self ._write_smv (out_path )
413413 elif action .text () == 'Export real (TIF)' :
414- imsave (out_path , self .rs .reshape (self .scan_dimensions ).astype (np .float32 ))
414+ if out_path .suffix != '.tif' :
415+ out_path = out_path .with_suffix ('.tif' )
416+ imwrite (out_path , self .rs .reshape (self .scan_dimensions ).astype (np .float32 ))
415417 else :
416418 print ('Export: unknown action {}' .format (action .text ()))
417419
You can’t perform that action at this time.
0 commit comments