Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
Jordan DeKraker - B. Bernhardt Lab committed Feb 21, 2024
1 parent ec0cb2e commit 25d1335
Show file tree
Hide file tree
Showing 14 changed files with 7 additions and 39 deletions.
1 change: 0 additions & 1 deletion hippunfold/dags/proc_subgraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
subgraphs = dict()

for smk in glob("../workflow/rules/*.smk"):

smk_name = re.findall(re.compile(r"/(\w+).smk"), smk)[0]

with open(smk, "r") as f:
Expand Down
12 changes: 0 additions & 12 deletions hippunfold/workflow/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -139,23 +139,11 @@ if config["modality"] == "hippb500":


include: "rules/autotop.smk"


include: "rules/warps.smk"


include: "rules/gifti.smk"


include: "rules/subfields.smk"


include: "rules/resample_final_to_crop_native.smk"


include: "rules/qc.smk"


include: "rules/myelin_map.smk"


Expand Down
2 changes: 0 additions & 2 deletions hippunfold/workflow/rules/common.smk
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ def get_modality_suffix(modality):


def get_final_spec():

if len(config["hemi"]) == 2:
specs = expand(
bids(
Expand Down Expand Up @@ -323,7 +322,6 @@ def get_final_subj_output():


def get_final_output():

if config["keep_work"]:
subj_output = get_final_subj_output()
else:
Expand Down
16 changes: 4 additions & 12 deletions hippunfold/workflow/rules/download.smk
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,9 @@ download_dir = get_download_dir()

rule download_extract_atlas:
params:
url=lambda wildcards: config["resource_urls"]["atlas"][
wildcards.atlas
],
url=lambda wildcards: config["resource_urls"]["atlas"][wildcards.atlas],
output:
unzip_dir=directory(
Path(download_dir) / "atlas" / "{atlas}"
),
unzip_dir=directory(Path(download_dir) / "atlas" / "{atlas}"),
container:
config["singularity"]["autotop"]
shadow:
Expand All @@ -23,13 +19,9 @@ rule download_extract_atlas:

rule download_extract_template:
params:
url=lambda wildcards: config["resource_urls"]["template"][
wildcards.template
],
url=lambda wildcards: config["resource_urls"]["template"][wildcards.template],
output:
unzip_dir=directory(
Path(download_dir) / "template" / "{template}"
),
unzip_dir=directory(Path(download_dir) / "template" / "{template}"),
container:
config["singularity"]["autotop"]
shadow:
Expand Down
2 changes: 0 additions & 2 deletions hippunfold/workflow/rules/nnunet.smk
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ def get_nnunet_input(wildcards):


def get_model_tar():

if config["force_nnunet_model"]:
model_name = config["force_nnunet_model"]
else:
Expand Down Expand Up @@ -201,7 +200,6 @@ rule unflip_nnunet_nii:


def get_f3d_ref(wildcards, input):

if config["modality"] == "T2w":
nii = Path(input.template_dir) / config["template_files"][config["template"]][
"crop_ref"
Expand Down
1 change: 0 additions & 1 deletion hippunfold/workflow/rules/preproc_t1.smk
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ else:


def reg_to_template_cmd(wildcards, input, output):

ref = str(
Path(input.template_dir)
/ config["template_files"][config["template"]][wildcards.modality].format(
Expand Down
2 changes: 0 additions & 2 deletions hippunfold/workflow/rules/preproc_t2.smk
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ rule reg_t2_to_ref:


def get_aligned_n4_t2(wildcards):

# first get the number of floating t2s
filtered = snakebids.filter_list(config["input_zip_lists"]["T2w"], wildcards)
num_scans = len(filtered["subject"])
Expand Down Expand Up @@ -278,7 +277,6 @@ def get_inputs_compose_t2_xfm_corobl(wildcards):
return {"t2_to_t1": t2_to_t1, "t1_to_cor": t1_to_cor}

else:

# xfm0: t2 to template
t2_to_std = (
bids(
Expand Down
1 change: 0 additions & 1 deletion hippunfold/workflow/rules/qc.smk
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ rule plot_subj_subfields:


def get_bg_img_for_subfield_qc(wildcards):

if config["modality"] == "hippb500":
return bids(
root=work,
Expand Down
1 change: 0 additions & 1 deletion hippunfold/workflow/rules/subfields.smk
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ rule label_subfields_from_vol_coords_corobl:


def get_tissue_atlas_remapping(wildcards):

mapping = config["tissue_atlas_mapping"]

remap = []
Expand Down
1 change: 0 additions & 1 deletion hippunfold/workflow/scripts/constrain_surf_to_bbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import numpy as np

with open(snakemake.log[0], "w") as sys.stdout:

epsilon = 0.01

# load gifti surf
Expand Down
4 changes: 3 additions & 1 deletion hippunfold/workflow/scripts/create_warps.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,9 @@ def summary(name, array):
summary("displace_to_unfold_vec", displace_to_unfold_vec)

# create new shape as 5d vector image in native space
native_map_shape = np.ones(5,)
native_map_shape = np.ones(
5,
)
native_map_shape[:3] = mask.shape
native_map_shape[-1] = 3

Expand Down
1 change: 0 additions & 1 deletion hippunfold/workflow/scripts/gen_volume_tsv.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@


for in_img, hemi in zip(snakemake.input.segs, hemis):

img_nib = nib.load(in_img)
img = img_nib.get_fdata()
zooms = img_nib.header.get_zooms()
Expand Down
1 change: 0 additions & 1 deletion hippunfold/workflow/scripts/laplace_coords.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@

# iterate until the solution doesn't change anymore (or reach max iters)
for i in range(max_iters):

# debug: save niftis to check progress
# if (i % 100 == 0):
# tonii = coords.copy()
Expand Down
1 change: 0 additions & 1 deletion hippunfold/workflow/scripts/laplace_coords_withinit.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@

# iterate until the solution doesn't change anymore (or reach max iters)
for i in range(max_iters):

# debug: save niftis to check progress
# if (i % 100 == 0):
# tonii = coords.copy()
Expand Down

0 comments on commit 25d1335

Please sign in to comment.