• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python dtype.as_c_int函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中tomopy.util.dtype.as_c_int函数的典型用法代码示例。如果您正苦于以下问题:Python as_c_int函数的具体用法?Python as_c_int怎么用?Python as_c_int使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了as_c_int函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: c_normalize_bg

def c_normalize_bg(tomo, air):
    dt, dy, dx = tomo.shape

    LIB_TOMOPY.normalize_bg.restype = dtype.as_c_void_p()
    LIB_TOMOPY.normalize_bg(
        dtype.as_c_float_p(tomo),
        dtype.as_c_int(dt),
        dtype.as_c_int(dy),
        dtype.as_c_int(dx),
        dtype.as_c_int(air))
开发者ID:tomopy,项目名称:tomopy,代码行数:10,代码来源:extern.py


示例2: c_vector3

def c_vector3(tomo1, tomo2, tomo3, center1, center2, center3, recon1, recon2, recon3, theta1, theta2, theta3, axis1, axis2, axis3, **kwargs):
    if len(tomo1.shape) == 2:
        # no y-axis (only one slice)
        dy = 1
        dt, dx = tomo1.shape
    else:
        dy, dt, dx = tomo1.shape

    LIB_TOMOPY.vector3.restype = dtype.as_c_void_p()
    return LIB_TOMOPY.vector3(
            dtype.as_c_float_p(tomo1),
            dtype.as_c_float_p(tomo2),
            dtype.as_c_float_p(tomo3),
            dtype.as_c_int(dy),
            dtype.as_c_int(dt),
            dtype.as_c_int(dx),
            dtype.as_c_float_p(center1),
            dtype.as_c_float_p(center2),
            dtype.as_c_float_p(center3),
            dtype.as_c_float_p(theta1),
            dtype.as_c_float_p(theta2),
            dtype.as_c_float_p(theta3),
            dtype.as_c_float_p(recon1),
            dtype.as_c_float_p(recon2),
            dtype.as_c_float_p(recon3),
            dtype.as_c_int(kwargs['num_gridx']),
            dtype.as_c_int(kwargs['num_gridy']),
            dtype.as_c_int(kwargs['num_iter']),
            dtype.as_c_int(axis1),
            dtype.as_c_int(axis2),
            dtype.as_c_int(axis3))
开发者ID:tomopy,项目名称:tomopy,代码行数:31,代码来源:extern.py


示例3: c_sirt

def c_sirt(tomo, center, recon, theta, **kwargs):
    if len(tomo.shape) == 2:
        # no y-axis (only one slice)
        dy = 1
        dt, dx = tomo.shape
    else:
        dy, dt, dx = tomo.shape

    use_accel = 1 if kwargs['accelerated'] else 0

    LIB_TOMOPY.sirt.restype = dtype.as_c_void_p()
    return LIB_TOMOPY.sirt(
            dtype.as_c_float_p(tomo),
            dtype.as_c_int(dy),
            dtype.as_c_int(dt),
            dtype.as_c_int(dx),
            dtype.as_c_float_p(center),
            dtype.as_c_float_p(theta),
            dtype.as_c_float_p(recon),
            dtype.as_c_int(kwargs['num_gridx']),
            dtype.as_c_int(kwargs['num_gridy']),
            dtype.as_c_int(kwargs['num_iter']),
            dtype.as_c_int(use_accel),
            dtype.as_c_int(kwargs['pool_size']),
            dtype.as_c_char_p(kwargs['interpolation']),
            dtype.as_c_char_p(kwargs['device']),
            dtype.as_c_int_p(kwargs['grid_size']),
            dtype.as_c_int_p(kwargs['block_size']))
开发者ID:tomopy,项目名称:tomopy,代码行数:28,代码来源:extern.py


示例4: c_project3

