facebookresearch / fastMRI

A large-scale dataset of both raw MRI measurements and clinical MRI images.
https://fastmri.org
MIT License
1.28k stars 371 forks source link

fixed apply mask #255

Closed zaccharieramzi closed 2 years ago

zaccharieramzi commented 2 years ago

This fixes the apply mask function for the case of single-coil data.

Currently, when using the fastmri data module, the returned k-space are all 0, because during the padding fixing phase, all mask values are set to 0.

I can provide a minimal reproducible example if needed and create the corresponding issue. This was such a minimal change that I didn't bother for now.

mmuckley commented 2 years ago

Hello @zaccharieramzi, thanks for finding this. As far as I can tell this feature is not used in any of the baseline examples, which might be why it was missed.

Would you be willing to write up a little unit test to make sure we don't have a regression for this function in the future? Could be a hand-coded apply_mask with padding where you know exactly what the output should be.

zaccharieramzi commented 2 years ago

Sure yes I can do that

zaccharieramzi commented 2 years ago

In the end I just took the structure of the other apply_mask unit test and adapter to make it fail on the previous version, and pass on this one.