[Scipy-tickets] [SciPy] #1378: ndimage.rotate misses some values

SciPy Trac scipy-tickets@scipy....
Sat Jan 29 05:54:21 CST 2011


#1378: ndimage.rotate misses some values
---------------------------+------------------------------------------------
 Reporter:  tmcookies      |       Owner:  somebody
     Type:  defect         |      Status:  new     
 Priority:  normal         |   Milestone:  0.9.0   
Component:  scipy.ndimage  |     Version:  0.7.2   
 Keywords:  rotate 3d      |  
---------------------------+------------------------------------------------
 When rotating 3d-structure elements, some values get lost. I have two
 cases that i can show:

 {{{
 import numpy as np
 from scipy.ndimage import rotate

 cTA = np.array([
       [[-1, -1, -1],
        [-1, -1, -1],
        [-1, -1, -1]],
       [[ 0,  0,  0],
        [ 0,  1,  0],
        [ 0,  0,  0]],
       [[ 0,  0,  0],
        [ 0,  1,  0],
        [ 0,  0,  0]]
        ])

 cTA1  = rotate(cTA, 90,(0,1))
 cTA6  = rotate(cTA,180,(0,1))
 cTA6_ = rotate(cTA1,90,(0,1))

 print cTA6
 print cTA6_
 }}}

 The result of cTA6 and cTA6_ should be the same (rotating 180 or two times
 90 should be the same), but the 180-rotation loses three values at the
 bottom array.

 The result i get is the following:

 {{{
 [[[ 0  0  0]
   [ 0  1  0]
   [ 0  0  0]]

  [[ 0  0  0]
   [ 0  1  0]
   [ 0  0  0]]

  [[-1 -1 -1]
   [-1 -1 -1]
   [ 0  0  0]]]   '''here are the missing '-1' '''

 [[[ 0  0  0]
   [ 0  1  0]
   [ 0  0  0]]

  [[ 0  0  0]
   [ 0  1  0]
   [ 0  0  0]]

  [[-1 -1 -1]
   [-1 -1 -1]
   [-1 -1 -1]]]
 }}}

 By the way: i'm running Ubuntu 10.10 32bit (yeah, they still didn't switch
 to 0.8)

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


More information about the Scipy-tickets mailing list