zaccharieramzi / fastmri-reproducible-benchmark

Try several methods for MRI reconstruction on the fastmri dataset. Home to the XPDNet, runner-up of the 2020 fastMRI challenge.
https://fastmri.org/leaderboards
MIT License
151 stars 50 forks source link

How to predict using the XPDNet-brain-af4 model #186

Closed charmed-univie closed 7 months ago

charmed-univie commented 1 year ago

Hi, I've been trying to use your model XPDNet-brain-af4 on the fastmri brain dataset. However, I'm stuck at how to assign the shape variable in

model([
    kspace,  # shape: [n_slices, n_coils, n_rows, n_cols, 1]
    mask,  # shape: [n_slices, n_coils, n_rows, n_cols]
    smaps,  # shape: [n_slices, n_coils, n_rows, n_cols]
    shape,  # shape: [n_slices, 2]
])

When loading the datasets as in "fastmri_recon/evaluate/scripts/xpdnet_inference.py", only the kspace, mask and smaps is provided by the test_masked_kspace_dataset_from_indexable function.

Could you please help me? Thank you!

zaccharieramzi commented 11 months ago

Hi @charmed-univie ,

Thanks for your interest in this work! When you are using the brain models, you need to specify the shape of the output image as some cropping can happen for brain images. In the test_masked_kspace_dataset_from_indexable there is a flag output_shape_spec that you need to set to True when considering brain data. You can see it set here in the xpdnet_inference function where you need to set a flag called brain to True when using brain data. If you are using the CLI directly, don't forget to to use the -b flag.

Hope this helps, Cheers

charmed-univie commented 7 months ago

Hi, Thank you, for the helpful response, the issue is resolved.