def c_project3(objx, objy, objz, center, tomo, theta, axis):
    # TODO: we should fix this elsewhere...
    # TOMO object must be contiguous for c function to work

    contiguous_tomo = np.require(tomo, requirements="AC")
    if len(objx.shape) == 2:
        # no y-axis (only one slice)
        oy = 1
        ox, oz = objx.shape
    else:
        oy, ox, oz = objx.shape

    if len(tomo.shape) == 2:
        # no y-axis (only one slice)
        dy = 1
        dt, dx = tomo.shape
    else:
        dy, dt, dx = tomo.shape

    LIB_TOMOPY.project3.restype = dtype.as_c_void_p()
    LIB_TOMOPY.project3(
        dtype.as_c_float_p(objx),
        dtype.as_c_float_p(objy),
        dtype.as_c_float_p(objz),
        dtype.as_c_int(oy),
        dtype.as_c_int(ox),
        dtype.as_c_int(oz),
        dtype.as_c_float_p(contiguous_tomo),
        dtype.as_c_int(dy),
        dtype.as_c_int(dt),
        dtype.as_c_int(dx),
        dtype.as_c_float_p(center),
        dtype.as_c_float_p(theta),
        dtype.as_c_int(axis))
    tomo[:] = contiguous_tomo[:]
开发者ID:tomopy,项目名称:tomopy,代码行数:35,代码来源:extern.py


示例5: c_gridrec

def c_gridrec(tomo, center, recon, theta, **kwargs):
    if len(tomo.shape) == 2:
        # no y-axis (only one slice)
        dy = 1
        dt, dx = tomo.shape
    else:
        dy, dt, dx = tomo.shape

    LIB_TOMOPY.gridrec.restype = dtype.as_c_void_p()
    return LIB_TOMOPY.gridrec(
            dtype.as_c_float_p(tomo),
            dtype.as_c_int(dy),
            dtype.as_c_int(dt),
            dtype.as_c_int(dx),
            dtype.as_c_float_p(center),
            dtype.as_c_float_p(theta),
            dtype.as_c_float_p(recon),
            dtype.as_c_int(kwargs['num_gridx']),
            dtype.as_c_int(kwargs['num_gridy']),
            dtype.as_c_char_p(kwargs['filter_name']),
            dtype.as_c_float_p(kwargs['filter_par']))
开发者ID:tomopy,项目名称:tomopy,代码行数:21,代码来源:extern.py


示例6: c_project

def c_project(obj, center, tomo, theta):
    if len(obj.shape) == 2:
        # no y-axis (only one slice)
        oy = 1
        ox, oz = obj.shape
    else:
        oy, ox, oz = obj.shape

    if len(tomo.shape) == 2:
        # no y-axis (only one slice)
        dy = 1
        dt, dx = tomo.shape
    else:
        dy, dt, dx = tomo.shape

    LIB_TOMOPY.project.restype = dtype.as_c_void_p()
    LIB_TOMOPY.project(
        dtype.as_c_float_p(obj),
        dtype.as_c_int(oy),
        dtype.as_c_int(ox),
        dtype.as_c_int(oz),
        dtype.as_c_float_p(tomo),
        dtype.as_c_int(dy),
        dtype.as_c_int(dt),
        dtype.as_c_int(dx),
        dtype.as_c_float_p(center),
        dtype.as_c_float_p(theta))
开发者ID:michael-sutherland,项目名称:tomopy,代码行数:27,代码来源:extern.py


示例7: c_osem

def c_osem(*args):
    tomo = mproc.SHARED_TOMO
    recon = mproc.SHARED_ARRAY

    LIB_TOMOPY.osem.restype = dtype.as_c_void_p()
    LIB_TOMOPY.osem(
        dtype.as_c_float_p(tomo),
        dtype.as_c_int(args[0]),  # dx
        dtype.as_c_int(args[1]),  # dy
        dtype.as_c_int(args[2]),  # dz
        dtype.as_c_float_p(args[3]),  # center
        dtype.as_c_float_p(args[4]),  # theta
        dtype.as_c_float_p(recon),
        dtype.as_c_int(args[5]['num_gridx']),
        dtype.as_c_int(args[5]['num_gridy']),
        dtype.as_c_int(args[5]['num_iter']),
        dtype.as_c_int(args[5]['num_block']),
        dtype.as_c_float_p(args[5]['ind_block']),
        dtype.as_c_int(args[6]),  # istart
        dtype.as_c_int(args[7]))  # iend
开发者ID:AaronBM,项目名称:tomopy,代码行数:20,代码来源:extern.py


示例8: c_bart

