for i in range(1, nslices / 2 + nslices % 2 + 1)[::-1]:
slices.append(binary_erosion(sl2, iterations=i))
slices.append(sl2)
return numpy.asarray([sl.T for sl in slices]).T
elif 0 ==numpy.count_nonzero(sl2):
slices = [sl1]
for i in range(1, nslices / 2 + 1):
slices.append(binary_erosion(sl1, iterations=i))
After Change
for i in range(1, nslices / 2 + nslices % 2 + 1)[::-1]:
slices.append(binary_erosion(sl2, iterations=i))
slices.append(sl2)
return numpy.rollaxis(numpy.asarray(slices), 0, dim + 1)
//return numpy.asarray([sl.T for sl in slices]).T
elif 0 ==numpy.count_nonzero(sl2):
slices = [sl1]
for i in range(1, nslices / 2 + 1):