Skip to content

Commit

Permalink
Added auto tuto
Browse files Browse the repository at this point in the history
  • Loading branch information
GILIYAR RADHAKRISHNA Chaithya committed Jan 10, 2024
1 parent 6fc7d95 commit 6ff3166
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions examples/cartesian_reconstruction_auto_threshold.py
Original file line number Diff line number Diff line change
@@ -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
#
Expand All @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand All @@ -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()

0 comments on commit 6ff3166

Please sign in to comment.