nvladimus / npy2bdv

Fast writing of numpy 3d-arrays into HDF5 Fiji/BigDataViewer files.
GNU General Public License v3.0
34 stars 11 forks source link

Bug with append_substack()? #17

Closed adamkglaser closed 7 months ago

adamkglaser commented 7 months ago

Was working with npy2bdv this past week and I think there may be a bug with append_substack()?

I think these lines: https://github.com/nvladimus/npy2bdv/blob/e7bdce7d88aa12e2329244b76bcaff9d58685b09/npy2bdv/npy2bdv.py#L444-L446

Should include downsampling in the indices such as?

sub_z_start = int(z_start/2**ilevel)
sub_y_start = int(y_start/2**ilevel)
sub_x_start = int(x_start/2**ilevel)
dataset[sub_z_start : sub_z_start + subdata.shape[0],
        sub_y_start : sub_y_start + subdata.shape[1],
        sub_x_start : sub_x_start + subdata.shape[2]] = subdata
nvladimus commented 7 months ago

Hi, Adam! Good catch, indeed! I will fix it and write some tests to make sure it is solved.

nvladimus commented 7 months ago

Fixed, pushed to master.