@@ -97,7 +97,7 @@ def __init__(self, yaml_config: str, create=True):
9797 self .inferencer = Inferencer (self .model_config )
9898
9999 self .idi_raw = ImageDataInterface (
100- self .input_path , target_resolution = self .input_voxel_size
100+ self .input_path , voxel_size = self .input_voxel_size
101101 )
102102 self .output_arrays = []
103103
@@ -112,16 +112,19 @@ def __init__(self, yaml_config: str, create=True):
112112 print (f"output_path: { self .output_path } " )
113113 for channel in self .output_channels :
114114 if create :
115- array = prepare_ds (
116- DirectoryStore (self .output_path / channel / "s0" ),
117- output_shape ,
118- dtype = self .dtype ,
119- chunk_shape = self .block_shape ,
120- voxel_size = self .output_voxel_size ,
121- axis_names = ["z" , "y" , "x" ],
122- units = ["nm" , "nm" , "nm" ],
123- offset = (0 , 0 , 0 ),
124- )
115+ try :
116+ array = prepare_ds (
117+ DirectoryStore (self .output_path / channel / "s0" ),
118+ output_shape ,
119+ dtype = self .dtype ,
120+ chunk_shape = self .block_shape ,
121+ voxel_size = self .output_voxel_size ,
122+ axis_names = ["z" , "y" , "x" ],
123+ units = ["nm" , "nm" , "nm" ],
124+ offset = (0 , 0 , 0 ),
125+ )
126+ except Exception as e :
127+ raise Exception (f"Failed to prepare { self .output_path / channel / 's0' } \n try deleting it manually and run again ! { e } " )
125128 else :
126129 try :
127130 array = open_ds (
@@ -130,11 +133,11 @@ def __init__(self, yaml_config: str, create=True):
130133 )
131134 except Exception as e :
132135 raise Exception (f"Failed to open { self .output_path / channel } \n { e } " )
133- self .outpout_arrays .append (array )
136+ self .output_arrays .append (array )
134137
135138 def process_fn (self , block ):
136139
137- write_roi = block .write_roi .intersect (self .outpout_arrays [0 ].roi )
140+ write_roi = block .write_roi .intersect (self .output_arrays [0 ].roi )
138141
139142 if write_roi .empty :
140143 print (f"empty write roi: { write_roi } " )
@@ -144,10 +147,10 @@ def process_fn(self, block):
144147
145148 chunk_data = chunk_data .astype (self .dtype )
146149
147- # if self.outpout_arrays [0][block.write_roi].any():
150+ # if self.output_arrays [0][block.write_roi].any():
148151 # return
149152
150- for i , array in enumerate (self .outpout_arrays ):
153+ for i , array in enumerate (self .output_arrays ):
151154
152155 if chunk_data .shape == 3 :
153156 if len (self .output_channels ) > 1 :
0 commit comments