def c_bart(*args):
    tomo = mproc.SHARED_TOMO
    recon = mproc.SHARED_ARRAY

    LIB_TOMOPY.bart.restype = dtype.as_c_void_p()
    LIB_TOMOPY.bart(
        dtype.as_c_float_p(tomo),
        dtype.as_c_int(args[0]),  # dx
        dtype.as_c_int(args[1]),  # dy
        dtype.as_c_int(args[2]),  # dz
        dtype.as_c_float_p(args[3]),  # center
        dtype.as_c_float_p(args[4]),  # theta
        dtype.as_c_float_p(recon),
        dtype.as_c_int(args[5]["num_gridx"]),
        dtype.as_c_int(args[5]["num_gridy"]),
        dtype.as_c_int(args[5]["num_iter"]),
        dtype.as_c_int(args[5]["num_block"]),
        dtype.as_c_float_p(args[5]["ind_block"]),
        dtype.as_c_int(args[6]),  # istart
        dtype.as_c_int(args[7]),
    )  # iend
开发者ID:ornlneutronimaging,项目名称:tomopy,代码行数:21,代码来源:extern.py


示例9: c_project

def c_project(ox, oy, oz, theta, center, dx, dy, dz, istart, iend):
    obj = mproc.SHARED_OBJ
    tomo = mproc.SHARED_ARRAY

    LIB_TOMOPY.project.restype = dtype.as_c_void_p()
    LIB_TOMOPY.project(
        dtype.as_c_float_p(obj),
        dtype.as_c_int(ox),
        dtype.as_c_int(oy),
        dtype.as_c_int(oz),
        dtype.as_c_float_p(tomo),
        dtype.as_c_int(dx),
        dtype.as_c_int(dy),
        dtype.as_c_int(dz),
        dtype.as_c_float_p(center),
        dtype.as_c_float_p(theta),
        dtype.as_c_int(istart),
        dtype.as_c_int(iend))
开发者ID:AaronBM,项目名称:tomopy,代码行数:18,代码来源:extern.py


示例10: c_normalize_bg

def c_normalize_bg(dx, dy, dz, air, istart, iend):
    tomo = mproc.SHARED_ARRAY

    LIB_TOMOPY.normalize_bg.restype = dtype.as_c_void_p()
    LIB_TOMOPY.normalize_bg(
        dtype.as_c_float_p(tomo),
        dtype.as_c_int(dx),
        dtype.as_c_int(dy),
        dtype.as_c_int(dz),
        dtype.as_c_int(air),
        dtype.as_c_int(istart),
        dtype.as_c_int(iend))
开发者ID:AaronBM,项目名称:tomopy,代码行数:12,代码来源:extern.py


示例11: c_remove_ring

def c_remove_ring(rec, *args):
    istart = 0
    iend = rec.shape[0]
    LIB_TOMOPY.remove_ring.restype = dtype.as_c_void_p()
    return LIB_TOMOPY.remove_ring(
            dtype.as_c_float_p(rec),
            dtype.as_c_float(args[0]),  # center_x
            dtype.as_c_float(args[1]),  # center_y
            dtype.as_c_int(args[2]),  # dx
            dtype.as_c_int(args[3]),  # dy
            dtype.as_c_int(args[4]),  # dz
            dtype.as_c_float(args[5]),  # thresh_max
            dtype.as_c_float(args[6]),  # thresh_min
            dtype.as_c_float(args[7]),  # thresh
            dtype.as_c_int(args[8]),  # theta_min
            dtype.as_c_int(args[9]),  # rwidth
            dtype.as_c_int(args[10]),  # int_mode
            dtype.as_c_int(istart),  # istart
            dtype.as_c_int(iend))  # iend
开发者ID:tomopy,项目名称:tomopy,代码行数:19,代码来源:extern.py


示例12: c_remove_stripe_sf

def c_remove_stripe_sf(dx, dy, dz, size, istart, iend):
    tomo = mproc.SHARED_ARRAY

    LIB_TOMOPY.remove_stripe_sf.restype = dtype.as_c_void_p()
    LIB_TOMOPY.remove_stripe_sf(
        dtype.as_c_float_p(tomo),
        dtype.as_c_int(dx),
        dtype.as_c_int(dy),
        dtype.as_c_int(dz),
        dtype.as_c_int(size),
        dtype.as_c_int(istart),
        dtype.as_c_int(iend))
