#NEWLINE# def save_slice_cb( self ) : #NEWLINE# #INDENT# target = Widgets . SaveDialog ( title = 'Save slice' , selectedfilter = '*.png' ) . get_path ( ) #NEWLINE# with open ( target , 'w' ) as target_file : #NEWLINE# #INDENT# hival = self . fitsimage . get_cut_levels ( ) [ 1 ] #NEWLINE# image = self . fitsimage . get_image ( ) #NEWLINE# curr_slice_data = image . get_data ( ) #NEWLINE# plt . imsave ( target_file , curr_slice_data , vmax = hival , cmap = plt . get_cmap ( 'gray' ) , origin = 'lower' ) #NEWLINE# self . fv . showStatus ( 'Successfully saved slice' )