1

Suppose I have an 3d array with the size of (100,100,100), I would like to overlay or copy this array centered at various points (with the range of 0-100 in all directions) in space and the resulting 3d array has a size of (100,100,100). Any point near the edges of the array will be concatenated to maintain the resulting size of the array

I wrote this manually, by finding the range of the array index and coping it over but I suspect there is a easier way.

arr1.shape (100, 100, 100)

point[0] = [5.5, 45.32, 35.0] ... point[n] = [85.0, 15,2, 90.1]

arr2 = np.zeros((100,100,100),float) for each point I will mannualy find and copy over arr2[minx:maxx,miny:maxy,minz,maxz] = arr1[minx:maxx,miny:maxy,minz,maxz] where min and max are index of the arrays.

Yes I am trying to convolve this kernel to the points. I looked into numpy.convolve but don't know how I would go about doing it with scipy.

1
  • and also please define "space" Commented Jul 17, 2012 at 15:00

1 Answer 1

0

It sounds like you are trying to do a convolution. Does scipy.ndimage.convolve work for you?

Sign up to request clarification or add additional context in comments.

1 Comment

I am trying to convolve but couldn't get it to work so ended up manually looping over and adding the pixels manually.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.