Hi Dr. Cox and Dr. Treeby,
I want to check where the origin of the 'kgrid' defined in k-Wave is. Say the grid is 64x64x64, is the origin at (32,32,32) or (33,33,33)?
If the grid size changes to 65x65x65, is the origin at (33,33,33)?
Thanks,
Chao
Hi Dr. Cox and Dr. Treeby,
I want to check where the origin of the 'kgrid' defined in k-Wave is. Say the grid is 64x64x64, is the origin at (32,32,32) or (33,33,33)?
If the grid size changes to 65x65x65, is the origin at (33,33,33)?
Thanks,
Chao
Hi Chao,
Thanks for your question and sorry for the delay! The origin is at floor(kgrid.Nx/2) + 1
. This means for even grid sizes, the origin is will be shifted to the right (so 33, 33, 33 in your example), and for odd grid sizes, the origin will be exactly in the centre. However, if you're not using a Cartesian sensor mask and functions like cart2grid
etc, you can assume any grid ordering you like, as the values for kgrid.x (etc) don't have an effect on the outputs.
Actually, while double checking something for your question, I noticed there is a bug in the current version of k-Wave (B.0.5) for odd grid sizes. I have added the details to the list of known issues.
Brad.
Hi, Dr. Treeby,
In this case, I guess, in the line 106 of the '2D Time Reversal Reconstruction For A Circular Sensor Example', 'kgrid_recon.Nx/2, kgrid_recon.Ny/2' should be replace by 'kgrid_recon.Nx/2+1, kgrid_recon.Ny/2+1'.
Chao
You must log in to post.