]> Creatis software - creaContours.git/blob - bbtk/src/bbCreaContournDimensions.cxx
*** empty log message ***
[creaContours.git] / bbtk / src / bbCreaContournDimensions.cxx
1 #include "bbCreaContournDimensions.h"
2 #include "bbcreaContoursPackage.h"
3 namespace bbcreaContours
4 {
5
6 BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaContours,nDimensions)
7 BBTK_BLACK_BOX_IMPLEMENTATION(nDimensions,bbtk::WxBlackBox);
8 void nDimensions::Process()
9 {
10  
11         double **vectx, **vecty, **vectz;
12
13         std::vector< void * > vectortemp;
14         std::vector<int> size;
15         vtkImageData *mask, *value;
16
17         vtkImageData* img = bbGetInputIn();
18
19         std::vector<vtkImageData*> selectedimages;
20         if(img!=NULL && currentimg!=img){
21
22                 currentimg=img;
23                 selectedimages.push_back(img);
24                 wxContourMainFrame::getInstance()->setVectImages(selectedimages);
25         }
26
27
28
29         if(currentimg != NULL){
30                 int contourtype = bbGetInputContourType();              
31                 //wxContourMainFrame::getInstance()->getValuesXYZ(vectx, vecty, vectz, &size);
32                 wxContourMainFrame::getInstance()->getMaskValue(mask, value, contourtype);              
33         }
34
35     bbSetOutputX(vectx);
36         bbSetOutputY(vecty);
37         bbSetOutputZ(vectz);
38         bbSetOutputSizeContour(size);
39         bbSetOutputMask(mask);
40         bbSetOutputValue(value);
41 }
42 void nDimensions::CreateWidget(wxWindow* parent)
43 {
44         
45         //vtkImageData* img = bbGetInputIn();
46
47         std::vector<vtkImageData*> selectedimages;
48         //selectedimages.push_back(img);
49
50         //wxFrame* frame1 = new wxFrame(parent, wxID_ANY, wxT("ROI Application  -    Evaluation version, 23 Oct 2008 "), wxPoint(400,50), wxSize(800, 600) );
51         //frame = wxContourMainFrame::getInstance(frame1, wxID_ANY, wxString(_T("")), wxPoint(100,50), wxSize(800, 600), selectedimages );      
52         //new wxContourMainFrame( frame1, wxID_ANY, _T(""), wxPoint(50,50), wxSize(800, 600),selectedimages ); 
53         //frame1->CreateStatusBar();
54         //bbSetOutputWidget( frame1 ); 
55 std::string path="";
56 #ifdef WIN32
57         char currentPath[_MAX_PATH];
58         HMODULE hand = GetModuleHandle("bbcreaContours");
59         GetModuleFileName(hand, currentPath, _MAX_PATH);
60
61         path = currentPath;
62
63         path = path.substr(0,path.find_last_of("\\"));
64 #endif
65
66         wxPanel* panel = wxContourMainFrame::getInstance(parent, wxID_ANY, wxString(_T("")), wxPoint(100,50), wxSize(800, 600), selectedimages,wxDEFAULT_FRAME_STYLE | wxSUNKEN_BORDER,path );
67         bbSetOutputWidget( panel ); 
68         
69    
70
71     
72   
73 }
74 void nDimensions::bbUserConstructor()
75 {
76
77         bbSetInputContourType(0);
78         bbSetInputIn(NULL);
79
80 }
81 void nDimensions::bbUserCopyConstructor(bbtk::BlackBox::Pointer)
82 {
83
84 }
85 void nDimensions::bbUserDestructor()
86 {
87
88 }
89 }
90 // EO namespace bbCreaContour
91
92