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