From 35806ce2c57bc071d705d1284b94a7027eeba33d Mon Sep 17 00:00:00 2001 From: Jordan DeKraker Date: Wed, 26 Jun 2024 12:24:55 -0400 Subject: [PATCH] removed epsilon and unused variables --- hippunfold/config/snakebids.yml | 4 ---- hippunfold/workflow/rules/warps.smk | 2 -- hippunfold/workflow/scripts/create_warps.py | 25 +++++---------------- 3 files changed, 5 insertions(+), 26 deletions(-) diff --git a/hippunfold/config/snakebids.yml b/hippunfold/config/snakebids.yml index d3a3f1bc..c374ab19 100644 --- a/hippunfold/config/snakebids.yml +++ b/hippunfold/config/snakebids.yml @@ -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 diff --git a/hippunfold/workflow/rules/warps.smk b/hippunfold/workflow/rules/warps.smk index 47501f12..1dd4a1d4 100644 --- a/hippunfold/workflow/rules/warps.smk +++ b/hippunfold/workflow/rules/warps.smk @@ -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: @@ -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: diff --git a/hippunfold/workflow/scripts/create_warps.py b/hippunfold/workflow/scripts/create_warps.py index 57e47246..7c6df89e 100644 --- a/hippunfold/workflow/scripts/create_warps.py +++ b/hippunfold/workflow/scripts/create_warps.py @@ -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( [ @@ -137,6 +118,10 @@ def summary(name, array): ], axis=1, ) +summary("points", points) + + +# perform the interpolation interp_ap = naturalneighbor.griddata( points,