I use a histogramdd 3D binning grid to apply the box counting method (laying grids of multiple sizes on an object and counting how many grid cells intersect with the object) on a 3D numpy array (representing a 3D object made out of voxels).
For the method it is important to find the minimum amount of intersecting boxes for different grid offsets and different grid angles. I achieve the first requirement (offset / translation of the grid) but I can't find a way to rotate the grid (angle). In histogramdd one defines the binning grid by giving the binning edges in the needed dimensions (in my case x, y and z). However to my knowledge there is no way to set a rotation angle for the binning grid or to make the grid non-orthogonal (for example to set the x-binning edges at the beginning of the grid and then set the x-binning edges at the end of the grid with an offset).
Does someone know if there is a way to do this, which I am not aware of, or is there another python function with equivalent effect (creating a "measuring" grid and checking for every grid cell if it contains points/ voxels of the input object)?
P.s there is a post with the same question from 3 years ago (NumPy histogram2d with a rotated, non-orthogonal binning grid), however the answer stated there is to rotate the object, not the grid. I tried this in my case with scipy.ndimage.rotate but my tests with the box counting method don't yield the right result. The reason for this is I suspect because the rotation of the 3D object always has a slight inaccuracy because of the interpolation.