mridc.collections.reconstruction.metrics package

Submodules

mridc.collections.reconstruction.metrics.evaluate module

class mridc.collections.reconstruction.metrics.evaluate.Metrics(metric_funcs, output_path, method)[source]

Bases: object

Maintains running statistics for a given collection of metrics.

__repr__()[source]

Representation of the metrics.

means()[source]

Mean of the means of each metric.

push(target, recons)[source]

Pushes a new batch of metrics to the running statistics.

Parameters
  • target (target image) –

  • recons (reconstructed image) –

Returns

dict

Return type

A dict where the keys are metric names and the values are

stddevs()[source]

Standard deviation of the means of each metric.

mridc.collections.reconstruction.metrics.evaluate.evaluate(arguments, reconstruction_key, mask_background, output_path, method, acc, no_params, slice_start, slice_end, coil_dim)[source]

Evaluates the reconstructions.

Parameters
  • arguments (The CLI arguments.) –

  • reconstruction_key (The key of the reconstruction to evaluate.) –

  • mask_background (The background mask.) –

  • output_path (The output path.) –

  • method (The reconstruction method.) –

  • acc (The acceleration factor.) –

  • no_params (The number of parameters.) –

  • slice_start (The start slice. (optional)) –

  • slice_end (The end slice. (optional)) –

  • coil_dim (The coil dimension. (optional)) –

Returns

dict

Return type

A dict where the keys are metric names and the values are the mean of the metric.

mridc.collections.reconstruction.metrics.evaluate.mse(gt: ndarray, pred: ndarray) float[source]

Compute Mean Squared Error (MSE)

mridc.collections.reconstruction.metrics.evaluate.nmse(gt: ndarray, pred: ndarray) float[source]

Compute Normalized Mean Squared Error (NMSE)

mridc.collections.reconstruction.metrics.evaluate.psnr(gt: ndarray, pred: ndarray, maxval: Optional[ndarray] = None) float[source]

Compute Peak Signal to Noise Ratio metric (PSNR)

mridc.collections.reconstruction.metrics.evaluate.ssim(gt: ndarray, pred: ndarray, maxval: Optional[ndarray] = None) float[source]

Compute Structural Similarity Index Metric (SSIM)

Module contents