开发者ID:JStuckner,项目名称:tomopy,代码行数:12,代码来源:extern.py


示例13: c_sample

def c_sample(mode, arr, dx, dy, dz, level, axis, out):
    LIB_TOMOPY.sample.restype = dtype.as_c_void_p()
    LIB_TOMOPY.sample(
        dtype.as_c_int(mode),
        dtype.as_c_float_p(arr),
        dtype.as_c_int(dx),
        dtype.as_c_int(dy),
        dtype.as_c_int(dz),
        dtype.as_c_int(level),
        dtype.as_c_int(axis),
        dtype.as_c_float_p(out))
    return out
开发者ID:tomopy,项目名称:tomopy,代码行数:12,代码来源:extern.py


示例14: c_gridrec

def c_gridrec(*args):
    tomo = mproc.SHARED_TOMO
    recon = mproc.SHARED_ARRAY

    LIB_TOMOPY.gridrec.restype = dtype.as_c_void_p()
    LIB_TOMOPY.gridrec(
        dtype.as_c_float_p(tomo),
        dtype.as_c_int(args[0]),  # dx
        dtype.as_c_int(args[1]),  # dy
        dtype.as_c_int(args[2]),  # dz
        dtype.as_c_float_p(args[3]),  # center
        dtype.as_c_float_p(args[4]),  # theta
        dtype.as_c_float_p(recon),
        dtype.as_c_int(args[5]['num_gridx']),
        dtype.as_c_int(args[5]['num_gridy']),
        dtype.as_c_char_p(args[5]['filter_name']),
        dtype.as_c_int(args[6]),  # istart
        dtype.as_c_int(args[7]))  # iend
开发者ID:AaronBM,项目名称:tomopy,代码行数:18,代码来源:extern.py


示例15: c_remove_ring

def c_remove_ring(*args):
    data = mproc.SHARED_ARRAY

    LIB_TOMOPY.remove_ring.restype = dtype.as_c_void_p()
    LIB_TOMOPY.remove_ring(
        dtype.as_c_float_p(data),
        dtype.as_c_float(args[0]),  # center_x
        dtype.as_c_float(args[1]),  # center_y
        dtype.as_c_int(args[2]),  # dx
        dtype.as_c_int(args[3]),  # dy
        dtype.as_c_int(args[4]),  # dz
        dtype.as_c_float(args[5]),  # thresh_max
        dtype.as_c_float(args[6]),  # thresh_min
        dtype.as_c_float(args[7]),  # thresh
        dtype.as_c_int(args[8]),  # theta_min
        dtype.as_c_int(args[9]),  # rwidth
        dtype.as_c_int(args[10]),  # istart
        dtype.as_c_int(args[11]))  # iend
开发者ID:JStuckner,项目名称:tomopy,代码行数:18,代码来源:extern.py


示例16: c_ospml_quad

def c_ospml_quad(args):
    data=args[0]
    recon=args[6]
    # Call C function.
    c_float_p = ctypes.POINTER(ctypes.c_float)
    librecon_phi.ospml_quad.restype = ctypes.POINTER(ctypes.c_void_p)
    librecon_phi.ospml_quad(data.ctypes.data_as(c_float_p),
        dtype.as_c_int(args[1]),  # dx
        dtype.as_c_int(args[2]),  # dy
        dtype.as_c_int(args[3]),  # dz
        dtype.as_c_float_p(args[4]),  # center
        dtype.as_c_float_p(args[5]),  # theta
        recon.ctypes.data_as(c_float_p),
        dtype.as_c_int(args[7]['num_gridx']),
        dtype.as_c_int(args[7]['num_gridy']),
        dtype.as_c_int(args[7]['num_iter']),
        dtype.as_c_float_p(args[7]['reg_par']),
        dtype.as_c_int(args[7]['num_block']),
        dtype.as_c_float_p(args[7]['ind_block']))
    return recon
开发者ID:PeriLLC,项目名称:tomopy_peri_0.1.x,代码行数:20,代码来源:xeon_phi.py


示例17: c_fbp

