| Bsoft 2.0.5 Bernard's software package

Classes | Functions
View.h File Reference

View object. More...

`#include "Vector3.h"`
`#include "Matrix3.h"`
`#include "Quaternion.h"`
`#include "random_numbers.h"`
`#include "utilities.h"`

Go to the source code of this file.

## Classes
class | View

## Functions
ostream & | operator<< (ostream &output, View v)
int | show_views (View *v)
| Displays a linked list of views. More...
View * | view_array (View *views, 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...

## Detailed Description

View object.

Author
  Bernard Heymann

Date
  Created: 20010420
  Modified: 20190711

Definition in file View.h.

## 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

  &v | given view (modified).
  std | standard 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

  nviews | number 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

  *v | the 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_min | starting angle (radians).
  ang_max | ending angle (radians).
  ang_step | angular step size (radians).
  axis | tilt 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

  *v | the linked list of views.
  n | number 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

  *views | view list.
  amin | minimum angle.
  amax | maximum angle.
  astep | angular 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_list | view list.
  start | offset of first view of subset.
  size | number 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

  theview | the input view.
  alpha_step | angular 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

  theview | the input view.
  alpha_step1 | angular step size for view vector in one direction (radians).
  alpha_step2 | angular step size for view vector in second direction (radians).
  alpha_step3 | angular step size around view vector (radians).
  max_alpha3 | maximum 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

  theview | the input view.
  theta_step | theta step size (radians).
  phi_step | phi step size (radians).
  alpha_step | alpha step size (radians).
  view_angle_limit | angular distance limit from view vector (radians).
  alpha_angle_limit | angular 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.