3D Human Airway Tree
Program generuje ludzkie drzewo oskrzelowe
TreeBranchVoxelizer.h
Idź do dokumentacji tego pliku.
1 /*=========================================================================
2 
3  Program: 3D Human Airway Tree
4  Module: TreeBranchVoxelizer.h
5 
6  Copyright (c) Kacper Pluta <kacperp@wsinf.edu.pl>
7  All rights reserved.
8  See Copyright.txt or http://leo.wsinf.edu.pl/~kacperp/3dtree for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
15 
21 #ifndef TREEBRANCHVOXELIZER_H
22 #define TREEBRANCHVOXELIZER_H
23 
24 #include <boost/bind.hpp>
25 #include <boost/thread.hpp>
26 #include <boost/shared_ptr.hpp>
27 #include <vtkImageData.h>
28 #include "Branch.h"
29 #include <list>
30 #include <vtkPolyDataToImageStencil.h>
31 #include <vtkImageStencil.h>
32 
34 {
35 protected:
36  vtkImageData *rawTree;
37  vtkImageData *whiteImage;
38  boost::thread_group t_group;
39  boost::mutex mutex;
40  //dodanie marginesow obrazu - miejsce dla generowania szumow
41  const static float IMG_MARGIN = 10.0;
42  const static unsigned char BACKGROUND_VAL = 0;
43  std::list<boost::shared_ptr<Branch> > &BranchList;
44 
50  std::list<boost::shared_ptr<Branch> >::iterator *ListIterator;
51  boost::shared_ptr<Branch> actualConvertBranch;
52  double bounds[6];
53  int dim[3];
54  double origin[3];
55 
56  double bounds2[6];
57  int dim2[3];
58  double origin2[3];
59 
60 
61  float spacing;
62  vtkPolyDataToImageStencil *pol2stenc;
63  vtkImageStencil *imgstenc;
65  vtkImageData *tmpIMG;
67  virtual void Generate();
69  virtual void Convert();
71  void SetBounds();
73  void NewWhiteImage(unsigned char);
74 
75 public:
76  TreeBranchVoxelizer(std::list<boost::shared_ptr<Branch> > &p_list,float p_spacing = 0.5);
78  virtual void Start();
79  virtual vtkImageData *GetRawImage() const {return rawTree;}
81  virtual ~TreeBranchVoxelizer();
82 };
83 #endif // TREEBRANCHVOXELIZER_H