@@ -148,7 +148,7 @@ def _descriptor_fun(img, properties):
148
148
return props_arr
149
149
150
150
# Check it works properly for many images (do it manually)
151
- img = mascdb .da .isel (CAM_ID = 0 , TripletID = 0 ).values
151
+ img = mascdb .da .isel (cam_id = 0 , flake_id = 0 ).values
152
152
props_arr = _descriptor_fun (img = img , properties = properties )
153
153
154
154
# Check that it works for a subset of mascdb (first 100, then 1000) to
@@ -157,24 +157,24 @@ def _descriptor_fun(img, properties):
157
157
# http://image.dask.org/en/latest/coverage.html for dask-optimized image processing functions
158
158
159
159
# properties = ["area"]
160
- da = mascdb .da .isel (TripletID = slice (0 ,100 ))
160
+ da = mascdb .da .isel (flake_id = slice (0 ,100 ))
161
161
x = "x"
162
162
y = "y"
163
163
fun_kwargs = {'properties' : properties }
164
164
fun = _descriptor_fun
165
165
labels = properties
166
166
167
- da_descriptors = _compute_2Dimage_descriptors (da = mascdb .da .isel (TripletID = slice (0 ,100 )),
167
+ da_descriptors = _compute_2Dimage_descriptors (da = mascdb .da .isel (flake_id = slice (0 ,100 )),
168
168
fun = _descriptor_fun ,
169
169
labels = labels ,
170
170
fun_kwargs = fun_kwargs )
171
171
172
- da_descriptors = _compute_2Dimage_descriptors (da = mascdb .da .isel (TripletID = slice (0 ,500 )),
172
+ da_descriptors = _compute_2Dimage_descriptors (da = mascdb .da .isel (flake_id = slice (0 ,500 )),
173
173
fun = _descriptor_fun ,
174
174
labels = labels ,
175
175
fun_kwargs = fun_kwargs )
176
176
177
- da_descriptors = _compute_2Dimage_descriptors (da = mascdb .da .isel (TripletID = slice (0 ,1000 )),
177
+ da_descriptors = _compute_2Dimage_descriptors (da = mascdb .da .isel (flake_id = slice (0 ,1000 )),
178
178
fun = _descriptor_fun ,
179
179
labels = labels ,
180
180
fun_kwargs = fun_kwargs )
@@ -195,9 +195,9 @@ def _descriptor_fun(img, properties):
195
195
196
196
#-----------------------------------------------------------------------------.
197
197
# Apply descriptors manually to mascdb
198
- cam0 = da_descriptors .isel (CAM_ID = 0 ).to_dataset ('descriptor' ).to_pandas ().drop (columns = 'CAM_ID ' )
199
- cam1 = da_descriptors .isel (CAM_ID = 1 ).to_dataset ('descriptor' ).to_pandas ().drop (columns = 'CAM_ID ' )
200
- cam2 = da_descriptors .isel (CAM_ID = 2 ).to_dataset ('descriptor' ).to_pandas ().drop (columns = 'CAM_ID ' )
198
+ cam0 = da_descriptors .isel (cam_id = 0 ).to_dataset ('descriptor' ).to_pandas ().drop (columns = 'cam_id ' )
199
+ cam1 = da_descriptors .isel (cam_id = 1 ).to_dataset ('descriptor' ).to_pandas ().drop (columns = 'cam_id ' )
200
+ cam2 = da_descriptors .isel (cam_id = 2 ).to_dataset ('descriptor' ).to_pandas ().drop (columns = 'cam_id ' )
201
201
new_mascdb = mascdb .add_cam_columns (cam0 = cam0 , cam1 = cam1 , cam2 = cam2 , force = False , complete = True )
202
202
203
203
#-----------------------------------------------------------------------------.
@@ -237,7 +237,7 @@ def _descriptor_fun(img, properties):
237
237
from mascdb .utils_img import xri_local_hist_equalization
238
238
239
239
mascdb = mascdb .arrange ('cam0.Dmax' , decreasing = True )
240
- da = mascdb .da .isel (CAM_ID = 0 , TripletID = 0 )
240
+ da = mascdb .da .isel (cam_id = 0 , TripletID = 0 )
241
241
242
242
### Comparison
243
243
img = da .values
@@ -261,12 +261,12 @@ def _descriptor_fun(img, properties):
261
261
# Random plots
262
262
x = 'x'
263
263
y = 'y'
264
- da = mascdb .da .isel (CAM_ID = 0 , TripletID = 1000 )
265
- da .plot .imshow (x = x , y = y , row = "TripletID " , col = "CAM_ID " , vmin = 0 , vmax = 255 , cmap = "gray" )
266
- xri_contrast_stretching (da , pmin = 2 , pmax = 98 ).plot .imshow (x = x , y = y , row = "TripletID " , col = "CAM_ID " , vmin = 0 , vmax = 255 , cmap = "gray" )
267
- xri_hist_equalization (da , adaptive = False ).plot .imshow (x = x , y = y , row = "TripletID " , col = "CAM_ID " , vmin = 0 , vmax = 255 , cmap = "gray" )
268
- xri_hist_equalization (da , adaptive = True ).plot .imshow (x = x , y = y , row = "TripletID " , col = "CAM_ID " , vmin = 0 , vmax = 255 , cmap = "gray" )
264
+ da = mascdb .da .isel (cam_id = 0 , flake_id = 1000 )
265
+ da .plot .imshow (x = x , y = y , row = "flake_id " , col = "cam_id " , vmin = 0 , vmax = 255 , cmap = "gray" )
266
+ xri_contrast_stretching (da , pmin = 2 , pmax = 98 ).plot .imshow (x = x , y = y , row = "flake_id " , col = "cam_id " , vmin = 0 , vmax = 255 , cmap = "gray" )
267
+ xri_hist_equalization (da , adaptive = False ).plot .imshow (x = x , y = y , row = "flake_id " , col = "cam_id " , vmin = 0 , vmax = 255 , cmap = "gray" )
268
+ xri_hist_equalization (da , adaptive = True ).plot .imshow (x = x , y = y , row = "flake_id " , col = "cam_id " , vmin = 0 , vmax = 255 , cmap = "gray" )
269
269
# Slow !!!
270
- xri_local_hist_equalization (da ).plot .imshow (x = x , y = y , row = "TripletID " , col = "CAM_ID " , vmin = 0 , vmax = 255 , cmap = "gray" )
270
+ xri_local_hist_equalization (da ).plot .imshow (x = x , y = y , row = "flake_id " , col = "cam_id " , vmin = 0 , vmax = 255 , cmap = "gray" )
271
271
272
272
#-----------------------------------------------------------------------------.
0 commit comments