]> Creatis software - clitk.git/blob - vv/vvMeshReader.h
removed headers
[clitk.git] / vv / vvMeshReader.h
1 #ifndef vvMeshReader_h
2 #define vvMeshReader_h
3 #include <QThread>
4
5 #include <string>
6
7 #include "vvImage.h"
8 #include "vvMesh.h"
9
10 class vvMeshReader : public QThread
11 {
12 public:
13     ///Returns the contour names present in a dc struct file
14     std::vector<std::pair<int,std::string> > GetROINames();
15
16     vvMeshReader();
17     void SetFilename(const std::string f) { filename=f; }
18     void SetModeToVTK() {vtk_mode=true;}
19     void SetSelectedItems(const std::vector<int> & items) {selected_contours=items;}
20     void SetImage(vvImage::Pointer im) {image=im;}
21     void SetPropagationVF(vvImage::Pointer vf) {this->vf=vf;}
22     std::vector<vvMesh::Pointer> GetOutput() {return result;}
23     ///Called from the main thread, runs the reader and displays the progress bar
24     void Update();
25
26 protected:
27     void run();
28     std::string filename;
29     ///Indicates if the reader should expect a vtk polydata file instead of a dicom-struct
30     bool vtk_mode;
31     ///The list of indexes of contours the reader should read
32     std::vector<int> selected_contours;
33     ///Image the mesh will be displayed over, for binarization
34     vvImage::Pointer image;
35     std::vector<vvMesh::Pointer> result;
36
37     ///Read a DC-struct file and return an extruded version of the contours
38     std::vector<vvMesh::Pointer> readSelectedContours();
39     ///Vector field used to propagate the contour
40     vvImage::Pointer vf;
41     ///Binarize the output of readSelectedContours() and mesh it with a Marching Cubes
42     void Remesh(vvMesh::Pointer roi);
43 };
44
45 #endif