BBTK_BLACK_BOX_IMPLEMENTATION(nDimensions,bbtk::WxBlackBox);
void nDimensions::Process()
{
-printf("EED nDimensions::Process Start \n" );
double **vectx = 0, **vecty = 0, **vectz = 0;
std::vector< void * > vectortemp;
wxContourMainFrame::getInstance()->ShowToolsPanel(true);
currentimg=img;
selectedimages.push_back(img);
-printf("EED nDimensions::Process 1 \n" );
wxContourMainFrame::getInstance()->setVectImages(selectedimages);
-printf("EED nDimensions::Process 2 \n" );
- }
+ } // if img
if(currentimg != NULL)
{
int contourtype = bbGetInputContourType();
//wxContourMainFrame::getInstance()->getValuesXYZ(vectx, vecty, vectz, &size);
//wxContourMainFrame::getInstance()->getMaskValue(mask, value, contourtype);
- }
+ } // if currentimg
wxContourMainFrame::getInstance()->RefreshInterface();
-printf("EED nDimensions::Process 3.1 \n" );
+ bbSetOutputwxContourMainFrame( wxContourMainFrame::getInstance() );
// bbSetOutputX(vectx);
-printf("EED nDimensions::Process 3.2 \n" );
// bbSetOutputY(vecty);
-printf("EED nDimensions::Process 3.3 \n" );
// bbSetOutputZ(vectz);
-printf("EED nDimensions::Process 3.4 \n" );
// bbSetOutputSizeContour(size);
-printf("EED nDimensions::Process 3.5 \n" );
// bbSetOutputMask(*mask);
-printf("EED nDimensions::Process 3.6 \n" );
// bbSetOutputValue(*value);
-printf("EED nDimensions::Process End \n" );
}
//-----------------------------------------------------------------
#endif // MACOSX
-printf("EED nDimensions::CreateWidget path=%s\n",datadir.c_str() );
+//printf("EED nDimensions::CreateWidget path=%s\n",datadir.c_str() );
wxContourMainFrame* wxcontourmainframe = wxContourMainFrame::getInstance(parent, wxID_ANY, wxString(_T("")), wxPoint(100,50), wxSize(800, 600), selectedimages,wxDEFAULT_FRAME_STYLE | wxSUNKEN_BORDER,datadir );
-printf("EED nDimensions::CreateWidget 1 \n" );
wxContourMainFrame::getInstance()->ShowToolsPanel(false);
-printf("EED nDimensions::CreateWidget 2 \n" );
// bbSetOutputWidget( new wxPanel(parent,-1) );
bbSetOutputWidget( wxcontourmainframe );
-
-printf("EED nDimensions::CreateWidget 3 \n" );
}
//-----------------------------------------------------------------
BBTK_DECLARE_OUTPUT(Y,double**);
BBTK_DECLARE_OUTPUT(Z,double**);
BBTK_DECLARE_OUTPUT(SizeContour,std::vector <int>);
+ BBTK_DECLARE_OUTPUT(wxContourMainFrame,wxContourMainFrame*);
+
private:
//wxContourMainFrame* frame;
};
BBTK_BEGIN_DESCRIBE_BLACK_BOX(nDimensions, bbtk::WxBlackBox);
-BBTK_NAME("nDimensions");
-BBTK_AUTHOR("car-prie@uniandes.edu.co");
-BBTK_DESCRIPTION("With a given image, the box shows the nDimension application");
-BBTK_CATEGORY("contours");
-BBTK_INPUT(nDimensions,WorkDir,"Working data directory where config and data files are located",std::string,"");
-BBTK_INPUT(nDimensions,In,"Image to be shown",vtkImageData*,"");
-BBTK_INPUT(nDimensions,ContourType,"(default 0) Contour type to be exported: ",int,"");
+ BBTK_NAME("nDimensions");
+ BBTK_AUTHOR("car-prie@uniandes.edu.co");
+ BBTK_DESCRIPTION("With a given image, the box shows the nDimension application");
+ BBTK_CATEGORY("contours");
+ BBTK_INPUT(nDimensions,WorkDir,"Working data directory where config and data files are located",std::string,"");
+ BBTK_INPUT(nDimensions,In,"Image to be shown",vtkImageData*,"");
+ BBTK_INPUT(nDimensions,ContourType,"(default 0) Contour type to be exported: ",int,"");
-BBTK_OUTPUT(nDimensions, Mask, "Mask of the contours",vtkImageData*,"");
-BBTK_OUTPUT(nDimensions, Value, "Value of the contours",vtkImageData*,"");
-BBTK_OUTPUT(nDimensions, X, "Array of arrays that contains the X coordinates of each contour", double**, "");
-BBTK_OUTPUT(nDimensions, Y, "Array of arrays that contains the Y coordinates of each contour", double**, "");
-BBTK_OUTPUT(nDimensions, Z, "Array of arrays that contains the Z coordinates of each contour", double**, "");
-BBTK_OUTPUT(nDimensions, SizeContour, "Vector that contains the coordinates of each contour", std::vector <int>, "");
+ BBTK_OUTPUT(nDimensions, Mask, "Mask of the contours",vtkImageData*,"");
+ BBTK_OUTPUT(nDimensions, Value, "Value of the contours",vtkImageData*,"");
+ BBTK_OUTPUT(nDimensions, X, "Array of arrays that contains the X coordinates of each contour", double**, "");
+ BBTK_OUTPUT(nDimensions, Y, "Array of arrays that contains the Y coordinates of each contour", double**, "");
+ BBTK_OUTPUT(nDimensions, Z, "Array of arrays that contains the Z coordinates of each contour", double**, "");
+ BBTK_OUTPUT(nDimensions, SizeContour, "Vector that contains the coordinates of each contour", std::vector <int>, "");
+ BBTK_OUTPUT(nDimensions, wxContourMainFrame, "wxContourMainFrame", wxContourMainFrame*, "");
BBTK_END_DESCRIBE_BLACK_BOX(nDimensions);
}
--- /dev/null
+//=====
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//=====
+#include "bbcreaContoursSetViewerPosition.h"
+#include "bbcreaContoursPackage.h"
+namespace bbcreaContours
+{
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaContours,SetViewerPosition)
+BBTK_BLACK_BOX_IMPLEMENTATION(SetViewerPosition,bbtk::AtomicBlackBox);
+//=====
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//=====
+void SetViewerPosition::Process()
+{
+
+// THE MAIN PROCESSING METHOD BODY
+// Here we simply set the input 'In' value to the output 'Out'
+// And print out the output value
+// INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
+// void bbSet{Input|Output}NAME(const TYPE&)
+// const TYPE& bbGet{Input|Output}NAME() const
+// Where :
+// * NAME is the name of the input/output
+// (the one provided in the attribute 'name' of the tag 'input')
+// * TYPE is the C++ type of the input/output
+// (the one provided in the attribute 'type' of the tag 'input')
+
+// bbSetOutputOut( bbGetInputIn() );
+// std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
+
+ if (bbGetInputwxContourMainFrame()!=NULL)
+ {
+ if (bbGetInputPosition().size()==3 )
+ {
+ int x = bbGetInputPosition()[0];
+ int y = bbGetInputPosition()[1];
+ int z = bbGetInputPosition()[2];
+
+ vtkImageData *img = bbGetInputwxContourMainFrame()->getImageData();
+ int ext[6];
+ img->GetExtent(ext);
+ int dimY=ext[3]-ext[2]+1;
+
+ bbGetInputwxContourMainFrame()->setConceptValue( "Axe Depth", y );
+ bbGetInputwxContourMainFrame()->SetXY(x,dimY-z-1);
+
+ bbGetInputwxContourMainFrame()->showAxis(true);
+ bbGetInputwxContourMainFrame()->changeInstant();
+ bbGetInputwxContourMainFrame()->RefreshInterface();
+ }
+ }
+
+}
+//=====
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//=====
+void SetViewerPosition::bbUserSetDefaultValues()
+{
+
+// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
+// Here we initialize the input 'In' to 0
+ bbSetInputwxContourMainFrame(NULL);
+
+}
+//=====
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//=====
+void SetViewerPosition::bbUserInitializeProcessing()
+{
+
+// THE INITIALIZATION METHOD BODY :
+// Here does nothing
+// but this is where you should allocate the internal/output pointers
+// if any
+
+
+}
+//=====
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//=====
+void SetViewerPosition::bbUserFinalizeProcessing()
+{
+
+// THE FINALIZATION METHOD BODY :
+// Here does nothing
+// but this is where you should desallocate the internal/output pointers
+// if any
+
+}
+}
+// EO namespace bbcreaContours
+
+
--- /dev/null
+//=====
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//=====
+#ifndef __bbcreaContoursSetViewerPosition_h_INCLUDED__
+#define __bbcreaContoursSetViewerPosition_h_INCLUDED__
+
+#include "bbcreaContours_EXPORT.h"
+#include "bbtkAtomicBlackBox.h"
+#include "iostream"
+
+#include "wxContourMainFrame.h"
+
+namespace bbcreaContours
+{
+
+class bbcreaContours_EXPORT SetViewerPosition
+ :public bbtk::AtomicBlackBox
+{
+ BBTK_BLACK_BOX_INTERFACE(SetViewerPosition,bbtk::AtomicBlackBox);
+//=====
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//=====
+ BBTK_DECLARE_INPUT(wxContourMainFrame,wxContourMainFrame*);
+ BBTK_DECLARE_INPUT(Position,std::vector<int>);
+// BBTK_DECLARE_OUTPUT(Out,double);
+ BBTK_PROCESS(Process);
+ void Process();
+//=====
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//=====
+};
+
+BBTK_BEGIN_DESCRIBE_BLACK_BOX(SetViewerPosition,bbtk::AtomicBlackBox);
+ BBTK_NAME("SetViewerPosition");
+ BBTK_AUTHOR("InfoDev");
+ BBTK_DESCRIPTION("No Description.");
+ BBTK_CATEGORY("empty");
+
+ BBTK_INPUT(SetViewerPosition,wxContourMainFrame,"wxContourMainFrame",wxContourMainFrame*,"");
+ BBTK_INPUT(SetViewerPosition,Position,"vector px py pz",std::vector<int>,"");
+
+ //BBTK_OUTPUT(SetViewerPosition,Out,"First output",double,"");
+
+BBTK_END_DESCRIBE_BLACK_BOX(SetViewerPosition);
+//=====
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//=====
+}
+// EO namespace bbcreaContours
+
+#endif // __bbcreaContoursSetViewerPosition_h_INCLUDED__
+
_instantPanel->getInstant(inst);
vtkImageData* img = kernelManager->getImageAtInstant(inst);
- if(img!=NULL){
+ if(img!=NULL)
+ {
_theViewPanel->changeImage(img);
showAxis(false);
}else{
int z = _instantPanel->getConceptDataOf("Axe Depth")->getActualValue();
_theViewPanel->setImageSlice(z);
- }
+ } // if img
}
void wxContourMainFrame::updateInstantAxes()
}
+void wxContourMainFrame::SetXY(int x, int y)
+{
+ _theViewPanel->SetXY(x,y);
+}
+
//------------------------------------------------------------------------------------------------------------
+ void SetXY(int x,int y);
+
+
private:
//------------------------------------------------------------------------------------------------------------
// Private methods
return GetwxVtkMPR2DView()->GetVtkmprbasedata()->GetZ();
}
+ //------------------------------------------------------------------------------------------------------------
+ void wxContourViewPanel::SetXY(int x, int y)
+ {
+ GetwxVtkMPR2DView()->GetVtkmprbasedata()->SetX(x);
+ GetwxVtkMPR2DView()->GetVtkmprbasedata()->SetY(y);
+ }
+
//------------------------------------------------------------------------------------------------------------
void wxContourViewPanel::Refresh()
{
int GetX();
int GetY();
int GetZ();
+ void SetXY(int x, int y);
void Refresh();
void changeDeep();
void setImageSlice(int z);
+
+
private:
//------------------------------------------------------------------------------------------------------------