Skip to content

Commit

Permalink
removed epsilon and unused variables
Browse files Browse the repository at this point in the history
  • Loading branch information
Jordan DeKraker committed Jun 26, 2024
1 parent 24bc9e3 commit 35806ce
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 26 deletions.
4 changes: 0 additions & 4 deletions hippunfold/config/snakebids.yml
Original file line number Diff line number Diff line change
Expand Up @@ -608,10 +608,6 @@ unfold_vol_ref:
- '2.5'
orient: RPI

unfold_crop_epsilon_fractions:
- 0
- 0
- 0.0625 #1/16

# space for uniform unfolded grid:
# currently only used for interpolating hipp subfields on surface
Expand Down
2 changes: 0 additions & 2 deletions hippunfold/workflow/rules/warps.smk
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ rule create_warps_hipp:
labelmap=get_labels_for_laplace,
params:
gm_labels=lambda wildcards: config["laplace_labels"]["AP"]["gm"],
epsilon=lambda wildcards: config["unfold_crop_epsilon_fractions"],
resources:
mem_mb=16000,
output:
Expand Down Expand Up @@ -294,7 +293,6 @@ rule create_warps_dentate:
labelmap=get_labels_for_laplace,
params:
gm_labels=lambda wildcards: config["laplace_labels"]["PD"]["sink"],
epsilon=lambda wildcards: config["unfold_crop_epsilon_fractions"],
resources:
mem_mb=16000,
output:
Expand Down
25 changes: 5 additions & 20 deletions hippunfold/workflow/scripts/create_warps.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,26 +105,7 @@ def summary(name, array):
coord_flat_pd_unnorm = coord_flat_pd * unfold_dims[1]
coord_flat_io_unnorm = coord_flat_io * unfold_dims[2]

# get unfolded grid (from 0 to 1, not world coords), using meshgrid:
# note: indexing='ij' to swap the ordering of x and y
epsilon = snakemake.params.epsilon
(unfold_gx, unfold_gy, unfold_gz) = np.meshgrid(
np.linspace(
0 + float(epsilon[0]), unfold_dims[0] - float(epsilon[0]), unfold_dims[0]
),
np.linspace(
0 + float(epsilon[1]), unfold_dims[1] - float(epsilon[1]), unfold_dims[1]
),
np.linspace(
0 + float(epsilon[2]), unfold_dims[2] - float(epsilon[2]), unfold_dims[2]
),
indexing="ij",
)
summary("unfold_gx", unfold_gx)
summary("unfold_gy", unfold_gy)
summary("unfold_gz", unfold_gz)

# perform the interpolation
# get unfolded grid

points = np.stack(
[
Expand All @@ -137,6 +118,10 @@ def summary(name, array):
],
axis=1,
)
summary("points", points)


# perform the interpolation

interp_ap = naturalneighbor.griddata(
points,
Expand Down

0 comments on commit 35806ce

Please sign in to comment.