pub struct MriCompressedSensing {
pub n: usize,
pub m: usize,
}Expand description
Compressed sensing reconstruction for MRI-like k-space data.
In MRI, measurements are taken in Fourier (k-space) domain. This module provides a simplified 1-D model: the signal is sparse in the DCT domain, and k-space samples are random Fourier measurements.
Fields§
§n: usizeSignal length.
m: usizeNumber of k-space samples (measurements).
Implementations§
Source§impl MriCompressedSensing
impl MriCompressedSensing
Sourcepub fn new(n: usize, m: usize) -> Self
pub fn new(n: usize, m: usize) -> Self
Create an MRI-CS reconstruction problem for a signal of length n
with m k-space measurements.
Sourcepub fn sample_kspace_indices(&self) -> Vec<usize>
pub fn sample_kspace_indices(&self) -> Vec<usize>
Generate random k-space sampling indices in [0, n).
Returns m unique indices (or repeating if m > n).
Sourcepub fn build_measurement_matrix(
&self,
kspace_indices: &[usize],
) -> Vec<Vec<f64>>
pub fn build_measurement_matrix( &self, kspace_indices: &[usize], ) -> Vec<Vec<f64>>
Build a partial Fourier (cosine) measurement matrix from k-space indices.
Row i corresponds to k-space sample k_i; entry (i, j) is
cos(2π k_i j / n) / sqrt(m).
Sourcepub fn reconstruct_fista(
&self,
measurements: &[f64],
kspace_indices: &[usize],
lambda: f64,
max_iter: usize,
) -> Vec<f64>
pub fn reconstruct_fista( &self, measurements: &[f64], kspace_indices: &[usize], lambda: f64, max_iter: usize, ) -> Vec<f64>
Reconstruct a signal from k-space measurements using FISTA.
measurements— observed k-space valueskspace_indices— which k-space lines were sampledlambda— sparsity regularisationmax_iter— number of FISTA iterations
Returns the reconstructed signal.
Auto Trait Implementations§
impl Freeze for MriCompressedSensing
impl RefUnwindSafe for MriCompressedSensing
impl Send for MriCompressedSensing
impl Sync for MriCompressedSensing
impl Unpin for MriCompressedSensing
impl UnsafeUnpin for MriCompressedSensing
impl UnwindSafe for MriCompressedSensing
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.