Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added docs to write results function #118

Merged
merged 1 commit into from
Nov 27, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions fastmri_recon/evaluate/utils/write_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,24 @@ def _filename_submission(filename, brain=False):
return name

def write_result(exp_id, result, filename, coiltype='multicoil', scale_factor=1e6, brain=False, challenge=False):
"""Write a reconstruction result to the correct file.

Args:
exp_id (str): the name of the experiments generating the reconstruction,
typically the model name.
result (ndarray): the numpy array containing the reconstruction.
filename (str): the test or challenge filename from which the
reconstruction was generated.
coiltype (str): either `'singlecoil'`` or `'multicoil'``, indicating the type
of acquisition. Defaults to `'multicoil'``.
scale_factor (float): the scale factor used for the reconstruction.
The result will be divided by this scale factor before being saved.
Default to 1e6.
brain (bool): whether the reconstruction is from the brain dataset.
Defaults to False.
challenge (bool): whether the reconstruction is from the challenge
dataset. For now only applies for brain data. Defaults to False.
"""
if brain:
if challenge:
res_main_dir = f'{FASTMRI_DATA_DIR}brain_{coiltype}_challenge/'
Expand Down