MorphoGraphX
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AutoTrim.hpp
1 #ifndef AUTO_TRIM_HPP
2 #define AUTO_TRIM_HPP
3 
4 #include <Process.hpp>
5 
6 namespace mgx {
7 namespace process {
16 class AutoTrim : public StackProcess {
17 public:
18  AutoTrim(const StackProcess& process)
19  : Process(process)
20  , StackProcess(process)
21  {
22  }
23 
24  bool operator()(const QStringList& parms)
25  {
26  if(!checkState().stack(STACK_ANY))
27  return false;
28 
29  return (*this)(currentStack(), currentStack()->currentStore(), parms[0].toInt());
30  }
31 
32  bool operator()(Stack* stack, Store* store, int threshold);
33 
34  QString folder() const {
35  return "Canvas";
36  }
37  QString name() const {
38  return "AutoTrim";
39  }
41  {
42  return "Trim stack boundary box (BBox) to keep only non-empty part.\n"
43  "A voxel is considered empty if its intensity is less or equal to the threshold.";
44  }
46  return QStringList() << "Threshold";
47  }
49  return QStringList() << "Voxels below this threshold are considered empty.";
50  }
52  return QStringList() << "0";
53  }
54  QIcon icon() const {
55  return QIcon(":/images/AutoTrim.png");
56  }
57 };
58 } // namespace process
59 } // namespace mgx
60 #endif
Any stack.
Definition: Process.hpp:627
Stack * currentStack()
Returns the current stack (i.e.
const Store * currentStore() const
Returns the current store.
Definition: Stack.hpp:112
Process()
Default constructor.
QString description() const
Returns a description of the process for the GUI.
Definition: AutoTrim.hpp:40
CheckState checkState()
Call this function and convert the result to a boolean.
The Store class holds the actual 3D data and properties specific to it.
Definition: Store.hpp:25
Stack * stack(int i)
Returns the ith stack, or 0 if there is no such stack.
QStringList parmNames() const
List of named parameters.
Definition: AutoTrim.hpp:45
QStringList parmDefaults() const
List of default parms.
Definition: AutoTrim.hpp:51
QString folder() const
Folder in which to place the process.
Definition: AutoTrim.hpp:34
QString name() const
Returns the name of the process.
Definition: AutoTrim.hpp:37
Trim stack boundary box (BBox) to keep only non-empty part.
Definition: AutoTrim.hpp:16
File containing the definition of a Process.
The Stack class represent the dimensions of the 3D data, and the frames transformations.
Definition: Stack.hpp:25
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: AutoTrim.hpp:54
Stack processes have non-mutable access to meshes and mutable access to stacks.
Definition: Process.hpp:819
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: AutoTrim.hpp:24
QStringList parmDescs() const
List of parameters descriptions.
Definition: AutoTrim.hpp:48