Skip to content

Commit

Permalink
(bugfix): Reading chunk layout correctly (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
sameeul authored Dec 24, 2024
1 parent e48d253 commit 591d71e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/cpp/core/chunked_base_to_pyr_gen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ void ChunkedBaseToPyramid::WriteDownsampledImage( const std::string& input_fil
tensorstore::OpenMode::open,
tensorstore::ReadWriteMode::read).result());
auto prev_image_shape = store1.domain().shape();
auto read_chunk_shape = store1.chunk_layout().value().read_chunk_shape();

auto prev_x_max = static_cast<std::int64_t>(prev_image_shape[x_dim]);
auto prev_y_max = static_cast<std::int64_t>(prev_image_shape[y_dim]);
Expand All @@ -154,9 +153,9 @@ void ChunkedBaseToPyramid::WriteDownsampledImage( const std::string& input_fil

new_image_shape[y_dim] = cur_y_max;
new_image_shape[x_dim] = cur_x_max;

chunk_shape[y_dim] = static_cast<std::int64_t>(read_chunk_shape[y_dim]);
chunk_shape[x_dim] = static_cast<std::int64_t>(read_chunk_shape[x_dim]);
auto chunk_layout = store1.chunk_layout().value();
chunk_shape[y_dim] = static_cast<std::int64_t>(chunk_layout.read_chunk_shape()[y_dim]);
chunk_shape[x_dim] = static_cast<std::int64_t>(chunk_layout.read_chunk_shape()[x_dim]);

auto num_rows = static_cast<std::int64_t>(ceil(1.0*cur_y_max/chunk_shape[y_dim]));
auto num_cols = static_cast<std::int64_t>(ceil(1.0*cur_x_max/chunk_shape[x_dim]));
Expand Down

0 comments on commit 591d71e

Please sign in to comment.