[Scipy-tickets] [SciPy] #796: ndimage.shift destroys data from edges

SciPy scipy-tickets@scipy....
Sat Nov 22 16:27:35 CST 2008


#796: ndimage.shift destroys data from edges
---------------------------+------------------------------------------------
 Reporter:  0ion9          |       Owner:  somebody
     Type:  defect         |      Status:  new     
 Priority:  normal         |   Milestone:          
Component:  scipy.ndimage  |     Version:  devel   
 Severity:  normal         |    Keywords:          
---------------------------+------------------------------------------------
 Try the following:



 {{{
 import numpy as np
 import scipy.ndimage as sni
 a = np.arange (16).reshape (4,4)
 sni.shift (a, [0, 1], mode = 'wrap', order = 1, prefilter = False)

 }}}


 it prints :


 {{{
 array([[ 2,  0,  1,  2],
        [ 6,  4,  5,  6],
        [10,  8,  9, 10],
        [14, 12, 13, 14]])
 }}}


 when I am expecting


 {{{
 array([[ 3,  0,  1,  2],
        [ 7,  4,  5,  6],
        [11,  8,  9, 10],
        [15, 12, 13, 14]])


 }}}

 This wrong behaviour is observable on all edges, depending on the shift
 vector provided. eg. if you're shifting left, the left edge has no effect
 on output, if you're shifting up, the upper edge has no effect on output.

-- 
Ticket URL: <http://www.scipy.org/scipy/scipy/ticket/796>
SciPy <http://www.scipy.org/>
SciPy is open-source software for mathematics, science, and engineering.


More information about the Scipy-tickets mailing list