img->GetExtent(ext);
int dimY=ext[3]-ext[2]+1;
- bbGetInputwxContourMainFrame()->setConceptValue( "Axe Depth", y );
- bbGetInputwxContourMainFrame()->SetXY(x,dimY-z-1);
+ if (bbGetInputDirection()==0)
+ {
+ bbGetInputwxContourMainFrame()->setConceptValue( "Axe Depth", z );
+ bbGetInputwxContourMainFrame()->SetXY(x,y);
+ } // if Direction1
+
+ if (bbGetInputDirection()==1)
+ {
+ bbGetInputwxContourMainFrame()->setConceptValue( "Axe Depth", y );
+ bbGetInputwxContourMainFrame()->SetXY(x,dimY-z-1);
+ } // if Direction1
+
+ if (bbGetInputDirection()==2)
+ {
+ bbGetInputwxContourMainFrame()->setConceptValue( "Axe Depth", x );
+ bbGetInputwxContourMainFrame()->SetXY(dimY-z-1,y);
+ } // if Direction1
+
bbGetInputwxContourMainFrame()->showAxis(true);
bbGetInputwxContourMainFrame()->changeInstant();
// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
// Here we initialize the input 'In' to 0
+ bbSetInputDirection(0);
bbSetInputwxContourMainFrame(NULL);
}
//=====
BBTK_DECLARE_INPUT(wxContourMainFrame,wxContourMainFrame*);
BBTK_DECLARE_INPUT(Position,std::vector<int>);
+ BBTK_DECLARE_INPUT(Direction,int);
// BBTK_DECLARE_OUTPUT(Out,double);
BBTK_PROCESS(Process);
void Process();
BBTK_INPUT(SetViewerPosition,wxContourMainFrame,"wxContourMainFrame",wxContourMainFrame*,"");
BBTK_INPUT(SetViewerPosition,Position,"vector px py pz",std::vector<int>,"");
+ BBTK_INPUT(SetViewerPosition,Direction,"(default 0) 0:XYZ 1:XZY 2:YZX",int,"");
//BBTK_OUTPUT(SetViewerPosition,Out,"First output",double,"");
wxContourMainFrame::getInstance()->onInterpolation(interpolate);
}
+void interfMainPanel::onBeforAfterContour(bool before, bool after)
+{
+ wxContourMainFrame::getInstance()->onBeforeAfterContour(before,after);
+}
+
void interfMainPanel::onConfigurationPressed()
{
// Statistics frame
if(infoWin ==NULL)
{
-printf("EED interfMainPanel::onInformationPressed 0.1\n");
infoWin = new wxFrame (this, -1,_T(" Statistics "), wxDefaultPosition, wxDefaultSize, wxFRAME_TOOL_WINDOW|wxSYSTEM_MENU | wxCAPTION | wxCLIP_CHILDREN |wxFRAME_FLOAT_ON_PARENT | wxRESIZE_BORDER );
-printf("EED interfMainPanel::onInformationPressed 0.2\n");
infoWin->SetSize( wxSize(825,650) );
wxSize sizepanel(825,675);
-printf("EED interfMainPanel::onInformationPressed 0.3\n");
informationPanel = new interfInformationPanel(infoWin);//contourevent->getInformationPanel(infoWin);
-printf("EED interfMainPanel::onInformationPressed 0.3a\n");
-// Borrame wxBoxSizer * sizerPanel = new wxBoxSizer(wxHORIZONTAL);
wxFlexGridSizer * sizerPanel = new wxFlexGridSizer(1);
sizerPanel -> Add( informationPanel, 1, wxEXPAND ,0);
-printf("EED interfMainPanel::onInformationPressed 0.4\n");
infoWin->SetSizer( sizerPanel );
infoWin->SetAutoLayout( true );
infoWin->Layout();
-printf("EED interfMainPanel::onInformationPressed 0.43\n");
infoWin->Show();
}else {
-printf("EED interfMainPanel::onInformationPressed 0.5\n");
-
if (infoWin->IsShown()==true)
{
-printf("EED interfMainPanel::onInformationPressed 0.6\n");
infoWin->Show(false);
} else {
//contourevent->FillGridWithContoursInformation();
-printf("EED interfMainPanel::onInformationPressed 0.7\n");
infoWin->Show(true);
}
}
-printf("EED interfMainPanel::onInformationPressed 1\n");
-
//CMRU 29-08-09-----------------------------------------------------------------------------------------------
if(panelAux == NULL)
{
panelAux = new wxPanel(interfMainPanel::getInstance()->getInfoPanel(), -1, wxDefaultPosition, wxDefaultSize, wxNO_BORDER, wxString(_T("")));
}
//------------------------------------------------------------------------------------------------------------
-printf("EED interfMainPanel::onInformationPressed 2\n");
-
// mask view control panel
if(infoPanelMask == NULL){
infoPanelMask = new wxPanel(panelAux, -1, wxDefaultPosition, wxDefaultSize, wxNO_BORDER, wxString(_T("")));
wxPanel *panel = wxContourMainFrame::getInstance()->getMaskImageViewPanel( infoPanelMask );
wxStaticText* stattext = new wxStaticText(infoPanelMask, -1, wxString(_T(" Mask segmentation ")), wxDefaultPosition,
wxDefaultSize, wxALIGN_CENTRE|wxBORDER_SIMPLE|wxFULL_REPAINT_ON_RESIZE, wxString(_T("")));
-
flexsizer->Add(stattext,wxALIGN_CENTER | wxALIGN_CENTRE);
-
flexsizer->Add(panel, wxEXPAND);
infoPanelMask->Layout();
-
}
-printf("EED interfMainPanel::onInformationPressed 3\n");
//CMRU 29-08-09-----------------------------------------------------------------------------------------------
//Calibration panel
if(infoPanelCalibration == NULL)
wxPanel *panel = new interfCalibrationPanel(infoPanelCalibration);
wxStaticText* stattext = new wxStaticText(infoPanelCalibration, -1, wxString(_T(" Calibration ")), wxDefaultPosition,
wxDefaultSize, wxALIGN_CENTRE|wxBORDER_SIMPLE|wxFULL_REPAINT_ON_RESIZE, wxString(_T("")));
-
flexsizer->Add(stattext,wxALIGN_CENTER | wxALIGN_CENTRE);
-
flexsizer->Add(panel, wxEXPAND);
infoPanelCalibration->Layout();
}
-printf("EED interfMainPanel::onInformationPressed 4\n");
//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
#if wxMAJOR_VERSION <= 2
wxFlexGridSizer* sizer = new wxFlexGridSizer(2);
#endif
sizer->Add(infoPanelMask);
-printf("EED interfMainPanel::onInformationPressed 4.1\n");
sizer->Add(infoPanelCalibration);
-printf("EED interfMainPanel::onInformationPressed 4.2\n");
panelAux->SetSizer(sizer, true);
-printf("EED interfMainPanel::onInformationPressed 4.3\n");
panelAux->SetAutoLayout( true );
-printf("EED interfMainPanel::onInformationPressed 4.4\n");
showPanel(panelAux);
-printf("EED interfMainPanel::onInformationPressed 4.5\n");
//------------------------------------------------------------------
-printf("EED interfMainPanel::onInformationPressed OOJJOOOOOOOOOO......\n");
wxContourMainFrame::getInstance()->changeInstant();
-printf("EED interfMainPanel::onInformationPressed End\n");
}
int getWindowLevel();
void onBrigthnessColorWindowLevel(int colorwindow,int windowlevel);
void onInterpolation(bool interpolate);
+ void onBeforAfterContour(bool before, bool after);
void onSpreadPressed();
void onConfigurationPressed();
void resetAppend();
_brithtnessWindowLevel = new wxSlider(this, -1, windowlevel , min, max, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL|wxSL_LABELS, wxDefaultValidator);
_brithtnessColorLevel = new wxSlider(this, -1, colorwindow , min, max, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL|wxSL_LABELS, wxDefaultValidator);
- _interpolationCheckBox = new wxCheckBox(this, -1, _T("Image interpolation") );
+ _interpolationCheckBox = new wxCheckBox(this, -1, _T("Image Interpolation") );
_interpolationCheckBox->SetValue(true);
+ _beforContourCheckBox = new wxCheckBox(this, -1, _T("Befor Contour") );
+ _beforContourCheckBox->SetValue(false);
+
+ _afterContourCheckBox = new wxCheckBox(this, -1, _T("After Contour") );
+ _afterContourCheckBox->SetValue(false);
+
+
Connect( _withOfContourLine->GetId(), wxEVT_SCROLL_CHANGED, (wxObjectEventFunction) &interfConfigurationPanel::onWidthOfContour);
Connect( _withOfContourLine->GetId(), wxEVT_SCROLL_THUMBTRACK, (wxObjectEventFunction) &interfConfigurationPanel::onWidthOfContour);
Connect( _brithtnessColorLevel->GetId() , wxEVT_SCROLL_CHANGED, (wxObjectEventFunction) &interfConfigurationPanel::onBrigthnessColorWindowLevel);
Connect( _brithtnessColorLevel->GetId() , wxEVT_SCROLL_THUMBTRACK, (wxObjectEventFunction) &interfConfigurationPanel::onBrigthnessColorWindowLevel);
Connect( _interpolationCheckBox->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &interfConfigurationPanel::OnInterpolation);
+ Connect( _beforContourCheckBox->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &interfConfigurationPanel::OnBeforAfterContour);
+ Connect( _afterContourCheckBox->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &interfConfigurationPanel::OnBeforAfterContour);
wxFlexGridSizer * sizer = new wxFlexGridSizer(1);
sizer -> Add( new wxStaticText(this,-1, _T("Contour width")) , 1, wxGROW );
sizer -> Add( _withOfContourLine , 1, wxGROW );
sizer -> Add( new wxStaticText(this,-1, _T(" ")) , 1, wxGROW );
- sizer -> Add( new wxStaticText(this,-1, _T(" ")) , 1, wxGROW );
- sizer -> Add( new wxStaticText(this,-1, _T("Brightness of the image")) , 1, wxGROW );
- sizer -> Add( new wxStaticText(this,-1, _T("--Window level--")) , 1, wxGROW );
+ sizer -> Add( new wxStaticText(this,-1, _T("Window level")) , 1, wxGROW );
sizer -> Add( _brithtnessWindowLevel , 1, wxGROW );
- sizer -> Add( new wxStaticText(this,-1, _T("--Color level--")) , 1, wxGROW );
+ sizer -> Add( new wxStaticText(this,-1, _T("Color level")) , 1, wxGROW );
sizer -> Add( _brithtnessColorLevel, 1, wxGROW );
sizer -> Add( new wxStaticText(this,-1, _T(" ")) , 1, wxGROW );
- sizer -> Add( new wxStaticText(this,-1, _T(" ")) , 1, wxGROW );
sizer -> Add( _interpolationCheckBox , 1, wxGROW );
+ sizer -> Add( _beforContourCheckBox , 1, wxGROW );
+ sizer -> Add( _afterContourCheckBox , 1, wxGROW );
this->SetSizer( sizer );
//JCP 13-10-08
{
}
-void interfConfigurationPanel::onWidthOfContour(wxScrollEvent& event){
-
+void interfConfigurationPanel::onWidthOfContour(wxScrollEvent& event)
+{
double width = (double)_withOfContourLine->GetValue() / 2.0;
interfMainPanel::getInstance()->onWidthOfContour(width);
}
void interfConfigurationPanel::onBrigthnessColorWindowLevel(wxScrollEvent& event){
int colorwindow = _brithtnessColorLevel->GetValue();
int windowlevel = _brithtnessWindowLevel->GetValue();
-
interfMainPanel::getInstance()->onBrigthnessColorWindowLevel(colorwindow, windowlevel);
-
}
void interfConfigurationPanel::OnInterpolation(wxCommandEvent& event)
{
interfMainPanel::getInstance()->onInterpolation(_interpolationCheckBox->GetValue());
+}
-
+void interfConfigurationPanel::OnBeforAfterContour(wxCommandEvent& event)
+{
+ interfMainPanel::getInstance()->onBeforAfterContour(_beforContourCheckBox->GetValue() , _afterContourCheckBox->GetValue() );
}
+
/**
** Begin of the spread panel
**/
void onWidthOfContour(wxScrollEvent& event);
void onBrigthnessColorWindowLevel(wxScrollEvent& event);
void OnInterpolation(wxCommandEvent& event);
- wxSlider* _withOfContourLine;
- wxSlider* _brithtnessWindowLevel;
- wxSlider* _brithtnessColorLevel;
+ void OnBeforAfterContour(wxCommandEvent& event);
+ wxSlider* _withOfContourLine;
+ wxSlider* _brithtnessWindowLevel;
+ wxSlider* _brithtnessColorLevel;
wxCheckBox* _interpolationCheckBox;
+ wxCheckBox* _beforContourCheckBox;
+ wxCheckBox* _afterContourCheckBox;
};
class interfSpreadPanel
#elif defined(__GNUC__)
std::string str_home(getenv("HOME"));
#endif
- std::string strCreaContourDataTmp = str_home + "/.creaContourDataTemp/";
- std::vector<std::string> conceptNameVect;
- std::vector<int> conceptSizeVect;
- notebook = this->createNotebook();
+ std::string strCreaContourDataTmp = str_home + "/.creaContourDataTemp/";
+ std::vector<std::string> conceptNameVect;
+ std::vector<int> conceptSizeVect;
+ notebook = this->createNotebook();
kernelManager = new KernelManagerContour( imgs , _datadir+"/data/" , strCreaContourDataTmp );
_instantPanel = new wxInstantChooserPanel( notebook, "Instant Chooser", true, false, "c" );
_theViewPanel = new wxContourViewPanel( kernelManager->getSourceImage(), notebook );
}
}
-void wxContourMainFrame :: createContour( int typeContour )
+void wxContourMainFrame::createContour( int typeContour )
{
//Creating the manualContourModel and including in the model
manualBaseModel * manModelContour = kernelManager->factoryManualContourModel(typeContour);
std::vector<int> instantVector;
_instantPanel->getInstant( instantVector );
+
+ std::vector<int> tempVector;
+ getInstantVector( tempVector );
+ manModelContour->SetLabel2( std::to_string(tempVector[1]) );
+
std::string theName = kernelManager->createOutline(manModelContour, instantVector);
/*std::vector<int> instantVector;
_instantPanel->getInstant( instantVector );
//JCP 21 - 11 - 08
}
-void wxContourMainFrame::onDeleteContoursActSlice(){
+void wxContourMainFrame::onDeleteContoursActSlice()
+{
//JCP 20-10-08 Undo redo implementation
saveState();
//JCP 20-10-08 Undo redo implementation
- deleteContours( (std::vector<std::string>)_theViewPanel->getSceneManager()->GetlstContoursNameActualSlice() );
+
+ std::vector<int> tempVector;
+ getInstantVector( tempVector );
+ deleteContours( getOutlinesName( tempVector[1] ) );
+// deleteContours( (std::vector<std::string>)_theViewPanel->getSceneManager()->GetlstContoursNameActualSlice() );
+
}
void wxContourMainFrame::onDeleteAllContours(){
//JCP 20-10-08 Undo redo implementation
RefreshInterface();
}
+void wxContourMainFrame::onBeforeAfterContour(bool before,bool after)
+{
+ _theViewPanel->onBeforeAfterContour(before,after);
+ RefreshInterface();
+}
+
+
void wxContourMainFrame::onChangeInstant(std::string name,int actual)
{
_instantPanel->setConceptValue( name, actual );
void wxContourMainFrame::getInstantVector(std::vector<int>& tempVector)
{
- printf("wxContourMainFrame::getInstantVector Warning!! Methon not implemented ... \n");
_instantPanel->getInstant( tempVector );
}
int getWindowLevel();
void onBrigthnessColorWindowLevel(int colorwindow,int windowlevel);
void onInterpolation(bool interpolate);
+ void onBeforeAfterContour(bool before, bool after);
void onChangeInstant(std::string name,int actual);
void resetAppend();
void onSpreadAdd();
{
theShowingImage->GetSpacing(last_spacing);
showingVID = theShowingImage;
+ _before = false;
+ _after = false;
int gapH = 20;
int gapV = 10;
_verticalConceptName = "";
_sceneManager->addToScene(name, true, true, true, false, false );
} // for i
-
-printf("EED \wxContourViewPanel::addNameWrapperToScene Clean this part of code ...\n");
-printf("EED \wxContourViewPanel::addNameWrapperToScene Clean this part of code ...\n");
-printf("EED \wxContourViewPanel::addNameWrapperToScene Clean this part of code ...\n");
-printf("EED \wxContourViewPanel::addNameWrapperToScene Clean this part of code ...\n");
-printf("EED \wxContourViewPanel::addNameWrapperToScene Clean this part of code ...\n");
-printf("EED \wxContourViewPanel::addNameWrapperToScene Clean this part of code ...\n");
-//EED 2019-12-05
-// falta buscar slice antes y despues para encontrar elementos
-// falta cambiar de colores para antes y despues
-// falta un flag que active y desactive esta opcion
-
std::vector<int> tempVector;
wxContourMainFrame::getInstance()->getInstantVector( tempVector );
- // Contours Befor
- std::vector<std::string> lstNameBefor = wxContourMainFrame::getInstance()->getOutlinesName(tempVector[1]-10);
- size = lstNameBefor.size();
- for(i = 0; i < size;i++)
+ if (_before==true)
{
- // ctrol active showCtr
- _sceneManager->addToScene(lstNameBefor[i], true, true, false, false, false );
- } // for i
-
- // Contours After
- std::vector<std::string> lstNameAfter = wxContourMainFrame::getInstance()->getOutlinesName(tempVector[1]+10);
- size = lstNameAfter.size();
- for(i = 0; i < size;i++)
+ std::vector<std::string> lstNameBefor;
+ // Contours Befor
+ for (i=tempVector[1]-1; i>=0; i--)
+ {
+ lstNameBefor = wxContourMainFrame::getInstance()->getOutlinesName( i );
+ size = lstNameBefor.size();
+ if (size!=0)
+ {
+ i=-1;
+ } //if size
+ } // for
+ for(i = 0; i < size;i++)
+ {
+ // ctrol active showCtr
+ _sceneManager->addToScene(lstNameBefor[i], true, true, false, false, false );
+ } // for i
+ } // if _before Contour
+
+ if (_after==true)
{
- // ctrol active showCtr
- _sceneManager->addToScene(lstNameAfter[i], true, true, false, false, false );
- } // for i
-
-
+ std::vector<std::string> lstNameAfter;
+ // Contours After
+ int ext[6];
+ getImageData()->GetExtent(ext);
+ int dimZ=ext[5]-ext[4]+1;
+ for (i=tempVector[1]+1; i<dimZ; i++)
+ {
+ lstNameAfter = wxContourMainFrame::getInstance()->getOutlinesName( i );
+ size = lstNameAfter.size();
+ if (size!=0)
+ {
+ i=dimZ;
+ } //if size
+ } // for
+ for(i = 0; i < size;i++)
+ {
+ // ctrol active showCtr
+ _sceneManager->addToScene(lstNameAfter[i], true, true, false, false, false );
+ } // for i
+ } // if _after Contour
}
std::vector<std::string> wxContourViewPanel::getSelectedObjects(){
wxvtk2dbaseview->SetInterpolate( interpolate );
}
+ void wxContourViewPanel::onBeforeAfterContour(bool before, bool after)
+ {
+ _before = before;
+ _after = after;
+ }
+
void wxContourViewPanel::GetPointsOfActualContour( std::vector<double> *vecX, std::vector<double> *vecY, std::vector<double> *vecZ )
{
_sceneManager->GetPointsOfActualContour(vecX, vecY, vecZ);
* @return _verticalConcept The name of the concept for setting at the vertical bar
*/
std::string getVerticalConceptName( );
-
//------------------------------------------------------------------------------------------------------------
// Other functional methods
//------------------------------------------------------------------------------------------------------------
-
void getSpacing( double * spacing );
-
wxVtkBaseView* getWxVtkBaseView();
-
double getCurrentDeep();
-
void SetVisibleAxis(bool ok);
int GetX();
int GetY();
void onStopCreateROI (wxCommandEvent& event);
void onChangedDeep (wxCommandEvent& event);
void onActionButtonPressed(wxCommandEvent& event);
-
void removeSceneContours();
void addNameWrapperToScene();
-
std::vector<std::string> getSelectedObjects();
-
void RefreshInterface();
-
vtkImageData* getImageData();
-
void configureViewControlTo(std::string theName,manualBaseModel* manModelContour,double* spc,int typeofcontour);
-
- int GetImageDataSizeZ();
-
+ int GetImageDataSizeZ();
void GetImageDataRange(double *range);
-
void SetWidthContour(double width );
-
- int getColorWindow();
-
- int getWindowLevel();
-
+ int getColorWindow();
+ int getWindowLevel();
void onBrigthnessColorWindowLevel(int colorwindow,int windowlevel);
-
void onInterpolation(bool interpolate);
-
+ void onBeforeAfterContour(bool before, bool after);
void GetPointsOfActualContour( std::vector<double> *vecX, std::vector<double> *vecY, std::vector<double> *vecZ );
-
void changeImage(vtkImageData* img);
-
void changeDeep();
-
void setImageSlice(int z);
-
-private:
-
+private:
//------------------------------------------------------------------------------------------------------------
// Attributtes
//------------------------------------------------------------------------------------------------------------
bool _useHorizontalBar;
wxEvtHandler *_eventHandler;
+ bool _before;
+ bool _after;
//EED
- wxVtkMPR2DView * GetwxVtkMPR2DView();
+ wxVtkMPR2DView *GetwxVtkMPR2DView();
// DECLARE_CLASS(wxContourViewPanel)
change->SetInputData(img);
#endif
img->GetSpacing(spc);
- change->SetOutputSpacing(1,1,1);
+// change->SetOutputSpacing(1,1,1);
//EED 18 fev 2014
change->SetOutputOrigin (0, 0, 0);
change->Update();