Xmipp  v3.23.11-Nereus
Public Member Functions | Static Public Member Functions | List of all members
BackgroundFilter Class Reference

#include <filters.h>

Inheritance diagram for BackgroundFilter:
Inheritance graph
[legend]
Collaboration diagram for BackgroundFilter:
Collaboration graph
[legend]

Public Member Functions

void readParams (XmippProgram *program)
 
void apply (MultidimArray< double > &img)
 
- Public Member Functions inherited from XmippFilter
virtual ~XmippFilter ()
 
virtual void show ()
 

Static Public Member Functions

static void defineParams (XmippProgram *program)
 

Detailed Description

Definition at line 1511 of file filters.h.

Member Function Documentation

◆ apply()

void BackgroundFilter::apply ( MultidimArray< double > &  img)
virtual

Apply the filter to an image or volume

Implements XmippFilter.

Definition at line 3689 of file filters.cpp.

3690 {
3691  switch (type)
3692  {
3693  case PLANE:
3695  break;
3696  case ROLLINGBALL:
3697  substractBackgroundRollingBall(img, radius);
3698  break;
3699 
3700  }
3701 }
viol type
void substractBackgroundRollingBall(MultidimArray< double > &I, int radius)
Definition: filters.cpp:75
void substractBackgroundPlane(MultidimArray< double > &I)
Definition: filters.cpp:40

◆ defineParams()

void BackgroundFilter::defineParams ( XmippProgram program)
static

Define the parameters for use inside an Xmipp program

Definition at line 3660 of file filters.cpp.

3661 {
3662  program->addParamsLine("== Background removal ==");
3663  program->addParamsLine(
3664  " [ --background <type=plane> ] : Filters to remove the background.");
3665  program->addParamsLine(" where <type> ");
3666  program->addParamsLine(
3667  " plane : Remove the plane that best fits the pixels.");
3668  program->addParamsLine(
3669  " rollingball <radius> : The background is computed as a rolling ball operation.");
3670  program->addParamsLine(" alias -g; ");
3671 }
void addParamsLine(const String &line)

◆ readParams()

void BackgroundFilter::readParams ( XmippProgram program)
virtual

Read from program command line

Reimplemented from XmippFilter.

Definition at line 3674 of file filters.cpp.

3675 {
3676  type = PLANE;
3677  // Check operation to do
3678  String typeStr = program->getParam("--background");
3679  if (typeStr == "plane") //Nothing to do, plane by default
3680  ;
3681  else if (typeStr == "rollingball")
3682  {
3683  type = ROLLINGBALL;
3684  radius = program->getIntParam("--background", "rollingball");
3685  }
3686 }
const char * getParam(const char *param, int arg=0)
viol type
std::string String
Definition: xmipp_strings.h:34
int getIntParam(const char *param, int arg=0)

The documentation for this class was generated from the following files: