Skip to content

Commit

Permalink
Merge pull request #38 from akhanf/linting-fix
Browse files Browse the repository at this point in the history
linting fix, check wasn't run on the PR
  • Loading branch information
akhanf authored Jan 24, 2023
2 parents 6b2a256 + 2c72959 commit 9421fd4
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions snakedwi/workflow/scripts/get_phase_encode_txt.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
imsize = np.array(bzero.header.get_data_shape())

if "PhaseEncodingDirection" in json_dwi:
phenc_axis = json_dwi["PhaseEncodingDirection"][0]
phenc_string = "PhaseEncodingDirection"
phenc_axis = json_dwi["PhaseEncodingDirection"][0]
phenc_string = "PhaseEncodingDirection"
elif "PhaseEncodingAxis" in json_dwi:
phenc_axis = json_dwi["PhaseEncodingAxis"][0] # either i, j, k
phenc_string = "PhaseEncodingAxis"
phenc_axis = json_dwi["PhaseEncodingAxis"][0] # either i, j, k
phenc_string = "PhaseEncodingAxis"

if phenc_axis == "i":
vec = np.array([1, 0, 0])
elif phenc_axis == "j":
Expand Down Expand Up @@ -48,15 +48,17 @@
print("Estimtated Effective Echo Spacing found, using that")
phenc_line = np.hstack(
[vec, np.array(json_dwi["EstimatedEffectiveEchoSpacing"] * numPhaseEncodes)]
)
)
else:
print("EffectiveEchoSpacing not defined in JSON, using default value")
json_dwi["EffectiveEchoSpacing"] = snakemake.config["default_effective_echo_spacing"]

json_dwi["EffectiveEchoSpacing"] = snakemake.config[
"default_effective_echo_spacing"
]

# create the phenc_line row
#phenc_line = np.hstack(
# phenc_line = np.hstack(
# [vec, np.array(json_dwi["EffectiveEchoSpacing"] * numPhaseEncodes)]
#)
# )

# replicate to the number of volumes, if it is 4d
if len(imsize) == 4:
Expand Down

0 comments on commit 9421fd4

Please sign in to comment.