Skip to content

Commit

Permalink
Cosmetic changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasteuwen committed Aug 16, 2020
1 parent 208615e commit 58d39cc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion direct/data/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ def __getitem__(self, idx: int) -> Dict[str, Any]:
# Some images have strange behavior.
image_shape = sample["kspace"].shape

if image_shape[-1] < sample["reconstruction_size"][-2]: # reconstruction size is (x, y, z)
if (
image_shape[-1] < sample["reconstruction_size"][-2]
): # reconstruction size is (x, y, z)
warnings.warn(
f"Encountered {sample['filename']} with header reconstruction size {sample['reconstruction_size']}, "
f" yet matrix size is {image_shape}, this is a known issue in the FastMRI dataset."
Expand Down
6 changes: 4 additions & 2 deletions direct/nn/rim/rim_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,10 @@ def evaluate(
data = AddNames()(data)
filenames = data.pop("filename")
if len(set(filenames)) != 1:
raise ValueError(f"Expected a batch during validation to only contain filenames of one case. "
f"Got {set(filenames)}.")
raise ValueError(
f"Expected a batch during validation to only contain filenames of one case. "
f"Got {set(filenames)}."
)

slice_nos = data.pop("slice_no")
scaling_factors = data.pop("scaling_factor")
Expand Down

0 comments on commit 58d39cc

Please sign in to comment.