[Numpy-discussion] Change default order to Fortran order

Matthew Brett matthew.brett at gmail.com
Mon Aug 3 11:16:02 EDT 2015


On Mon, Aug 3, 2015 at 3:55 PM, Sturla Molden <sturla.molden at gmail.com> wrote:
> Juan Nunez-Iglesias <jni.soma at gmail.com> wrote:
>
>> The short version is that you'll save yourself a lot of pain by starting to
>> think of your images as (plane, row, column) instead of (x, y, z).
>
> There are several things to consider here.
>
> 1. The vertices in computer graphics (OpenGL) are (x,y,z).
>
> 2. OpenGL rotation matrices and projection matrice are stored in column
> major order.
>
> 3. OpenGL frame buffers are indexed (x,y) in column major order with (0,0)
> being lower left.
>
> 4. ITK and VTK depends on OpenGL and are thus using column major order.
>
> 5. Those who use Matlab or Fortran in addition to Python prefer column
> major order.
>
> 6. BLAS and LAPACK use column major order.
>
> 7. The common notation in image prorcessing (as opposed to computer
> graphics in geberal) is indexing (row, column), in row major order, with
> (0,0) being upper left.
>
> All in all, this is a strong case for prefering column major order and the
> common mathematical notation (x,y,z).
>
> Also notice how the ususal notation in image pricessing differs from
> OpenGL.

Sure, but to avoid confusion, maybe move the discussion of image
indexing order to another thread?

I think this thread is about memory layout, which is a different issue.

Cheers,

Matthew



More information about the NumPy-Discussion mailing list