diff --git a/examples/cartesian_reconstruction_auto_threshold.py b/examples/cartesian_reconstruction_auto_threshold.py index 0962a2c8..0ebd9459 100644 --- a/examples/cartesian_reconstruction_auto_threshold.py +++ b/examples/cartesian_reconstruction_auto_threshold.py @@ -1,9 +1,6 @@ -#!/usr/bin/env python -# coding: utf-8 - -# -# Neuroimaging cartesian reconstruction -# ===================================== +""" +# Auto Thresholded cartesian reconstruction +# ========================================= # # Author: Chaithya G R / Pierre-Antoine Comby # @@ -15,11 +12,9 @@ # # We use the toy datasets available in pysap, more specifically a 2D brain slice # and the cartesian acquisition scheme. -# - -# In[1]: - - +""" +# %% +# Package import import matplotlib.pyplot as plt import numpy as np from modopt.math.metrics import snr, ssim @@ -59,8 +54,6 @@ # Descent algorithm (FISTA or POGM). # The cost function is set to Proximity Cost + Gradient Cost -# In[4]: - # Setup the operators linear_op = WaveletN(wavelet_name="sym8", nb_scales=3) @@ -202,7 +195,7 @@ def static_weight(w, idx): plt.subplot(122) plt.plot(metrics["ssim"]["index"], metrics["ssim"]["values"]) plt.plot(metrics2["ssim"]["index"], metrics2["ssim"]["values"]) - +plt.show() #%% # Qualitative results @@ -223,3 +216,4 @@ def my_imshow(ax, img, title): my_imshow(axs[1,1], abs(image_rec2), f"Fista Sure \n SSIM={recon_ssim2:.4f}") fig.tight_layout() +plt.show()