]> Creatis software - creaContours.git/blob - bbtk/src/bbCreaContournDimensions.cxx
d7ff4b80ccf330b15e1c3508000cdb2f5e37a504
[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                 wxContourMainFrame::getInstance()->ShowToolsPanel(true);
23                 currentimg=img;
24                 selectedimages.push_back(img);
25                 wxContourMainFrame::getInstance()->setVectImages(selectedimages);
26         }
27
28
29
30         if(currentimg != NULL){
31                 int contourtype = bbGetInputContourType();
32                 //wxContourMainFrame::getInstance()->getValuesXYZ(vectx, vecty, vectz, &size);
33                 //wxContourMainFrame::getInstance()->getMaskValue(mask, value, contourtype);
34         }
35
36     bbSetOutputX(vectx);
37         bbSetOutputY(vecty);
38         bbSetOutputZ(vectz);
39         bbSetOutputSizeContour(size);
40         bbSetOutputMask(*mask);
41         bbSetOutputValue(*value);
42 }
43 void nDimensions::CreateWidget(wxWindow* parent)
44 {
45
46         //vtkImageData* img = bbGetInputIn();
47
48         std::vector<vtkImageData*> selectedimages;
49         //selectedimages.push_back(img);
50
51         //wxFrame* frame1 = new wxFrame(parent, wxID_ANY, wxT("ROI Application  -    Evaluation version, 23 Oct 2008 "), wxPoint(400,50), wxSize(800, 600) );
52         //frame = wxContourMainFrame::getInstance(frame1, wxID_ANY, wxString(_T("")), wxPoint(100,50), wxSize(800, 600), selectedimages );
53         //new wxContourMainFrame( frame1, wxID_ANY, _T(""), wxPoint(50,50), wxSize(800, 600),selectedimages );
54         //frame1->CreateStatusBar();
55         //bbSetOutputWidget( frame1 );
56 std::string path=".";
57 #ifdef WIN32
58         char currentPath[_MAX_PATH];
59         HMODULE hand = GetModuleHandle("bbcreaContours");
60         GetModuleFileName(hand, currentPath, _MAX_PATH);
61
62         path = currentPath;
63
64         path = path.substr(0,path.find_last_of("\\"));
65 #endif
66
67         wxPanel* panel = wxContourMainFrame::getInstance(parent, wxID_ANY, wxString(_T("")), wxPoint(100,50), wxSize(800, 600), selectedimages,wxDEFAULT_FRAME_STYLE | wxSUNKEN_BORDER,path );
68         wxContourMainFrame::getInstance()->ShowToolsPanel(false);
69         //std::cout<<"creaContours = "<<panel<<std::endl;
70         bbSetOutputWidget( panel );
71
72
73
74
75
76 }
77 //-----------------------------------------------------------------
78 void nDimensions::bbUserSetDefaultValues()
79 {
80         bbSetInputContourType(0);
81         bbSetInputIn(NULL);
82 }
83
84 //-----------------------------------------------------------------
85 void nDimensions::bbUserInitializeProcessing()
86 {
87 }
88
89 //-----------------------------------------------------------------
90 void nDimensions::bbUserFinalizeProcessing()
91 {
92 }
93 }
94 // EO namespace bbCreaContour
95
96