Skip to content

Commit c5ed84e

Browse files
committed
Linting
1 parent b90687b commit c5ed84e

File tree

4 files changed

+14
-10
lines changed

4 files changed

+14
-10
lines changed

flamingo_tools/segmentation/postprocessing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,7 @@ def filter_cochlea_volume(
717717
resolution: float = 0.38,
718718
dilation_iterations: int = 12,
719719
padding: int = 1200,
720-
dilation_method = "individual",
720+
dilation_method: str = "individual",
721721
) -> np.ndarray:
722722
"""Filter cochlea volume with SGN and IHC segmentation.
723723
Centroids contained in the segmentation tables are used to create down-scaled binary arrays.

scripts/export_lower_resolution.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -127,18 +127,18 @@ def upscale_volume(
127127
def export_lower_resolution(args):
128128
# calculate single filter mask for all lower resolutions
129129
if args.filter_cochlea_channels is not None:
130-
ds_factor = 48
131-
filter_volume = filter_cochlea(args.cochlea, args.filter_cochlea_channels,
132-
sgn_components=args.filter_sgn_components,
133-
ihc_components=args.filter_ihc_components,
134-
dilation_iterations=args.filter_dilation_iterations, ds_factor=ds_factor)
135-
filter_volume = np.transpose(filter_volume, (2,1,0))
130+
ds_factor = 48
131+
filter_volume = filter_cochlea(args.cochlea, args.filter_cochlea_channels,
132+
sgn_components=args.filter_sgn_components,
133+
ihc_components=args.filter_ihc_components,
134+
dilation_iterations=args.filter_dilation_iterations, ds_factor=ds_factor)
135+
filter_volume = np.transpose(filter_volume, (2, 1, 0))
136136

137137
# iterate through exporting lower resolutions
138138
for scale in args.scale:
139139
if args.filter_cochlea_channels is not None:
140140
output_folder = os.path.join(args.output_folder, args.cochlea,
141-
f"scale{scale}_dilation{args.filter_dilation_iterations}")
141+
f"scale{scale}_dilation{args.filter_dilation_iterations}")
142142
else:
143143
output_folder = os.path.join(args.output_folder, args.cochlea, f"scale{scale}")
144144
os.makedirs(output_folder, exist_ok=True)

scripts/training/sgn_domain_adaptation_gerbil_CR.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ def get_paths():
2020
def run_training(name):
2121
patch_shape = (64, 128, 128)
2222
batch_size = 8
23-
source_checkpoint = "/mnt/vast-nhr/projects/nim00007/data/moser/cochlea-lightsheet/trained_models/SGN/v2_cochlea_distance_unet_SGN_supervised_2025-05-27"
23+
source_checkpoint = os.path.join("/mnt/vast-nhr/projects/nim00007/data/moser/cochlea-lightsheet",
24+
"trained_models/SGN",
25+
"v2_cochlea_distance_unet_SGN_supervised_2025-05-27")
2426

2527
train_paths, val_paths = get_paths()
2628
mean_teacher_training(

scripts/training/sgn_domain_adaptation_gerbil_PV.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ def get_paths():
2020
def run_training(name):
2121
patch_shape = (64, 128, 128)
2222
batch_size = 8
23-
source_checkpoint = "/mnt/vast-nhr/projects/nim00007/data/moser/cochlea-lightsheet/trained_models/SGN/v2_cochlea_distance_unet_SGN_supervised_2025-05-27"
23+
source_checkpoint = os.path.join("/mnt/vast-nhr/projects/nim00007/data/moser/cochlea-lightsheet",
24+
"trained_models/SGN",
25+
"v2_cochlea_distance_unet_SGN_supervised_2025-05-27")
2426

2527
train_paths, val_paths = get_paths()
2628
mean_teacher_training(

0 commit comments

Comments
 (0)