plenoptomos.unsupported package

Submodules

plenoptomos.unsupported.geometry module

Created on Thu Sep 13 18:07:48 2018

@author: Nicola VIGANÒ, Computational Imaging group, CWI, The Netherlands, and ESRF - The European Synchrotron, Grenoble, France

class plenoptomos.unsupported.geometry.GeometryTransformation(t=array([[1., 0., 0.], [0., 1., 0.], [0., 0., 1.]], dtype=float32), s=array([0., 0., 0.], dtype=float32))[source]

Bases: object

Geometry transformation class. It allows to manipulate position and direction vectors.

apply_direction(vec)[source]

Implements application of the transformation to a direction vector.

Parameters

vec (numpy.array_like) – Direction vector

Returns

Result of the transformation

Return type

numpy.array_like

apply_position(vec)[source]

Implements application of the transformation to a position vector.

Parameters

vec (numpy.array_like) – Position vector

Returns

Result of the transformation

Return type

numpy.array_like

static get_axis_angle(vec_ref, vec_dir)[source]

Computes the rotation axis and angle of the rotation that transformed vec_ref into vec_dir.

Parameters
  • vec_ref (numpy.array_like) – The initial vector.

  • vec_dir (numpy.array_like) – The result vector.

Returns

The normalized rotation axis and angle.

Return type

tuple(numpy.array_like, float)

static get_rotation_components(rot_axis)[source]

Computes the rotation components for the given rotation axis.

Parameters

rot_axis (<3, > numpy.array_like) – The rotation axis.

Returns

The rotation components

Return type

tuple(<3, 3> numpy.array_like, <3, 3> numpy.array_like, <3, 3> numpy.array_like)

static get_rotation_matrix(rotcomp, angle)[source]

Computes the rotation matrix for the given rotation components and angle.

Parameters
  • rotcomp (tuple(<3, 3> numpy.array_like, <3, 3> numpy.array_like, <3, 3> numpy.array_like)) – The rotation components, computed with get_rotation_components

  • angle (float) – The rotation angle

Returns

The rotation matrix

Return type

<3, 3> numpy.array_like

static get_rototranslation(axis, angles, axis_origin=None)[source]

Create a roto-translation transformation.

Parameters
  • axis (numpy.array_like) – Rotation axis

  • angles (float) – rotation angle

  • axis_origin (numpy.array_like, optional. Default: None) – Origin of the rotation axis

Returns

The roto-translation transformation

Return type

GeometryTransformation

static get_scale(scale)[source]

Creates a scaling transformation.

Parameters

scale (float) – The scaling factor.

Returns

The scaling transformation

Return type

GeometryTransformation

static get_transform(t_type, *args, **keywords)[source]

Creates a transformation.

Parameters

t_type (string) – Type of transformation. Options are: ‘rot’ | ‘tr’

Returns

The chosen transformation

Return type

GeometryTransofrm

static get_translation(point)[source]

Create a transflation transformation.

Parameters

point (numpy.array_like) – Translation position.

Returns

The translation transformation

Return type

GeometryTransformation

rmatvec(vec)[source]

Implement the transpose of the transformation to vector operation.

Parameters

vec (numpy.array_like <3, > or <4, >) – Direction vectors.

plenoptomos.unsupported.reconstruction module

Created on Wed Mar 6 12:20:48 2019

@author: Nicola VIGANÒ, Computational Imaging group, CWI, The Netherlands, and ESRF - The European Synchrotron, Grenoble, France

class plenoptomos.unsupported.reconstruction.Reconstruct3D(vol_geom, proj_geom, super_sampling=1, gpu_index=None)[source]

Bases: object

bp(data)[source]
cp(data, iterations=100, pars={})[source]
fp(vol)[source]
reconstruct(data, algo='SIRT3D_CUDA', iterations=25, pars={})[source]
sirt(data, iterations=25, pars={})[source]
plenoptomos.unsupported.reconstruction.correct_projs(projs, flats, darks, crop=None, pad=None)[source]
plenoptomos.unsupported.reconstruction.get_geometry(dset_path, projs_shape, beam_geometry='cone', vol_shift_mm=0.0, vol_size_add=None, detector_tilt_deg=None)[source]
plenoptomos.unsupported.reconstruction.get_scanner_conf(dset_path)[source]
plenoptomos.unsupported.reconstruction.load_images(dset_path, imprefix)[source]

plenoptomos.unsupported.testing module

Created on Mon Jun 18 16:51:41 2018

@author: Nicola VIGANÒ, Computational Imaging group, CWI, The Netherlands, and ESRF - The European Synchrotron, Grenoble, France

class plenoptomos.unsupported.testing.Blurring(cameras, verbose=False)[source]

Bases: object

blur(lfs, coordinates='vu')[source]
create_psf_lenses(coordinates='vu', airy_rings=3, refocus_distance=None, up_sampling=1, plot_psfs=False, use_otf=False)[source]
class plenoptomos.unsupported.testing.Tester(test_name, lfs, test_params={}, rec_params={}, test_conds={}, is_rgb=False, result_dir=None, save=True)[source]

Bases: object

default_conditions = {'down_sampling_st': 1, 'down_sampling_uv': 1, 'extras': ''}
default_rec_params = {'border': 8, 'data_term': 'l2', 'fourier_method': 'slice', 'iterations': 50, 'psf': None, 'up_sampling_function': 'flat', 'up_sampling_st': 1}
default_test_params = {'algo': [], 'beam': [], 'domain': [], 'lambda_reg': [], 'zs': []}
get_options_number()[source]
get_test_option(option_name, ind, struct=None)[source]
launch_reconstruction(ii_t)[source]

plenoptomos.unsupported.utils_img module

Created on Fri Dec 8 15:24:12 2017

@author: Nicola VIGANÒ, Computational Imaging group, CWI, The Netherlands, and ESRF - The European Synchrotron, Grenoble, France

class plenoptomos.unsupported.utils_img.MovieCreator(out_dir, lf, z0s, focal_stack, dmap, all_focus, use_overlay=True)[source]

Bases: object

create_allfocus_frames(num_frames=1)[source]
create_dmap_frames(num_frames=1)[source]
create_refocus_frame(z_ind)[source]
create_simple_frame(img)[source]
create_static_frames(num_frames)[source]
create_sublf_frame(sublf_size, sublf_center_vu=None)[source]
create_transition(from_img, to_img, num_frames)[source]
create_transition_frame(from_img, to_img, percentage)[source]
create_transition_sublf(final_sublf_size, direction='to')[source]
overlay_text_on_image(img_ref, img_text)[source]
render_distance(img_size, z)[source]
render_text(img_size, t)[source]
to_01(img)[source]
class plenoptomos.unsupported.utils_img.ShiftsFinderVolume3D(data_fix, data_move, do_clear=True, clims=None)[source]

Bases: object

ax_lr = [2, 2, 1]
ax_ud = [1, 0, 0]
axs_rot = ['Z', 'Y', 'X']
planes_vis = ['XY', 'XZ', 'YZ']
show(*args, **kwords)[source]
update(direction)[source]
update_ax(ax, data)[source]

Module contents

Unsupported utility tools.

@author: Nicola VIGANÒ, Computational Imaging group, CWI, The Netherlands, and ESRF - The European Synchrotron, Grenoble, France

Created on Mon Jun 8 15:28:00 2020