| Bsoft 2.0.5 Bernard's software package

Functions
model_mask.h File Reference

Functions to generate masks from models. More...

`#include "rwimg.h"`
`#include "rwmodel.h"`

Go to the source code of this file.

## Functions
Bimage * | model_create_mask (Bmodel *model, Vector3< long > size, Vector3< double > origin, Vector3< double > sam, double edge)
| Calculates a mask of the components and links of a model structure. More...
Bimage * | model_create_hull_mask (Bmodel *model, Vector3< long > size, Vector3< double > origin, Vector3< double > sam, int curv_flag, int fast)
| Calculates a mask based on the periphery of a model structure. More...
Bimage * | model_create_shell_mask (Bmodel *model, Vector3< long > size, Vector3< double > origin, Vector3< double > sam, double shell_width, int curv_flag, int fast)
| Calculates a shell mask covering a model structure. More...
Bimage * | model_create_level_mask (Bmodel *model, Vector3< long > size, Vector3< double > origin, Vector3< double > sam)
| Calculates a mask with one level per model. More...
Bimage * | img_extract_segments_using_model (Bimage *p, Bmodel *model, int multi_level)
| Extracts segmentss from a multi-level mask around points defined by a model. More...
int | img_add_model_to_mask (Bimage *p, Bmodel *model)
| Adds to the mask the component locations. More...
Bmodel * | model_from_multilevel_mask (Bimage *p)
| Generates components at the center of mass of each mask level. More...

## Detailed Description

Functions to generate masks from models.

Author
  Bernard Heymann

Date
  Created: 20010828
  Modified: 20110429

Definition in file model_mask.h.

## Function Documentation

## ◆ img_add_model_to_mask()

int img_add_model_to_mask | ( | Bimage * | p,
|  | Bmodel * | model
| ) |  |

Adds to the mask the component locations.

Parameters

  *p | mask.
  *model | model.

Returns
  int 0, <0 on error.

      At each component location, the voxel is added to the mask.

Definition at line 405 of file model_mask.cpp.

## ◆ img_extract_segments_using_model()

Bimage* img_extract_segments_using_model | ( | Bimage * | p,
|  | Bmodel * | model,
|  | int | multi_level
| ) |  |

Extracts segmentss from a multi-level mask around points defined by a model.

Parameters

  *p | multi-level mask.
  *model | model marking regions in mask.
  multi_level | flag to retain multiple levels.

Returns
  Bimage* new mask from marked segments.

      Each segment should only be marked by a maximum of one component.

Definition at line 334 of file model_mask.cpp.

## ◆ model_create_hull_mask()

Bimage* model_create_hull_mask | ( | Bmodel * | model,
|  | Vector3< long > | size,
|  | Vector3< double > | ori,
|  | Vector3< double > | sam,
|  | int | curv_flag,
|  | int | fast
| ) |  |

Calculates a mask based on the periphery of a model structure.

Parameters

  *model | model structure.
  size | size of the new mask.
  ori | origin of the new mask.
  sam | pixel size of the new mask.
  curv_flag | flag to indicate curved surface.
  fast | flag to use fast algorithm.

Returns
  Bimage* new mask.

      Each point in the new image is tested for inclusion in the mask,
      by calculating whether it falls inside the closest 3 vertices.
      Only the first model in the linked list is used.

Definition at line 103 of file model_mask.cpp.

## ◆ model_create_level_mask()

Bimage* model_create_level_mask | ( | Bmodel * | model,
|  | Vector3< long > | size,
|  | Vector3< double > | ori,
|  | Vector3< double > | sam
| ) |  |

Calculates a mask with one level per model.

Parameters

  *model | model structure.
  size | size of the new mask.
  ori | origin of the new mask.
  sam | pixel size of the new mask.

Returns
  Bimage* new mask.

      A level is defined as those voxels closest to the vertices of one model.

Definition at line 285 of file model_mask.cpp.

## ◆ model_create_mask()

Bimage* model_create_mask | ( | Bmodel * | model,
|  | Vector3< long > | size,
|  | Vector3< double > | ori,
|  | Vector3< double > | sam,
|  | double | edge
| ) |  |

Calculates a mask of the components and links of a model structure.

Parameters

  *model | model structure.
  size | size of the new mask.
  ori | origin of the new mask.
  sam | pixel size of the new mask.
  edge | edge width in angstrom.

Returns
  Bimage* new mask.

      Each component is used to generate a sphere and each link a bar.
      Only the first model in the linked list is used.

Definition at line 34 of file model_mask.cpp.

## ◆ model_create_shell_mask()

Bimage* model_create_shell_mask | ( | Bmodel * | model,
|  | Vector3< long > | size,
|  | Vector3< double > | ori,
|  | Vector3< double > | sam,
|  | double | shell_width,
|  | int | curv_flag,
|  | int | fast
| ) |  |

Calculates a shell mask covering a model structure.

Parameters

  *model | model structure.
  size | size of the new mask.
  ori | origin of the new mask.
  sam | pixel size of the new mask.
  shell_width | width of shell mask.
  curv_flag | flag to indicate curved surface.
  fast | flag to use fast algorithm.

Returns
  Bimage* new mask.

      Each point in the new image is tested for inclusion in the mask,
      by calculating whether it falls inside the closest 3 vertices.
      Only the first model in the linked list is used.

Definition at line 191 of file model_mask.cpp.

## ◆ model_from_multilevel_mask()

Bmodel* model_from_multilevel_mask | ( | Bimage * | p | ) |

Generates components at the center of mass of each mask level.

Parameters

  *p | multi-level mask.

Returns
  Bmodel* new model.

      The mask is expected to be of integer data type.

Definition at line 452 of file model_mask.cpp.