Skip to content

Commit

Permalink
Merge pull request #9 from achauvett/mrd_format_2
Browse files Browse the repository at this point in the history
MaRGE with ISMRMRD format
  • Loading branch information
josalggui authored Aug 27, 2024
2 parents 1add51b + 49f67a3 commit 133aee9
Show file tree
Hide file tree
Showing 9 changed files with 1,331 additions and 70 deletions.
30 changes: 21 additions & 9 deletions controller/controller_reconstruction.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,13 @@ def runDFFT(self):

# Update the main matrix of the image view widget with the image fft data
self.main.image_view_widget.main_matrix = k_space

orientation=None
if self.main.toolbar_image.mat_data and 'axesOrientation' in self.main.toolbar_image.mat_data:
orientation = self.main.toolbar_image.mat_data['axesOrientation'][0]
# Add new item to the history list
self.main.history_list.addNewItem(stamp="dFFT",
image=self.main.image_view_widget.main_matrix,
orientation=self.main.toolbar_image.mat_data['axesOrientation'][0],
orientation=orientation,
operation="dFFT",
space="k",
image_key=self.main.image_view_widget.image_key)
Expand Down Expand Up @@ -179,11 +181,15 @@ def runIFFT(self):
self.main.image_view_widget.main_matrix = image

figure = image / np.max(np.abs(image)) * 100

orientation=None
if self.main.toolbar_image.mat_data and 'axesOrientation' in self.main.toolbar_image.mat_data:
orientation = self.main.toolbar_image.mat_data['axesOrientation'][0]

# Add new item to the history list
self.main.history_list.addNewItem(stamp="iFFT",
image=figure,
orientation=self.main.toolbar_image.mat_data['axesOrientation'][0],
orientation=orientation,
operation="iFFT",
space="i",
image_key=self.main.image_view_widget.image_key)
Expand Down Expand Up @@ -316,11 +322,13 @@ def iterative_process_cpu(kx, ky, kz, x, y, z, s, rho, lbda, n_iter, index):
self.main.image_view_widget.main_matrix = rho

figure = rho/np.max(np.abs(rho))*100

orientation=None
if self.main.toolbar_image.mat_data and 'axesOrientation' in self.main.toolbar_image.mat_data:
orientation = self.main.toolbar_image.mat_data['axesOrientation'][0]
# Add new item to the history list
self.main.history_list.addNewItem(stamp="ART",
image=figure,
orientation=self.main.toolbar_image.mat_data['axesOrientation'][0],
orientation=orientation,
operation="ART n = %i, lambda = %0.3f" % (n_iter, lbda),
space="i",
image_key=self.main.image_view_widget.image_key)
Expand Down Expand Up @@ -367,11 +375,13 @@ def runZeroReconstruction(self):

# Update the main matrix of the image view widget with the k-space data
self.main.image_view_widget.main_matrix = image

orientation=None
if self.main.toolbar_image.mat_data and 'axesOrientation' in self.main.toolbar_image.mat_data:
orientation = self.main.toolbar_image.mat_data['axesOrientation'][0]
# Add new item to the history list
self.main.history_list.addNewItem(stamp="Partial Zero Reconstruction",
image=image,
orientation=self.main.toolbar_image.mat_data['axesOrientation'][0],
orientation=orientation,
operation="Partial Reconstruction - " + str(factors[-1::-1]),
space="i",
image_key=self.main.image_view_widget.image_key)
Expand Down Expand Up @@ -499,11 +509,13 @@ def getCenterKSpace(k_space, n, m_vec):
correlation = np.corrcoef(img_ref.flatten(), img_reconstructed.flatten())[0, 1]
print("\nRespect the reference image:")
print("Convergence: %0.2e" % (1 - correlation))

orientation=None
if self.main.toolbar_image.mat_data and 'axesOrientation' in self.main.toolbar_image.mat_data:
orientation = self.main.toolbar_image.mat_data['axesOrientation'][0]
# Add new item to the history list
self.main.history_list.addNewItem(stamp="POCS",
image=figure,
orientation=self.main.toolbar_image.mat_data['axesOrientation'][0],
orientation=orientation,
operation="POCS - " + str(factors[-1::-1]),
space="i",
image_key=self.main.image_view_widget.image_key)
Loading

0 comments on commit 133aee9

Please sign in to comment.