Bsoft  2.1.0
Bernard's software package
View.cpp File Reference

View functions. More...

#include "View.h"
#include "linked_list.h"
#include "random_numbers.h"
#include "utilities.h"

Go to the source code of this file.

Functions

ostream & operator<< (ostream &output, View v)
 
int show_views (View *v)
 Displays a linked list of views. More...
 
View * view_array (View *v, long &n)
 Copies views from a list into an array. More...
 
View * tilt_views (double ang_min, double ang_max, double ang_step, double axis)
 Initializes a set of views tilted around the y axis. More...
 
View random_view ()
 Calculates a random view. More...
 
View view_random_reslice ()
 Generates a random reslicing 3x3 rotation matrix. More...
 
View * random_views (int nviews)
 Calculates a set of random views. More...
 
double random_view_error (View &v, double std)
 Calculates a new view with a random error from the given view. More...
 
View * views_within_limits (View theview, double theta_step, double phi_step, double alpha_step, double view_angle_limit, double alpha_angle_limit)
 Generates a list of views within an angular distance from the input view. More...
 
View * views_for_refinement (View theview, double alpha_step)
 Generates a 3x3 grid of views around an input view. More...
 
View * views_for_refinement (View theview, double alpha_step1, double alpha_step2, double alpha_step3, double max_alpha3)
 Generates a 3x3 grid of views around an input view. More...
 
View * view_list_expand_angles (View *views, double amin, double amax, double astep)
 Expands each view to several views with different rotation angles. More...
 
int view_list_subset (View **view_list, int start, int size)
 Replaces a view list with a subset of it. More...
 

Variables

int verbose
 

Detailed Description

View functions.

Author
Bernard Heymann
Date
Created: 20010420
Modified: 20160708

Definition in file View.cpp.

Function Documentation

◆ operator<<()

ostream& operator<< ( ostream &  output,
View  v 
)

Definition at line 17 of file View.cpp.

◆ random_view()

View random_view ( )

Calculates a random view.

Returns
View random view.
A random seed should already have been generated.

Definition at line 101 of file View.cpp.

◆ random_view_error()

double random_view_error ( View &  v,
double  std 
)

Calculates a new view with a random error from the given view.

Parameters
&vgiven view (modified).
stdstandard deviation of gaussian distribution.
Returns
double random angle.
The rotation between the given and new views is defined by the 
gaussian distributed random angle and a random axis.
A random seed should already have been generated.

Definition at line 180 of file View.cpp.

◆ random_views()

View* random_views ( int  nviews)

Calculates a set of random views.

Parameters
nviewsnumber of views.
Returns
View* list of random views.

Definition at line 147 of file View.cpp.

◆ show_views()

int show_views ( View *  v)

Displays a linked list of views.

Parameters
*vthe linked list of views.
Returns
int number of views.

Definition at line 28 of file View.cpp.

◆ tilt_views()

View* tilt_views ( double  ang_min,
double  ang_max,
double  ang_step,
double  axis 
)

Initializes a set of views tilted around the y axis.

Parameters
ang_minstarting angle (radians).
ang_maxending angle (radians).
ang_stepangular step size (radians).
axistilt axis angle (radians).
Returns
View* a set of 4-value views.
A set of views is calculated corresponding to tilted views imaged
during tomography. The tilt axis angle is taken as a counter-clockwise
rotation from the x-axis.

Definition at line 70 of file View.cpp.

◆ view_array()

View* view_array ( View *  v,
long &  n 
)

Copies views from a list into an array.

Parameters
*vthe linked list of views.
nnumber of views.
Returns
View* view array.

Definition at line 44 of file View.cpp.

◆ view_list_expand_angles()

View* view_list_expand_angles ( View *  views,
double  amin,
double  amax,
double  astep 
)

Expands each view to several views with different rotation angles.

Parameters
*viewsview list.
aminminimum angle.
amaxmaximum angle.
astepangular step.
Returns
View* new view list.
The new angles are added to the existing angles of the view.

Definition at line 435 of file View.cpp.

◆ view_list_subset()

int view_list_subset ( View **  view_list,
int  start,
int  size 
)

Replaces a view list with a subset of it.

Parameters
**view_listview list.
startoffset of first view of subset.
sizenumber of views in subset.
Returns
int number of views selected, <0 on error.
The old view list is destroyed.

Definition at line 474 of file View.cpp.

◆ view_random_reslice()

View view_random_reslice ( )

Generates a random reslicing 3x3 rotation matrix.

Returns
View new view.
The view represents any one or more 90 degree rotations,
randomly chosen.

Definition at line 123 of file View.cpp.

◆ views_for_refinement() [1/2]

View* views_for_refinement ( View  theview,
double  alpha_step 
)

Generates a 3x3 grid of views around an input view.

Parameters
theviewthe input view.
alpha_stepangular step size around view vector (radians).
Returns
View* a list of views.

Definition at line 285 of file View.cpp.

◆ views_for_refinement() [2/2]

View* views_for_refinement ( View  theview,
double  alpha_step1,
double  alpha_step2,
double  alpha_step3,
double  max_alpha3 
)

Generates a 3x3 grid of views around an input view.

Parameters
theviewthe input view.
alpha_step1angular step size for view vector in one direction (radians).
alpha_step2angular step size for view vector in second direction (radians).
alpha_step3angular step size around view vector (radians).
max_alpha3maximum for step 3.
Returns
View* a list of views.

Definition at line 354 of file View.cpp.

◆ views_within_limits()

View* views_within_limits ( View  theview,
double  theta_step,
double  phi_step,
double  alpha_step,
double  view_angle_limit,
double  alpha_angle_limit 
)

Generates a list of views within an angular distance from the input view.

Parameters
theviewthe input view.
theta_steptheta step size (radians).
phi_stepphi step size (radians).
alpha_stepalpha step size (radians).
view_angle_limitangular distance limit from view vector (radians).
alpha_angle_limitangular distance limit from view rotation angle (radians).
Returns
View* a list of views.
The list of views forms a 3D search grid in orientation space.

Definition at line 207 of file View.cpp.

Variable Documentation

◆ verbose

int verbose
extern