Skip to content

Commit 7cf8c8f

Browse files
committed
Added zero-tile checks in a couple places
1 parent db1b0a0 commit 7cf8c8f

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

build_raw_tile_index.m

+3
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828
xyz_from_tile_index = index_as_struct.xyz_from_tile_index ;
2929
relative_path_from_tile_index = index_as_struct.relative_path_from_tile_index ;
3030
tile_count = length(relative_path_from_tile_index) ;
31+
if tile_count==0 ,
32+
error('Found zero tiles!') ;
33+
end
3134

3235
% Shift the lattice coordinates so the lowest one in the bounding cuboid is [1 1 1]
3336
min_raw_tile_ijk1 = min(raw_tile_ijk1_from_tile_index, [], 1) ;

check-tiles/check_tiles.m

+11-4
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,18 @@ function check_tiles(sample_date_as_string, do_show_progress)
55

66
% Determine where the raw tiles are
77
raw_tile_root_path_template = '/groups/mousebrainmicro/mousebrainmicro/data/%s/Tiling' ;
8-
raw_tile_root_path = sprintf(raw_tile_root_path_template, sample_date_as_string) ;
8+
raw_tile_root_path_1 = sprintf(raw_tile_root_path_template, sample_date_as_string) ;
99
% Sometimes they use a "Tiling" folder, sometimes not...
10-
if ~exist(raw_tile_root_path, 'file') ,
11-
raw_tile_root_path_template = '/groups/mousebrainmicro/mousebrainmicro/data/acquisition/%s' ;
12-
raw_tile_root_path = sprintf(raw_tile_root_path_template, sample_date_as_string) ;
10+
if exist(raw_tile_root_path_1, 'file') ,
11+
raw_tile_root_path = raw_tile_root_path_1 ;
12+
else
13+
raw_tile_root_path_template = '/groups/mousebrainmicro/mousebrainmicro/data/%s' ;
14+
raw_tile_root_path_2 = sprintf(raw_tile_root_path_template, sample_date_as_string) ;
15+
if exist(raw_tile_root_path_2, 'file') ,
16+
raw_tile_root_path = raw_tile_root_path_2 ;
17+
else
18+
error('Neither %s nor %s exists', raw_tile_root_path_1, raw_tile_root_path_2) ;
19+
end
1320
end
1421

1522
% Build the tile index

0 commit comments

Comments
 (0)