Skip to content

Commit

Permalink
removed epsilon from warps
Browse files Browse the repository at this point in the history
  • Loading branch information
Jordan DeKraker committed Dec 22, 2024
1 parent ba0babf commit eeb3367
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 17 deletions.
8 changes: 8 additions & 0 deletions hippunfold/workflow/rules/native_surf.smk
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,8 @@ rule compute_halfthick_mask:
),
group:
"subj"
container:
config["singularity"]["autotop"]
shell:
"c3d {input.coords} -threshold {params.threshold_tofrom} 1 0 {input.mask} -multiply -o {output}"

Expand Down Expand Up @@ -454,6 +456,8 @@ rule register_midthickness:
),
group:
"subj"
container:
config["singularity"]["autotop"]
shell:
"greedy -d 3 -i {input.fixed} {input.moving} -n 30 -o {output.warp}"

Expand Down Expand Up @@ -508,6 +512,8 @@ rule apply_halfsurf_warp_to_img:
),
group:
"subj"
container:
config["singularity"]["autotop"]
shell:
"greedy -d 3 -rf {input.fixed} -rm {input.moving} {output.warped} -r {input.warp} "

Expand Down Expand Up @@ -541,6 +547,8 @@ rule convert_warp_from_itk_to_world:
),
group:
"subj"
container:
config["singularity"]["autotop"]
shell:
"wb_command -convert-warpfield -from-itk {input} -to-world {output}"

Expand Down
17 changes: 0 additions & 17 deletions hippunfold/workflow/scripts/create_warps.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,23 +159,6 @@ def summary(name, array):
+ (np.random.rand(coord_flat_ap.shape[0]) - 0.5) * 1e-6,
)

# 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("points", points)


# perform the interpolation

Expand Down

0 comments on commit eeb3367

Please sign in to comment.