@@ -104,6 +104,8 @@ class SlidingWindowDataset(Dataset):
104
104
:param ChannelMap channels: source and target channel names,
105
105
e.g. ``{'source': 'Phase', 'target': ['Nuclei', 'Membrane']}``
106
106
:param int z_window_size: Z window size of the 2.5D U-Net, 1 for 2D
107
+ :param int pyramid_resolution: pyramid level.
108
+ defaults to 0 (full resolution)
107
109
:param DictTransform | None transform:
108
110
a callable that transforms data, defaults to None
109
111
"""
@@ -113,16 +115,21 @@ def __init__(
113
115
positions : list [Position ],
114
116
channels : ChannelMap ,
115
117
z_window_size : int ,
118
+ pyramid_resolution : int = 0 ,
116
119
transform : DictTransform | None = None ,
117
120
) -> None :
118
121
super ().__init__ ()
119
122
self .positions = positions
120
123
self .channels = {k : _ensure_channel_list (v ) for k , v in channels .items ()}
121
124
self .source_ch_idx = [
122
- positions [0 ].get_channel_index (c ) for c in channels ["source" ]
125
+ positions [pyramid_resolution ].get_channel_index (c )
126
+ for c in channels ["source" ]
123
127
]
124
128
self .target_ch_idx = (
125
- [positions [0 ].get_channel_index (c ) for c in channels ["target" ]]
129
+ [
130
+ positions [pyramid_resolution ].get_channel_index (c )
131
+ for c in channels ["target" ]
132
+ ]
126
133
if "target" in channels
127
134
else None
128
135
)
@@ -301,6 +308,8 @@ class HCSDataModule(LightningDataModule):
301
308
:param Path | None ground_truth_masks: path to the ground truth masks,
302
309
used in the test stage to compute segmentation metrics,
303
310
defaults to None
311
+ :param int pyramid_resolution: pyramid resolution level.
312
+ defaults to 0 (full resolution)
304
313
"""
305
314
306
315
def __init__ (
@@ -318,6 +327,7 @@ def __init__(
318
327
augmentations : list [MapTransform ] = [],
319
328
caching : bool = False ,
320
329
ground_truth_masks : Path | None = None ,
330
+ pyramid_resolution : int = 0 ,
321
331
):
322
332
super ().__init__ ()
323
333
self .data_path = Path (data_path )
0 commit comments