mr2.algorithms.reconstruction.ConvDecoderReconstruction

class mr2.algorithms.reconstruction.ConvDecoderReconstruction[source]

Bases: DirectReconstruction

Reconstruct MRI data with an untrained convolutional decoder.

Fits generator weights \(\theta\) by minimizing \(\|A G_\theta(z)-y\|_2^2\), where \(A=FS\) combines Fourier sampling and coil sensitivities, \(y\) is acquired complex k-space, and \(z\) is fixed random noise.

Each call fits fresh ConvDecoder networks with Adam. latent_shape selects the spatial dimensions modeled jointly; remaining dimensions use independent generators. Two real output channels form one complex object image. Fitting uses density-compensated adjoint RMS scaling and returns an image in the input units. The callback and iteration budget control stopping.

This variant uses InstanceNorm instead of the authors’ BatchNorm [DARESTANI2021]. Optimization is not differentiable through the iterations.

References

[DARESTANI2021]

Darestani MZ, Heckel R (2021). Accelerated MRI with Un-trained Neural Networks. https://doi.org/10.1109/TCI.2021.3097596

__init__(kdata: KData | None = None, fourier_op: LinearOperator | None = None, csm: Callable[[IData], CsmData] | CsmData | SensitivityOp | None = CsmData.from_idata_walsh, noise: KNoise | None = None, dcf: DcfData | DensityCompensationOp | None = None, *, max_iterations: int = 2500, learning_rate: float = 0.008, n_features: int = 256, n_levels: int = 6, latent_shape: tuple[int, ...] = (8, 4), callback: Callable[[OptimizerStatus], bool | None] | None = None) → None[source]

Initialize the reconstruction.

Parameters:
  • kdata (KData | None, default: None) – Data used to set up Fourier, density compensation and sensitivity operators, as in DirectReconstruction.

  • fourier_op (LinearOperator | None, default: None) – Fourier/sampling operator. If omitted, construct from kdata.

  • csm (Callable[[IData], CsmData] | CsmData | SensitivityOp | None, default: CsmData.from_idata_walsh) – Sensitivity maps, operator or estimation callable, as in DirectReconstruction. Required for multicoil object reconstruction; None is supported for single-coil data. When noise is supplied, explicit maps must already be in the whitened coil basis. Estimation callables receive coil images reconstructed from whitened data.

  • noise (KNoise | None, default: None) – Noise measurement used to prewhiten the k-space data, if provided. Explicit sensitivity maps are not transformed; supply maps calibrated from equivalently whitened data, as for DirectReconstruction.

  • dcf (DcfData | DensityCompensationOp | None, default: None) – Density compensation for sensitivity estimation and intensity scaling, not loss weighting. If omitted, estimate from kdata.

  • max_iterations (int, default: 2500) – Finite number of Adam updates. Zero returns the initial generator output.

  • learning_rate (float, default: 0.008) – Positive Adam learning rate.

  • n_features (int, default: 256) – Number of latent channels and hidden features.

  • n_levels (int, default: 6) – Number of nearest-neighbor upsampling stages.

  • latent_shape (tuple[int, ...], default: (8, 4)) – Shape of the fixed random input, excluding channels. Its length selects the generator dimensionality (e.g. two for slices, four for time/volume). The coil axis is excluded. Must fit inside the output dimensions.

  • callback (Callable[[OptimizerStatus], bool | None] | None, default: None) – Called after each update with zero-based iteration_number and solution=(image,) in mr2 layout. Return False to stop.

dcf_op: DensityCompensationOp | None

Density Compensation Operator.

csm_op: SensitivityOp | None

Coil Sensitivity Operator.

noise: KNoise | None

Noise Data used for prewhitening.

fourier_op: LinearOperator

Fourier Operator.

__call__(kdata: KData) → IData[source]

Apply the reconstruction.

forward(kdata: KData) → IData[source]

Fit fresh generators and return complex image data with the input header.

direct_reconstruction(kdata: KData, *, csm: CsmData | Literal[False] | None = None, noise: KNoise | Literal[False] | None = None) → IData[source]

Direct reconstruction of the MR acquisition.

Here we use \(S^H F^H W\) to calculate the image data using the coil sensitivity operator \(S\), the Fourier operator \(F\), and the density compensation operator \(W\).

Parameters:
  • kdata (KData) – k-space data

  • csm (Union[CsmData, Literal[False], None], default: None) – Coil sensitivity maps used for coil combination. If None, self.csm_op is used. If False, no coil combination is performed.

  • noise (Union[KNoise, Literal[False], None], default: None) – Noise measurement for prewhitening. If None, self.noise is used. If False, no prewhitening is performed.

Returns:

image data

recalculate_csm(kdata: KData, csm_calculation: Callable[[IData], CsmData] = CsmData.from_idata_walsh, noise: KNoise | Literal[False] | None = None) → Self[source]

Update (in place) the CSM from KData.

Performs a direct reconstruction without coil combination and estimates coil sensitivity maps from the result.

Parameters:
  • kdata (KData) – k-space data used for adjoint reconstruction (including DCF-weighting if available), which is then used for CSM estimation.

  • csm_calculation (Callable[[IData], CsmData], default: CsmData.from_idata_walsh) – Function to calculate csm expecting idata as input and returning csmdata. For examples have a look at the CsmData.

  • noise (Union[KNoise, Literal[False], None], default: None) – Noise measurement for prewhitening. If None, self.noise (if previously set) is used. If False, no prewhitening is performed even if self.noise is set. Use this if the kdata is already prewhitened.

recalculate_fourierop(kdata: KData) → Self[source]

Update (in place) the Fourier Operator, e.g. for a new trajectory.

Also recalculates the DCF.

Parameters:

kdata (KData) – k-space data to determine trajectory and recon/encoding matrix from.