Skip to content

Commit

Permalink
Minor change
Browse files Browse the repository at this point in the history
  • Loading branch information
georgeyiasemis committed Feb 1, 2024
1 parent d983ff0 commit ef6f359
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 10 additions & 2 deletions direct/data/mri_transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -2266,14 +2266,22 @@ def build_mri_transforms(
target_kspace_key=KspaceKey.MASKED_KSPACE,
),
]

if scaling_key == TransformKey.ACS_KSPACE:
mri_transforms += [
ApplyMask(
sampling_mask_key="acs_mask",
input_kspace_key=KspaceKey.KSPACE,
target_kspace_key=KspaceKey.ACS_KSPACE,
),
]

mri_transforms += [
ComputeScalingFactor(
normalize_key=scaling_key,
percentile=scale_percentile,
scaling_factor_key=TransformKey.SCALING_FACTOR,
),
Normalize(scaling_factor_key=TransformKey.SCALING_FACTOR),
Normalize(scaling_factor_key=None if scale_percentile is None else TransformKey.SCALING_FACTOR),
]

mri_transforms += [
Expand Down
2 changes: 2 additions & 0 deletions direct/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,14 @@ def __hash__(self) -> int:
class KspaceKey(DirectEnum):
KSPACE = "kspace"
MASKED_KSPACE = "masked_kspace"
ACS_KSPACE = "acs_kspace"


class TransformKey(DirectEnum):
SENSITIVITY_MAP = "sensitivity_map"
TARGET = "target"
KSPACE = "kspace"
ACS_KSPACE = "acs_kspace"
MASKED_KSPACE = "masked_kspace"
SAMPLING_MASK = "sampling_mask"
ACS_MASK = "acs_mask"
Expand Down

0 comments on commit ef6f359

Please sign in to comment.