def c_fbp(*args):
    tomo = mproc.SHARED_TOMO
    recon = mproc.SHARED_ARRAY

    LIB_TOMOPY.fbp.restype = dtype.as_c_void_p()
    LIB_TOMOPY.fbp(
        dtype.as_c_float_p(tomo),
        dtype.as_c_int(args[0]),  # dx
        dtype.as_c_int(args[1]),  # dy
        dtype.as_c_int(args[2]),  # dz
        dtype.as_c_float_p(args[3]),  # center
        dtype.as_c_float_p(args[4]),  # theta
        dtype.as_c_float_p(recon),
        dtype.as_c_int(args[5]["num_gridx"]),
        dtype.as_c_int(args[5]["num_gridy"]),
        dtype.as_c_char_p(args[5]["filter_name"]),
        dtype.as_c_float_p(args[5]["filter_par"]),  # filter_par
        dtype.as_c_int(args[6]),  # istart
        dtype.as_c_int(args[7]),
    )  # iend
开发者ID:ornlneutronimaging,项目名称:tomopy,代码行数:20,代码来源:extern.py


示例18: c_remove_stripe_sf

def c_remove_stripe_sf(tomo, size):
    # TODO: we should fix this elsewhere...
    # TOMO object must be contiguous for c function to work
    contiguous_tomo = np.require(tomo, requirements="AC")
    dx, dy, dz = tomo.shape
    istart = 0
    iend = dy

    LIB_TOMOPY.remove_stripe_sf.restype = dtype.as_c_void_p()
    LIB_TOMOPY.remove_stripe_sf(
        dtype.as_c_float_p(contiguous_tomo),
        dtype.as_c_int(dx),
        dtype.as_c_int(dy),
        dtype.as_c_int(dz),
        dtype.as_c_int(size),
        dtype.as_c_int(istart),
        dtype.as_c_int(iend))
    tomo[:] = contiguous_tomo[:]
开发者ID:tomopy,项目名称:tomopy,代码行数:18,代码来源:extern.py


示例19: c_osem

def c_osem(tomo, center, recon, theta, **kwargs):
    if len(tomo.shape) == 2:
        # no y-axis (only one slice)
        dy = 1
        dt, dx = tomo.shape
    else:
        dy, dt, dx = tomo.shape

    LIB_TOMOPY.osem.restype = dtype.as_c_void_p()
    return LIB_TOMOPY.osem(
            dtype.as_c_float_p(tomo),
            dtype.as_c_int(dy),
            dtype.as_c_int(dt),
            dtype.as_c_int(dx),
            dtype.as_c_float_p(center),
            dtype.as_c_float_p(theta),
            dtype.as_c_float_p(recon),
            dtype.as_c_int(kwargs['num_gridx']),
            dtype.as_c_int(kwargs['num_gridy']),
            dtype.as_c_int(kwargs['num_iter']),
            dtype.as_c_int(kwargs['num_block']),
            dtype.as_c_float_p(kwargs['ind_block']))  # TODO: should be int?
开发者ID:tomopy,项目名称:tomopy,代码行数:22,代码来源:extern.py


示例20: c_sirt

def c_sirt(tomo, center, recon, theta, **kwargs):
    if len(tomo.shape) == 2:
        # no y-axis (only one slice)
        dy = 1
        dt, dx = tomo.shape
    else:
        dy, dt, dx = tomo.shape

    LIB_TOMOPY.sirt.restype = dtype.as_c_void_p()
    LIB_TOMOPY.sirt(
        dtype.as_c_float_p(tomo),
        dtype.as_c_int(dy),
        dtype.as_c_int(dt),
        dtype.as_c_int(dx),
        dtype.as_c_float_p(center),
        dtype.as_c_float_p(theta),
        dtype.as_c_float_p(recon),
        dtype.as_c_int(kwargs['num_gridx']),
        dtype.as_c_int(kwargs['num_gridy']),
        dtype.as_c_int(kwargs['num_iter']))
开发者ID:wscullin,项目名称:tomopy,代码行数:20,代码来源:extern.py



注:本文中的tomopy.util.dtype.as_c_int函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python dtype.as_c_void_p函数代码示例发布时间:2022-05-27
下一篇:
Python dtype.as_c_float_p函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap