Commit e779009a authored by syz's avatar syz
Browse files

Merge branch 'cades_dev' of https://github.com/pycroscopy/pycroscopy into cades_dev_local

parents 6c04eba2 4b9805d7
.. contents::
Roadmap / Milestones
Short-term goals
--------------------
1. better BE notebook + visualization for users
2. Cleaned versions of the main modules (Analysis pending) + enough documentation for users and developers
3. Multi-node compute capability
* More documentation to help users / developers + PAPER
* Cleaned versions of the main modules (Analysis pending) + enough documentation for users and developers
* Multi-node compute capability
Documentation
-------------
* Include examples in documentation
* Links to references for all functions and methods used in our workflows.
Short tutorials on how to use pycroscopy
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Access h5 files
* Find a specific dataset/group in the file
* chunking the main dataset
* Links to tutorials on how to use pycharm, Git,
Longer examples (via specific scientific usecases)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* A tour of the many functions in hdf_utils and io_utils since these functions need data to show / explain them.
* pycroscopy pacakge organization - a short writeup on what is where and differences between the process / analyis submodules
* How to write your own analysis class based on the (to-be simplified) Model class
Rama's (older and more applied / specific) tutorial goals
~~~~~~~~~~~~~~~~~~~~
1. Open a translated and fitted FORC-PFM file, and plot the SHO Fit from cycle k corresponding to voltage p, along with the raw spectrogram for that location and the SHO guess. Plot both real and imaginary, and do so for both on and off-field.
2. Continuing above, determine the average of the quality factor coming from cycles 1,3,4 for spatial points stored in vector b for the on-field part for a predetermined voltage range given by endpoints [e,f]. Compare the results with the SHO guess and fit for the quality factor.
3. After opening a h5 file containing results from a relaxation experiment, plot the response at a particular point and voltage, run exponential fitting and then store the results of the fit in the same h5 file using iohdf and/or numpy translators.
4. Take a FORC IV ESM dataset and break it up into forward and reverse branches, along with positive and negative branches. Do correlation analysis between PFM and IV for different branches and store the results in the file, and readily access them for plotting again.
5. A guide to using the model fitter for parallel fitting of numpy array-style datasets. This one can be merged with number
New features
------------
Core development
~~~~~~~~~~~~~~~~
* Finish PycroDataset and test the many data slicing, referencing operations on **main** datasets.
* Need to be able to run a visualizer even on sliced data. What would this object be? (sliced Main data + vectors for each axis + axis labels ....). Perhaps the slice() function should return this object instead of a numpy array? As it stands, the additional information (for the visualizer) is not returned by the slice function.
* Consider implementing doSVD as a Process. Maybe the Decomposition and Cluster classes could extend Process?
* Simplify and demystify analyis / optimize. Use parallel_compute instead of optimize and gues_methods and fit_methods
* multi-node computing capability in parallel_compute
* Data Generators
GUI
~~~~~~~~~~~
* Need to be able to run a visualizer even on sliced data. What would this object be? (sliced Main data + vectors for each axis + axis labels ....). Perhaps the slice() function should return this object instead of a numpy array? As it stands, the additional information (for the visualizer) is not returned by the slice function.
* Generic visualizer in plot.lly / dash? that can use the PycroDataset class
* One suggestion is 2 (or more panes).
* Left hand side for positions
......@@ -21,35 +53,11 @@ Core development
* Right hand side for spectral
* 1D spectra or 2D images.
* Users will be asked to slice N-1 or N-2 spectral dimensions
* Rewrite fft filtering as a Process class.
* Simplify and demystify analyis / optimize. Use parallel_compute instead of optimize and gues_methods and fit_methods
* multi-node computing capability in parallel_compute
* Data Generators
External user contributions
~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Li Xin classification code
* Ondrej Dyck’s atom finding code – written but needs work before fully integrated
* Nina Wisinger’s processing code (Tselev) – in progress
* Sabine Neumeyer's cKPFM code
* Iaroslav Gaponenko's Distort correct code from - https://github.com/paruch-group/distortcorrect.
* Port everything from IFIM Matlab -> Python translation exercises
* Other workflows/functions that already exist as scripts or notebooks
GUI
----
* Switch to using plot.ly and dash for interactive elements
* Possibly use MayaVi for 3d plotting
Plot Utils
----------
* Define default font sizes that will be adopted in all functions wherever applicable using rcParams. See - https://matplotlib.org/users/customizing.html
* label_fontsize=16
* tick_fontsize=14
* title_fontsize=18
* Override wherever necessary.
~~~~~~~~~
* _add_loop_parameters - is BE specific and should be moved out of plot_utils
* rainbow_plot -
......@@ -134,39 +142,17 @@ Plot Utils
3. Don’t allow specification of figure_path here. Save elsewhere
* plot_histograms - not used frequently. Can be ignored for this pass
Examples / Tutorials
--------------------
Short tutorials on how to use pycroscopy
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Access h5 files
* Find a specific dataset/group in the file
* Select data within a dataset in various ways
* micro datasets / microdata groups
* chunking the main dataset
* Links to tutorials on how to use pycharm, Git,
Longer examples (via specific scientific usecases)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* How to write your write your own parallel computing function using the process module - add more documentation
* A tour of the many functions in hdf_utils and io_utils since these functions need data to show / explain them.
* How to write your own analysis class based on the (to-be simplified) Model class
* pycroscopy pacakge organization - a short writeup on what is where and differences between the process / analyis submodules
Rama's (older and more applied / specific) tutorial goals
~~~~~~~~~~~~~~~~~~~~
1. Open a translated and fitted FORC-PFM file, and plot the SHO Fit from cycle k corresponding to voltage p, along with the raw spectrogram for that location and the SHO guess. Plot both real and imaginary, and do so for both on and off-field.
2. Continuing above, determine the average of the quality factor coming from cycles 1,3,4 for spatial points stored in vector b for the on-field part for a predetermined voltage range given by endpoints [e,f]. Compare the results with the SHO guess and fit for the quality factor.
3. Done - After opening a h5 file containing results from a relaxation experiment, plot the response at a particular point and voltage, run exponential fitting and then store the results of the fit in the same h5 file using iohdf and/or numpy translators.
4. Take a FORC IV ESM dataset and break it up into forward and reverse branches, along with positive and negative branches. Do correlation analysis between PFM and IV for different branches and store the results in the file, and readily access them for plotting again.
5. A guide to using the model fitter for parallel fitting of numpy array-style datasets. This one can be merged with number
Documentation
-------------
* Switch from static examples to dynamic jupyter notebook like examples:
* Work will be needed after examples are done
* Include examples in documentation
* Links to references for all functions and methods used in our workflows.
External user contributions
~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Li Xin classification code
* Ondrej Dyck’s atom finding code – written but needs work before fully integrated
* Nina Wisinger’s processing code (Tselev) – in progress
* Sabine Neumeyer's cKPFM code
* Iaroslav Gaponenko's Distort correct code from - https://github.com/paruch-group/distortcorrect.
* Port everything from IFIM Matlab -> Python translation exercises
* Other workflows/functions that already exist as scripts or notebooks
Formatting changes
------------------
......
%% Cell type:markdown id: tags:
# Image cleaning and atom finding using pycroscopy
### Suhas Somnath, Chris R. Smith, Stephen Jesse
The Center for Nanophase Materials Science and The Institute for Functional Imaging for Materials <br>
Oak Ridge National Laboratory<br>
1/19/2017
%% Cell type:markdown id: tags:
## Configure the notebook first
%% Cell type:code id: tags:
``` python
# set up notebook to show plots within the notebook
% matplotlib inline
% matplotlib notebook
# Import necessary libraries:
# General utilities:
import os
import sys
from time import time
from scipy.misc import imsave
# Computation:
import numpy as np
import h5py
from skimage import measure
from scipy.cluster.hierarchy import linkage, dendrogram
from scipy.spatial.distance import pdist
# Visualization:
import matplotlib.pyplot as plt
import matplotlib.patches as patches
from mpl_toolkits.axes_grid1 import make_axes_locatable
from IPython.display import display
from IPython.display import display, HTML
import ipywidgets as widgets
from mpl_toolkits.axes_grid1 import ImageGrid
# Finally, pycroscopy itself
sys.path.append('..')
import pycroscopy as px
# Make Notebook take up most of page width
display(HTML(data="""
<style>
div#notebook-container { width: 95%; }
div#menubar-container { width: 65%; }
div#maintoolbar-container { width: 99%; }
</style>
"""))
```
%% Cell type:markdown id: tags:
## Load the image that will be cleaned:
%% Cell type:code id: tags:
``` python
image_path = px.io.uiGetFile('*.png *PNG *TIFF * TIF *tif *tiff *BMP *bmp','Images')
#image_path = r"C:\Users\sjz\Desktop\MM workshop\Data\Image_Cleaning\16_55_31_256_256b.tif"
# image_path = px.io.uiGetFile('*.png *PNG *TIFF * TIF *tif *tiff *BMP *bmp','Images')
image_path = '/home/challtdow/workspace/pycroscopy_data/Image Windowing/16_55_31_256_256b/16_55_31_256_256b.tif'
print('Working on: \n{}'.format(image_path))
folder_path, file_name = os.path.split(image_path)
base_name, _ = os.path.splitext(file_name)
```
%% Cell type:markdown id: tags:
## Make the image file pycroscopy compatible
Convert the source image file into a pycroscopy compatible hierarchical data format (HDF or .h5) file. This simple translation gives you access to the powerful data functions within pycroscopy
#### H5 files:
* are like smart containers that can store matrices with data, folders to organize these datasets, images, metadata like experimental parameters, links or shortcuts to datasets, etc.
* are readily compatible with high-performance computing facilities
* scale very efficiently from few kilobytes to several terabytes
* can be read and modified using any language including Python, Matlab, C/C++, Java, Fortran, Igor Pro, etc.
%% Cell type:code id: tags:
``` python
# Check if an HDF5 file with the chosen image already exists.
# Only translate if it does not.
h5_path = os.path.join(folder_path, base_name+'.h5')
need_translation = True
if os.path.exists(h5_path):
try:
h5_file = h5py.File(h5_path, 'r+')
h5_raw = h5_file['Measurement_000']['Channel_000']['Raw_Data']
need_translation = False
print('HDF5 file with Raw_Data found. No need to translate.')
except KeyError:
print('Raw Data not found.')
else:
print('No HDF5 file found.')
if need_translation:
# Initialize the Image Translator
tl = px.ImageTranslator()
# create an H5 file that has the image information in it and get the reference to the dataset
h5_raw = tl.translate(image_path)
# create a reference to the file
h5_file = h5_raw.file
print('HDF5 file is located at {}.'.format(h5_file.filename))
```
%% Cell type:markdown id: tags:
### Inspect the contents of this h5 data file
The file contents are stored in a tree structure, just like files on a contemporary computer.
The data is stored as a 2D matrix (position, spectroscopic value) regardless of the dimensionality of the data.
In the case of these 2D images, the data is stored as a N x 1 dataset
The main dataset is always accompanied by four ancillary datasets that explain the position and spectroscopic value of any given element in the dataset.
In the case of the 2d images, the positions will be arranged as row0-col0, row0-col1.... row0-colN, row1-col0....
The spectroscopic information is trivial since the data at any given pixel is just a scalar value
%% Cell type:code id: tags:
``` python
print('Datasets and datagroups within the file:')
px.io.hdf_utils.print_tree(h5_file)
print('\nThe main dataset:')
print(h5_file['/Measurement_000/Channel_000/Raw_Data'])
print('\nThe ancillary datasets:')
print(h5_file['/Measurement_000/Channel_000/Position_Indices'])
print(h5_file['/Measurement_000/Channel_000/Position_Values'])
print(h5_file['/Measurement_000/Channel_000/Spectroscopic_Indices'])
print(h5_file['/Measurement_000/Channel_000/Spectroscopic_Values'])
print('\nMetadata or attributes in a datagroup')
for key in h5_file['/Measurement_000'].attrs:
print('{} : {}'.format(key, h5_file['/Measurement_000'].attrs[key]))
```
%% Cell type:markdown id: tags:
## Initialize an object that will perform image windowing on the .h5 file
* Note that after you run this, the H5 file is opened. If you want to re-run this cell, close the H5 file first
%% Cell type:code id: tags:
``` python
# Initialize the windowing class
iw = px.ImageWindow(h5_raw, max_RAM_mb=1024*4)
# grab position indices from the H5 file
h5_pos = h5_raw.parent[h5_raw.attrs['Position_Indices']]
# determine the image size:
num_x = len(np.unique(h5_pos[:,0]))
num_y = len(np.unique(h5_pos[:,1]))
# extract figure data and reshape to proper numpy array
raw_image_mat = np.reshape(h5_raw[()], [num_x,num_y]);
```
%% Cell type:markdown id: tags:
## Visualize the source image:
Though the source file is actually grayscale image, we will visualize it using a color-scale
%% Cell type:code id: tags:
``` python
fig, axis = plt.subplots(figsize=(10,10))
img = axis.imshow(raw_image_mat,cmap=px.plot_utils.cmap_jet_white_center(), origin='lower');
divider = make_axes_locatable(axis)
cax = divider.append_axes("right", size="5%", pad=0.2)
plt.colorbar(img, cax=cax)
axis.set_title('Raw Image', fontsize=16);
```
%% Cell type:markdown id: tags:
## Extract the optimal window size from the image
%% Cell type:code id: tags:
``` python
num_peaks = 2
win_size , psf_width = iw.window_size_extract(num_peaks, save_plots=False, show_plots=True)
print('Window size = {}'.format(win_size))
```
%% Cell type:code id: tags:
``` python
# Uncomment this line if you need to manually specify a window size
# win_size = 8
# plot a single window
row_offset = int(0.5*(num_x-win_size))
col_offset = int(0.5*(num_y-win_size))
plt.figure()
plt.imshow(raw_image_mat[row_offset:row_offset+win_size,
col_offset:col_offset+win_size],
cmap=px.plot_utils.cmap_jet_white_center(),
origin='lower');
# the result should be about the size of a unit cell
# if it is the wrong size, just choose on manually by setting the win_size
plt.show()
```
%% Cell type:markdown id: tags:
## Now break the image into a sequence of small windows
We do this by sliding a small window across the image. This artificially baloons the size of the data.
%% Cell type:code id: tags:
``` python
windowing_parms = {
'fft_mode': None, # Options are None, 'abs', 'data+abs', or 'complex'
'win_x': win_size,
'win_y': win_size,
'win_step_x': 1,
'win_step_y': 1,
}
win_parms_copy = windowing_parms.copy()
if windowing_parms['fft_mode'] is None:
win_parms_copy['fft_mode'] = 'data'
h5_wins_grp = px.hdf_utils.check_for_old(h5_raw, 'Windowing',
win_parms_copy)
if h5_wins_grp is None:
print('Windows either do not exist or were created with different parameters')
t0 = time()
h5_wins = iw.do_windowing(win_x=windowing_parms['win_x'],
win_y=windowing_parms['win_y'],
save_plots=False,
show_plots=False,
win_fft=windowing_parms['fft_mode'])
print( 'Windowing took {} seconds.'.format(round(time()-t0, 2)))
else:
print('Taking existing windows dataset')
h5_wins = h5_wins_grp['Image_Windows']
print('\nRaw data was of shape {} and the windows dataset is now of shape {}'.format(h5_raw.shape, h5_wins.shape))
print('Now each position (window) is descibed by a set of pixels')
```
%% Cell type:code id: tags:
``` python
# Peek at a few random windows
num_rand_wins = 9
rand_positions = np.random.randint(0, high=h5_wins.shape[0], size=num_rand_wins)
example_wins = np.zeros(shape=(windowing_parms['win_x'], windowing_parms['win_y'], num_rand_wins), dtype=np.float32)
for rand_ind, rand_pos in enumerate(rand_positions):
example_wins[:, :, rand_ind] = np.reshape(h5_wins[rand_pos], (windowing_parms['win_x'], windowing_parms['win_y']))
px.plot_utils.plot_map_stack(example_wins, heading='Example Windows', cmap=px.plot_utils.cmap_jet_white_center(),
title=['Window # ' + str(win_pos) for win_pos in rand_positions]);
```
%% Cell type:markdown id: tags:
## Performing Singular Value Decompostion (SVD) on the windowed data
SVD decomposes data (arranged as position x value) into a sequence of orthogonal components arranged in descending order of variance. The first component contains the most significant trend in the data. The second component contains the next most significant trend orthogonal to all previous components (just the first component). Each component consists of the trend itself (eigenvector), the spatial variaion of this trend (eigenvalues), and the variance (statistical importance) of the component.
Since the data consists of the large sequence of small windows, SVD essentially compares every single window with every other window to find statistically significant trends in the image
%% Cell type:code id: tags:
``` python
# check to make sure number of components is correct:
num_comp = 1024
num_comp = min(num_comp,
min(h5_wins.shape)*len(h5_wins.dtype))
h5_svd = px.hdf_utils.check_for_old(h5_wins, 'SVD', {'num_components':num_comp})
if h5_svd is None:
print('SVD was either not performed or was performed with different parameters')
h5_svd = px.processing.doSVD(h5_wins, num_comps=num_comp)
else:
print('Taking existing SVD results')
h5_U = h5_svd['U']
h5_S = h5_svd['S']
h5_V = h5_svd['V']
# extract parameters of the SVD results
h5_pos = iw.hdf.file[h5_wins.attrs['Position_Indices']]
num_rows = len(np.unique(h5_pos[:, 0]))
num_cols = len(np.unique(h5_pos[:, 1]))
num_comp = h5_S.size
print("There are a total of {} components.".format(num_comp))
print('\nRaw data was of shape {} and the windows dataset is now of shape {}'.format(h5_raw.shape, h5_wins.shape))
print('Now each position (window) is descibed by a set of pixels')
plot_comps = 49
U_map_stack = np.reshape(h5_U[:, :plot_comps], [num_rows, num_cols, -1])
V_map_stack = np.reshape(h5_V, [num_comp, win_size, win_size])
V_map_stack = np.transpose(V_map_stack,(2,1,0))
```
%% Cell type:markdown id: tags:
## Visualize the SVD results
##### S (variance):
The plot below shows the variance or statistical significance of the SVD components. The first few components contain the most significant information while the last few components mainly contain noise.
Note also that the plot below is a log-log plot. The importance of each subsequent component drops exponentially.
%% Cell type:code id: tags:
``` python
fig_S, ax_S = px.plot_utils.plotScree(h5_S[()]);
```
%% Cell type:markdown id: tags:
#### V (Eigenvectors or end-members)
The V dataset contains the end members for each component
%% Cell type:code id: tags:
``` python
for field in V_map_stack.dtype.names:
fig_V, ax_V = px.plot_utils.plot_map_stack(V_map_stack[:,:,:][field], heading='', title='Vector-'+field, num_comps=plot_comps,
color_bar_mode='each', cmap=px.plot_utils.cmap_jet_white_center())
```
%% Cell type:markdown id: tags:
#### U (Abundance maps):
The plot below shows the spatial distribution of each component
%% Cell type:code id: tags:
``` python
fig_U, ax_U = px.plot_utils.plot_map_stack(U_map_stack[:,:,:25], heading='', title='Component', num_comps=plot_comps,
color_bar_mode='each', cmap=px.plot_utils.cmap_jet_white_center())
```
%% Cell type:markdown id: tags:
## Reconstruct image (while removing noise)
Since SVD is just a decomposition technique, it is possible to reconstruct the data with U, S, V matrices.
It is also possible to reconstruct a version of the data with a set of components.
Thus, by reconstructing with the first few components, we can remove the statistical noise in the data.
##### The key is to select the appropriate (number of) components to reconstruct the image without the noise
%% Cell type:code id: tags:
``` python
clean_components = range(36) # np.append(range(5,9),(17,18))
num_components=len(clean_components)
# Check if the image has been reconstructed with the same parameters:
# First, gather all groups created by this tool:
h5_clean_image = None
for item in h5_svd:
if item.startswith('Cleaned_Image_') and isinstance(h5_svd[item],h5py.Group):
grp = h5_svd[item]
old_comps = px.hdf_utils.get_attr(grp, 'components_used')
if old_comps.size == len(list(clean_components)):
if np.all(np.isclose(old_comps, np.array(clean_components))):
h5_clean_image = grp['Cleaned_Image']
print( 'Existing clean image found. No need to rebuild.')
break
if h5_clean_image is None:
t0 = time()
#h5_clean_image = iw.clean_and_build_batch(h5_win=h5_wins, components=clean_components)
h5_clean_image = iw.clean_and_build_separate_components(h5_win=h5_wins, components=clean_components)
print( 'Cleaning and rebuilding image took {} seconds.'.format(round(time()-t0, 2)))
```
%% Cell type:code id: tags:
``` python
# Building a stack of images from here:
image_vec_components = h5_clean_image[()]
# summing over the components:
for comp_ind in range(1, h5_clean_image.shape[1]):
image_vec_components[:, comp_ind] = np.sum(h5_clean_image[:, :comp_ind+1], axis=1)
# converting to 3D:
image_components = np.reshape(image_vec_components, [num_x, num_y, -1])
# calculating the removed noise:
noise_components = image_components - np.reshape(np.tile(h5_raw[()], [1, h5_clean_image.shape[1]]), image_components.shape)
# defining a helper function to get the FFTs of a stack of images
def get_fft_stack(image_stack):
blackman_window_rows = np.blackman(image_stack.shape[0])
blackman_window_cols = np.blackman(image_stack.shape[1])
fft_stack = np.zeros(image_stack.shape, dtype=np.float)
for image_ind in range(image_stack.shape[2]):
layer = image_stack[:, :, image_ind]
windowed = blackman_window_rows[:, np.newaxis] * layer * blackman_window_cols[np.newaxis, :]
fft_stack[:, :, image_ind] = np.abs(np.fft.fftshift(np.fft.fft2(windowed, axes=(0,1)), axes=(0,1)))
return fft_stack
# get the FFT of the cleaned image and the removed noise:
fft_image_components = get_fft_stack(image_components)
fft_noise_components = get_fft_stack(noise_components)
```
%% Cell type:code id: tags:
``` python
fig_U, ax_U = px.plot_utils.plot_map_stack(image_components[:,:,:25], heading='', evenly_spaced=False,
title='Upto component', num_comps=plot_comps, color_bar_mode='single',
cmap=px.plot_utils.cmap_jet_white_center())
```
%% Cell type:markdown id: tags:
## Reconstruct the image with the first N components
slide the bar to pick the the number of components such that the noise is removed while maintaining the integrity of the image
%% Cell type:code id: tags:
``` python
num_comps = min(16, image_components.shape[2])
img_stdevs = 3
fig, axes = plt.subplots(nrows=2, ncols=2, figsize=(14, 14))
axes.flat[0].loglog(h5_S[()], '*-')
axes.flat[0].set_xlim(left=1, right=h5_S[()].size)
axes.flat[0].set_ylim(bottom=np.min(h5_S[()]), top=np.max(h5_S[()]))
axes.flat[0].set_title('Variance', fontsize=16)
vert_line = axes.flat[0].axvline(x=num_comps, color='r')
clean_image_mat = image_components[:, :, num_comps]
img_clean = axes.flat[1].imshow(clean_image_mat, cmap=px.plot_utils.cmap_jet_white_center(), origin='lower')
mean_val = np.mean(clean_image_mat)
std_val = np.std(clean_image_mat)
img_clean.set_clim(vmin=mean_val-img_stdevs*std_val, vmax=mean_val+img_stdevs*std_val)
axes.flat[1].get_yaxis().set_visible(False)
axes.flat[1].get_xaxis().set_visible(False)
axes.flat[1].set_title('Cleaned Image', fontsize=16)
fft_std_dev = np.max(np.std(fft_image_components[:, :, num_comps]))
img_noise_fft = axes.flat[2].imshow(fft_noise_components[:, :, num_comps], cmap=plt.cm.jet,
vmin=0, vmax=4*fft_std_dev, origin='lower')
axes.flat[2].get_yaxis().set_visible(False)
axes.flat[2].get_xaxis().set_visible(False)
axes.flat[2].set_title('FFT of removed noise', fontsize=16)
img_clean_fft = axes.flat[3].imshow(fft_image_components[:, :, num_comps], cmap=plt.cm.jet,
vmin=0, vmax=4*fft_std_dev, origin='lower')
axes.flat[3].set_title('FFT of cleaned image', fontsize=16)
axes.flat[3].get_yaxis().set_visible(False)