Пример #1
0
#
#  Author: Luis Fuentes-Montero (Luiso)
#
#  This code is distributed under the BSD license, a copy of which is
#  included in the root directory of this package.

from __future__ import division
from dials.array_family import flex

import boost.python
from dials_viewer_ext import gen_font_img

if(__name__ == "__main__"):
  lst_flex = []
  lst_flex_norm = []

  size_xyz = 7

  arr_2d = flex.double(flex.grid(size_xyz, size_xyz), 00)

  tot = 0.0
  for row in range(size_xyz):
    for col in range(size_xyz):
      arr_2d[row, col] += (row * 2 + col * 2)
      tot += arr_2d[row, col]


print "arr_2d.as_numpy_array() = \n", arr_2d.as_numpy_array()
print "gen_font_img(arr_2d).as_numpy_array() = \n", gen_font_img(arr_2d).as_numpy_array()

Пример #2
0
#
#  Author: Luis Fuentes-Montero (Luiso)
#
#  This code is distributed under the BSD license, a copy of which is
#  included in the root directory of this package.

from __future__ import division
from __future__ import print_function
from dials.array_family import flex

import boost.python
from dials_viewer_ext import gen_font_img

if __name__ == "__main__":
    lst_flex = []
    lst_flex_norm = []

    size_xyz = 7

    arr_2d = flex.double(flex.grid(size_xyz, size_xyz), 00)

    tot = 0.0
    for row in range(size_xyz):
        for col in range(size_xyz):
            arr_2d[row, col] += row * 2 + col * 2
            tot += arr_2d[row, col]

print("arr_2d.as_numpy_array() = \n", arr_2d.as_numpy_array())
print("gen_font_img(arr_2d).as_numpy_array() = \n",
      gen_font_img(arr_2d).as_numpy_array())
Пример #3
0
#  Author: Luis Fuentes-Montero (Luiso)
#
#  This code is distributed under the BSD license, a copy of which is
#  included in the root directory of this package.

from __future__ import division
from __future__ import print_function
from dials.array_family import flex

import boost.python
from dials_viewer_ext import gen_font_img

if __name__ == "__main__":
    lst_flex = []
    lst_flex_norm = []

    depth = 16

    arr_1d = flex.double(flex.grid(depth), 00)

    for i in range(depth):
        arr_1d[i] = float(i)

    print("arr_1d.as_numpy_array() = \n", arr_1d.as_numpy_array())

    block_3d = gen_font_img(arr_1d).as_numpy_array()

    for i in range(depth):
        tmp_2d_arr = block_3d[:, :, i]
        print("arr 2d (", i, ") =\n", tmp_2d_arr)
Пример #4
0
#
#  This code is distributed under the BSD license, a copy of which is
#  included in the root directory of this package.

from __future__ import division
from dials.array_family import flex

import boost.python
from dials_viewer_ext import gen_font_img

if(__name__ == "__main__"):
  lst_flex = []
  lst_flex_norm = []

  depth = 16

  arr_1d = flex.double(flex.grid(depth), 00)

  for i in range(depth):
    arr_1d[i] = float(i)


  print "arr_1d.as_numpy_array() = \n", arr_1d.as_numpy_array()

  block_3d = gen_font_img(arr_1d).as_numpy_array()

  for i in range(depth):
    tmp_2d_arr = block_3d[:,:,i]
    print "arr 2d (", i, ") =\n", tmp_2d_arr