cvnlab / nsdcode

Code related to analyzing the Natural Scenes Dataset
BSD 2-Clause "Simplified" License
30 stars 8 forks source link

fix: off-by-one error at edge of volume #22

Closed raj-magesh closed 11 months ago

raj-magesh commented 1 year ago

Closes https://github.com/cvnlab/nsdcode/issues/21.

Fixes an off-by-one error caused by conversion from MATLAB to Python indexing.

kendrickkay commented 1 year ago

I looked over, but not 100% sure of correctness. In particular, should ">= vol.shape[0]" be "> vol.shape[0]-1", possibly?

raj-magesh commented 1 year ago

I looked over, but not 100% sure of correctness. In particular, should ">= vol.shape[0]" be "> vol.shape[0]-1", possibly?

Yup, my bad. Didn't realize that coordinates could contain floats.

iancharest commented 1 year ago

Hmm, I am not sure I follow why we set the bad coords to -1. Could we make a small test case for this such that we can compare the outputs in matlab and python?

raj-magesh commented 1 year ago

Hmm, I am not sure I follow why we set the bad coords to -1. Could we make a small test case for this such that we can compare the outputs in matlab and python?

I just saw the 1 and assumed that any voxels set to that value were meant to be removed by the np.c_ call, but I realize that bad is included there anyway. Not sure if it's still necessary (or if it was before).

I'll write a quick test later when I get the time.