wxContourMainFrame::getInstance()->onBeforeAfterContour(before,after);
}
+void interfMainPanel::onShowTextContour(bool show)
+{
+ wxContourMainFrame::getInstance()->onShowTextContour(show);
+}
+
void interfMainPanel::onConfigurationPressed()
{
int getWindowLevel();
void onBrigthnessColorWindowLevel(int colorwindow,int windowlevel);
void onInterpolation(bool interpolate);
+ void onShowTextContour(bool show);
void onBeforAfterContour(bool before, bool after);
void onSpreadPressed();
void onConfigurationPressed();
void interfSegmentationPanelVTK::onSegmentationOneSlice( wxCommandEvent& event )
{
- int isovalue = _isovalue->GetValue();
- int sampling = _sampling->GetValue();
- int method = methodRadiobox->GetSelection();
+ int isovalue = _isovalue->GetValue();
+ int sampling = _sampling->GetValue();
+ int method = methodRadiobox->GetSelection();
interfMainPanel::getInstance()->onSegmentationOneSlice(isovalue, sampling, method);
}
void interfSegmentationPanelVTK::onSegmentationAllSlice( wxCommandEvent& event )
{
- int minZ=_mbarrange->GetStart();
- int maxZ=_mbarrange->GetEnd();
- int isovalue = _isovalue->GetValue();
- int sampling = _sampling->GetValue();
- int method = methodRadiobox->GetSelection();
+ int minZ = _mbarrange->GetStart();
+ int maxZ = _mbarrange->GetEnd();
+ int isovalue = _isovalue->GetValue();
+ int sampling = _sampling->GetValue();
+ int method = methodRadiobox->GetSelection();
interfMainPanel::getInstance()->onSegmentationAllSlice(minZ, maxZ, isovalue, sampling, method);
}
_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") );
+ _showTextContourCheckBox = new wxCheckBox(this, -1, _T("Labels Contours") );
+ _showTextContourCheckBox->SetValue(true);
+
+
+ _beforContourCheckBox = new wxCheckBox(this, -1, _T("Befor Contour") );
_beforContourCheckBox->SetValue(false);
- _afterContourCheckBox = new wxCheckBox(this, -1, _T("After Contour") );
+ _afterContourCheckBox = new wxCheckBox(this, -1, _T("After Contour") );
_afterContourCheckBox->SetValue(false);
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( _showTextContourCheckBox->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &interfConfigurationPanel::OnShowTextContour);
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("Window level")) , 1, wxGROW );
- sizer -> Add( _brithtnessWindowLevel , 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( _interpolationCheckBox , 1, wxGROW );
- sizer -> Add( _beforContourCheckBox , 1, wxGROW );
- sizer -> Add( _afterContourCheckBox , 1, wxGROW );
+ wxFlexGridSizer * sizerA = new wxFlexGridSizer(1);
+ sizerA -> Add( new wxStaticText(this,-1, _T("Contour width")) , 1, wxGROW );
+ sizerA -> Add( _withOfContourLine , 1, wxGROW );
+ sizerA -> Add( new wxStaticText(this,-1, _T(" ")) , 1, wxGROW );
+ sizerA -> Add( new wxStaticText(this,-1, _T("Window level")) , 1, wxGROW );
+ sizerA -> Add( _brithtnessWindowLevel , 1, wxGROW );
+ sizerA -> Add( new wxStaticText(this,-1, _T("Color level")) , 1, wxGROW );
+ sizerA -> Add( _brithtnessColorLevel, 1, wxGROW );
+ sizerA -> Add( new wxStaticText(this,-1, _T(" ")) , 1, wxGROW );
+
+ wxFlexGridSizer * sizerB = new wxFlexGridSizer(1);
+ sizerB -> Add( _interpolationCheckBox , 1, wxGROW );
+ sizerB -> Add( new wxStaticText(this,-1, _T(" ")) , 1, wxGROW );
+ sizerB -> Add( _showTextContourCheckBox , 1, wxGROW );
+ sizerB -> Add( new wxStaticText(this,-1, _T(" ")) , 1, wxGROW );
+ sizerB -> Add( _beforContourCheckBox , 1, wxGROW );
+ sizerB -> Add( _afterContourCheckBox , 1, wxGROW );
+
+ wxFlexGridSizer * sizer = new wxFlexGridSizer(2);
+ sizer -> Add( sizerA , 1, wxGROW );
+ sizer -> Add( sizerB , 1, wxGROW );
this->SetSizer( sizer );
//JCP 13-10-08
interfMainPanel::getInstance()->onBeforAfterContour(_beforContourCheckBox->GetValue() , _afterContourCheckBox->GetValue() );
}
+void interfConfigurationPanel::OnShowTextContour(wxCommandEvent& event)
+{
+ interfMainPanel::getInstance()->onShowTextContour(_showTextContourCheckBox->GetValue() );
+}
+
/**
** Begin of the spread panel
void onWidthOfContour(wxScrollEvent& event);
void onBrigthnessColorWindowLevel(wxScrollEvent& event);
void OnInterpolation(wxCommandEvent& event);
+ void OnShowTextContour(wxCommandEvent& event);
void OnBeforAfterContour(wxCommandEvent& event);
wxSlider* _withOfContourLine;
wxSlider* _brithtnessWindowLevel;
wxSlider* _brithtnessColorLevel;
wxCheckBox* _interpolationCheckBox;
+ wxCheckBox* _showTextContourCheckBox;
wxCheckBox* _beforContourCheckBox;
wxCheckBox* _afterContourCheckBox;
};
void wxContourMainFrame::SegmentationOneSlice( int x, int y, int z, int isovalue, int sampling, int method )
{
-printf("EED wxContourMainFrame::SegmentationOneSlice Start\n");
int typeofcontour = 1;
//--Extracting Contour
- //vtkImageData *imagedata = _theViewPanel->getSceneManager()->GetImageData();
vtkImageData *imagedata = getImageData();
-// double *range = imagedata->GetScalarRange();
-// double thr = 1;
vtkImageReslice *imageReslice = vtkImageReslice::New();
//EED
-// double spc[3];
-// imagedata->GetSpacing(spc);
-// x = x*spc[0];
-// y = y*spc[1];
-// z = z*spc[3];
+ double spc[3];
+ imagedata->GetSpacing(spc);
+ x = x*spc[0];
+ y = y*spc[1];
+ z = z;
//EED 2017-01-01 Migration VTK7
#if VTK_MAJOR_VERSION <= 5
#endif
imageReslice->SetInformationInput(imagedata);
imageReslice->SetResliceAxesDirectionCosines(1,0,0, 0,1,0 ,0,0,1);
- imageReslice->SetResliceAxesOrigin(0,0,z);
+ imageReslice->SetResliceAxesOrigin(0,0,z*spc[2]);
imageReslice->SetOutputDimensionality(2);
imageReslice->SetInterpolationModeToLinear();
cpd->UpdateInformation();
vtkPolyDataConnectivityFilter* conn = vtkPolyDataConnectivityFilter::New( );
- conn->SetExtractionModeToClosestPointRegion( );
+
+// conn->SetExtractionModeToPointSeededRegions();
+// conn->SetExtractionModeToCellSeededRegions();
+// conn->SetExtractionModeToSpecifiedRegions();
+// conn->SetExtractionModeToLargestRegion();
+// conn->SetExtractionModeToAllRegions();
+
+ conn->SetExtractionModeToClosestPointRegion();
+
//conn->SetMaxRecursionDepth( 3000 );
//EED 2017-01-01 Migration VTK7
cpd2->UpdateInformation();
vtkStripper* vtkstripper = vtkStripper::New( );
+vtkstripper->SetJoinContiguousSegments(true);
vtkstripper->SetMaximumLength(20000);
//EED 2017-01-01 Migration VTK7
#if VTK_MAJOR_VERSION <= 5
vtkstripper->SetInput( cpd2->GetOutput() );
#else
vtkstripper->SetInputData( cpd2->GetOutput() );
+// vtkstripper->SetInputData( cntVTK->GetOutput() );
+
#endif
vtkstripper->Update();
vtkstripper->UpdateInformation();
polyDataResult->GetLines()->Print(myfile);
myfile.close();
*/
-
- cntVTK -> Delete();
- cpd2 -> Delete();
- cpd -> Delete();
- conn -> Delete();
-
+ cntVTK -> Delete();
+ cpd2 -> Delete();
+ cpd -> Delete();
+ conn -> Delete();
//--Calculating control points
-
std::vector<double> vecX;
std::vector<double> vecY;
std::vector<double> vecZ;
-
std::vector<double> vecCtrlPointX;
std::vector<double> vecCtrlPointY;
std::vector<double> vecCtrlPointZ;
-
printf("EED wxContourMainFrame::SegmentationOneSlice GetNumberOfLines=%d \n",polyDataResult->GetNumberOfLines() );
int numberOfPointsInCell;
polyDataResult->PrintSelf( std::cout, vtkIndent(0) );
+ if (polyDataResult->GetNumberOfCells()>0)
+ {
+ double *p;
+ printf("EED wxContourMainFrame::SegmentationOneSlice A \n");
+ vtkCell* vtkcell = polyDataResult->GetCell( 0 );
+ printf("EED wxContourMainFrame::SegmentationOneSlice B \n");
+ // int ii,size=polyDataResult->GetNumberOfPoints();
+ int ii,size=vtkcell->GetNumberOfPoints();
+ printf("EED wxContourMainFrame::SegmentationOneSlice C \n");
+ int id;
+ for (ii=1;ii<=size;ii++)
+ {
+ // id = polyDataResult->GetLines()->GetData()->GetValue(ii);
+ // p = polyDataResult->GetPoint(id);
+ p = vtkcell->GetPoints()->GetPoint(ii);
- double *p;
- int ii,size=polyDataResult->GetNumberOfPoints();
- int id;
- for (ii=1;ii<=size;ii++)
- {
- id = polyDataResult->GetLines()->GetData()->GetValue(ii);
- p = polyDataResult->GetPoint(id);
-printf("EED wxContourMainFrame::SegmentationOneSlice (%d) id=%d px=%f py=%f\n",ii,id, p[0],p[1]);
-// double x=p[0];
-// double y=p[1];
- vecX.push_back( p[0] );
- vecY.push_back( p[1] );
-//EED 2017-12-16
- vecZ.push_back( -900 );
-// vecZ.push_back( p[2] );
- }
-
+ printf("EED wxContourMainFrame::SegmentationOneSlice (%d) id=%d px=%f py=%f\n",ii,id, p[0],p[1]);
+ // double x=p[0];
+ // double y=p[1];
+ vecX.push_back( p[0] );
+ vecY.push_back( p[1] );
+ //EED 2017-12-16
+ vecZ.push_back( -900 );
+ // vecZ.push_back( p[2] );
+ }
- ExtractControlPoints2D *extractcontrolpoints2d = new ExtractControlPoints2D();
- extractcontrolpoints2d->SetContour( &vecX , &vecY , &vecZ );
+ ExtractControlPoints2D *extractcontrolpoints2d = new ExtractControlPoints2D();
+ extractcontrolpoints2d->SetContour( &vecX , &vecY , &vecZ );
-//PROOFS
- /*if (methodRadiobox->GetSelection()==0){
- extractcontrolpoints2d->GetInitialControlPoints( &vecCtrlPointX , &vecCtrlPointY , &vecCtrlPointZ );
- }
- if (methodRadiobox->GetSelection()==1){
- extractcontrolpoints2d->GetControlPoints( &vecCtrlPointX , &vecCtrlPointY , &vecCtrlPointZ );
- }
- if (methodRadiobox->GetSelection()==2){
- extractcontrolpoints2d->SetSamplingControlPoints( sampling );
- extractcontrolpoints2d->GetSamplingControlPoints( &vecCtrlPointX , &vecCtrlPointY , &vecCtrlPointZ );
- }*/
+ //PROOFS
+ /*if (methodRadiobox->GetSelection()==0){
+ extractcontrolpoints2d->GetInitialControlPoints( &vecCtrlPointX , &vecCtrlPointY , &vecCtrlPointZ );
+ }
+ if (methodRadiobox->GetSelection()==1){
+ extractcontrolpoints2d->GetControlPoints( &vecCtrlPointX , &vecCtrlPointY , &vecCtrlPointZ );
+ }
+ if (methodRadiobox->GetSelection()==2){
+ extractcontrolpoints2d->SetSamplingControlPoints( sampling );
+ extractcontrolpoints2d->GetSamplingControlPoints( &vecCtrlPointX , &vecCtrlPointY , &vecCtrlPointZ );
+ }*/
- if (method==0)
- {
- extractcontrolpoints2d->GetInitialControlPoints( &vecCtrlPointX , &vecCtrlPointY , &vecCtrlPointZ );
- } else if (method==1){
- extractcontrolpoints2d->GetControlPoints( &vecCtrlPointX , &vecCtrlPointY , &vecCtrlPointZ );
- } else if (method==2){
- extractcontrolpoints2d->SetSamplingControlPoints( sampling );
- extractcontrolpoints2d->GetSamplingControlPoints( &vecCtrlPointX , &vecCtrlPointY , &vecCtrlPointZ );
- }
+ if (method==0)
+ {
+ extractcontrolpoints2d->GetInitialControlPoints( &vecCtrlPointX , &vecCtrlPointY , &vecCtrlPointZ );
+ } else if (method==1){
+ extractcontrolpoints2d->GetControlPoints( &vecCtrlPointX , &vecCtrlPointY , &vecCtrlPointZ );
+ } else if (method==2){
+ extractcontrolpoints2d->SetSamplingControlPoints( sampling );
+ extractcontrolpoints2d->GetSamplingControlPoints( &vecCtrlPointX , &vecCtrlPointY , &vecCtrlPointZ );
+ }
- //--Adding contour to the system
- std::vector<int> actualInstantVector;
- _instantPanel->getInstant( actualInstantVector );
- actualInstantVector[1]=z;
+ //--Adding contour to the system
+ std::vector<int> actualInstantVector;
+ _instantPanel->getInstant( actualInstantVector );
+ actualInstantVector[1]=z;
- int j,sizeCtrPt = vecCtrlPointX.size();
- manualBaseModel *manModelContour = kernelManager->factoryManualContourModel( typeofcontour );
-printf("EED wxContourMainFrame::SegmentationOneSlice sizeCtrPt=%d %d %d\n" , sizeCtrPt
- , ((sizeCtrPt/100)+1)*100 *2
- , manModelContour->GetNumberOfPointsSpline()
- );
- manModelContour->SetNumberOfPointsSpline( ((sizeCtrPt/100)+1)*100 *2 );
- if (sizeCtrPt>=3)
- {
- for (j=0 ; j<sizeCtrPt ; j++)
- {
- manModelContour->AddPoint( vecCtrlPointX[j] , vecCtrlPointY[j] , vecCtrlPointZ[j] );
- } // for
- std::string theName;
- //theName = _modelManager->createOutline( manModelContour, actualInstantVector );
- theName = kernelManager->createOutline( manModelContour, actualInstantVector );
- bool addedModel = theName.compare("") != 0;
- if( addedModel )
+ int j,sizeCtrPt = vecCtrlPointX.size();
+ manualBaseModel *manModelContour = kernelManager->factoryManualContourModel( typeofcontour );
+ manModelContour->SetNumberOfPointsSpline( ((sizeCtrPt/100)+1)*100 *2 );
+ manModelContour->SetLabel2( std::to_string(z) );
+ if (sizeCtrPt>=3)
{
- double spc[3];//Si no hay imagen pero hay contornos que spacing se pone por default
- _theViewPanel->getSpacing(spc);
- //Adding the manualContourControler to interface objects structure
- //Adding the manualViewContour to interface objects structure
- //_theViewPanel->getSceneManager()->setControlActiveStateOfALL( false );//This call is being done here because if the ROI is created underneath the previously created ROIS will still be active.
- _theViewPanel->configureViewControlTo(theName, manModelContour, spc, typeofcontour);
- //_theViewPanel->getSceneManager()->configureViewControlTo( theName, manModelContour,spc, typeofcontour ) ;
- } // if addedModel
- } // if sizeCtrPt
-printf("EED wxContourMainFrame::SegmentationOneSlice End\n");
+ for (j=0 ; j<sizeCtrPt ; j++)
+ {
+ manModelContour->AddPoint( vecCtrlPointX[j] / spc[0], vecCtrlPointY[j] / spc[1], vecCtrlPointZ[j] );
+ } // for
+ std::string theName;
+ //theName = _modelManager->createOutline( manModelContour, actualInstantVector );
+ theName = kernelManager->createOutline( manModelContour, actualInstantVector );
+ bool addedModel = theName.compare("") != 0;
+ if( addedModel )
+ {
+ double spc[3];//Si no hay imagen pero hay contornos que spacing se pone por default
+ _theViewPanel->getSpacing(spc);
+ //Adding the manualContourControler to interface objects structure
+ //Adding the manualViewContour to interface objects structure
+ //_theViewPanel->getSceneManager()->setControlActiveStateOfALL( false );//This call is being done here because if the ROI is created underneath the previously created ROIS will still be active.
+ _theViewPanel->configureViewControlTo(theName, manModelContour, spc, typeofcontour);
+ //_theViewPanel->getSceneManager()->configureViewControlTo( theName, manModelContour,spc, typeofcontour ) ;
+ } // if addedModel
+ } // if sizeCtrPt
+ } // if NumberOfCells > 0
+
+printf("EED wxContourMainFrame::SegmentationOneSlice End\n");
}
int wxContourMainFrame::GetImageDataSizeZ()
//JCP 20-10-08 Undo redo implementation
wxBusyCursor wait;
- int x = _theViewPanel->GetX();
- int y = _theViewPanel->GetY();
- int z;
- double porcent;
- wxString tmpString;
- double totalZ = maxZ-minZ+1;
+ int x = _theViewPanel->GetX();
+ int y = _theViewPanel->GetY();
+ int z;
+ double porcent;
+ wxString tmpString;
+ double totalZ = maxZ-minZ+1;
for( z=minZ ; z<=maxZ ; z++ )
{
porcent = 100.0* (z-minZ)/totalZ;
RefreshInterface();
}
+void wxContourMainFrame::onShowTextContour(bool show)
+{
+ _theViewPanel->onShowTextContour(show);
+ RefreshInterface();
+}
void wxContourMainFrame::onChangeInstant(std::string name,int actual)
{
_instantPanel->setConceptValue( name, actual );
}
-
void wxContourMainFrame::resetAppend()
{
kernelManager->resetAppend();
}
-
void wxContourMainFrame::onSpreadAdd()
{
std::vector<double> vecX;
int getWindowLevel();
void onBrigthnessColorWindowLevel(int colorwindow,int windowlevel);
void onInterpolation(bool interpolate);
+ void onShowTextContour(bool show);
void onBeforeAfterContour(bool before, bool after);
void onChangeInstant(std::string name,int actual);
void resetAppend();
{
theShowingImage->GetSpacing(last_spacing);
showingVID = theShowingImage;
- _before = false;
- _after = false;
+ _showBeforeContour = false;
+ _showAfterContour = false;
int gapH = 20;
int gapV = 10;
_verticalConceptName = "";
_sceneManager->addToScene(name, true, true, true, false, false );
} // for i
+ _sceneManager->SetLabelNumberOfContours( "contours:"+std::to_string(size) );
+
std::vector<int> tempVector;
wxContourMainFrame::getInstance()->getInstantVector( tempVector );
- if (_before==true)
+ if (_showBeforeContour==true)
{
+ size=0;
std::vector<std::string> lstNameBefor;
// Contours Befor
for (i=tempVector[1]-1; i>=0; i--)
} // for i
} // if _before Contour
- if (_after==true)
+printf("EED wxContourViewPanel::addNameWrapperToScene A\n");
+ if (_showAfterContour==true)
{
+ size=0;
std::vector<std::string> lstNameAfter;
// Contours After
int ext[6];
_sceneManager->addToScene(lstNameAfter[i], true, true, false, false, false );
} // for i
} // if _after Contour
+printf("EED wxContourViewPanel::addNameWrapperToScene B\n");
+
}
- std::vector<std::string> wxContourViewPanel::getSelectedObjects(){
+ std::vector<std::string> wxContourViewPanel::getSelectedObjects()
+ {
return _sceneManager->getSelectedObjects();
}
- void wxContourViewPanel::RefreshInterface(){
+ void wxContourViewPanel::RefreshInterface()
+ {
getWxVtkBaseView()->Refresh();
}
- vtkImageData* wxContourViewPanel::getImageData(){
+ vtkImageData* wxContourViewPanel::getImageData()
+ {
return _sceneManager->GetImageData();
}
void wxContourViewPanel::onBeforeAfterContour(bool before, bool after)
{
- _before = before;
- _after = after;
+ _showBeforeContour = before;
+ _showAfterContour = after;
+ }
+
+ void wxContourViewPanel::onShowTextContour(bool show)
+ {
+ _sceneManager->SetShowTextContour( show );
}
void wxContourViewPanel::GetPointsOfActualContour( std::vector<double> *vecX, std::vector<double> *vecY, std::vector<double> *vecZ )
_sceneManager->GetPointsOfActualContour(vecX, vecY, vecZ);
}
- void wxContourViewPanel::setImageSlice(int z){
+ void wxContourViewPanel::setImageSlice(int z)
+ {
vtkInteractorStyleBaseView* stylebaseview = (vtkInteractorStyleBaseView*) _sceneManager->getWxVtkViewBase()->GetInteractorStyleBaseView();
wxVtk2DBaseView* baseview = (wxVtk2DBaseView*)stylebaseview->GetWxVtk2DBaseView();
baseview->SetActualSlice(z);
* Gets the vertical concept name
* @return _verticalConcept The name of the concept for setting at the vertical bar
*/
- std::string getVerticalConceptName( );
+ std::string getVerticalConceptName( );
//------------------------------------------------------------------------------------------------------------
// Other functional methods
//------------------------------------------------------------------------------------------------------------
- void getSpacing( double * spacing );
- wxVtkBaseView* getWxVtkBaseView();
- double getCurrentDeep();
- void SetVisibleAxis(bool ok);
- int GetX();
- int GetY();
- int GetZ();
- void SetXY(int x, int y);
- void Refresh();
+ void getSpacing( double * spacing );
+ wxVtkBaseView* getWxVtkBaseView();
+ double getCurrentDeep();
+ void SetVisibleAxis(bool ok);
+ int GetX();
+ int GetY();
+ int GetZ();
+ void SetXY(int x, int y);
+ void Refresh();
//this method should be deleted
int getWindowLevel();
void onBrigthnessColorWindowLevel(int colorwindow,int windowlevel);
void onInterpolation(bool interpolate);
+ void onShowTextContour(bool show);
void onBeforeAfterContour(bool before, bool after);
void GetPointsOfActualContour( std::vector<double> *vecX, std::vector<double> *vecY, std::vector<double> *vecZ );
void changeImage(vtkImageData* img);
bool _useHorizontalBar;
wxEvtHandler *_eventHandler;
- bool _before;
- bool _after;
+ bool _showBeforeContour;
+ bool _showAfterContour;
//EED
_waiting = false;
_creatingROI = false;
_drawingSelectionROI = false;
+ _showTextContour = true;
SetWidthContour(1.0);
_wxVtk_BaseView = theWxBaseViewToManage;
if( _wxVtk_BaseView!=NULL )
SetVtkInteractorStyleBaseView( theInteractorStyleBaseView );
}
configureSelectionROI( spc );
+ configureTextNumberOfContour();
}
//------------------------------------------------------------------------------------------------------------
manViewerContour->RefreshContour();
addToScene( theKeyName );
}
- //------------------------------------------------------------------------------------------------------------
- void wxVtkBaseView_SceneManager :: configureSelectionROI( double * spc )
- {
+//------------------------------------------------------------------------------------------------------------
+void wxVtkBaseView_SceneManager :: configureSelectionROI( double * spc )
+{
_controlerSelectionROI = new manualRoiControler();
_viewerSelectionROI = new manualViewRoi();
_modelSelectionROI = new manualContourModel();
_controlerSelectionROI->SetModelView( _modelSelectionROI , _viewerSelectionROI );
((vtkInteractorStyleBaseView*)_wxVtk_BaseView->GetInteractorStyleBaseView())->AddInteractorStyleMaracas( _controlerSelectionROI );
_controlerSelectionROI->SetActive(false);
- }
+}
- //------------------------------------------------------------------------------------------------------------
- ContourWrap_ViewControl * wxVtkBaseView_SceneManager :: insertWrap( std::string theKeyName, manualContourBaseControler * manContourControl, manualViewBaseContour * manViewerContour )
+//------------------------------------------------------------------------------------------------------------
+void wxVtkBaseView_SceneManager::configureTextNumberOfContour()
+{
+ // Text Window Level
+ vtkTextActor *textActor = vtkTextActor::New();
+ textActor->SetDisplayPosition(10, 85);
+ textActor->SetInput("contours:--");
+ // Set coordinates to match the old vtkScaledTextActor default value
+ textActor->GetPosition2Coordinate()->SetCoordinateSystemToNormalizedViewport();
+ textActor->GetPosition2Coordinate()->SetValue( 0.2 , 0.2 );
+ vtkTextProperty *tprop = textActor->GetTextProperty();
+ tprop->SetFontSize(14);
+ tprop->SetFontFamilyToArial();
+ tprop->SetColor(1, 1, 0);
+ _wxVtk_BaseView->GetRenderer()->AddActor2D(textActor);
+ _numberOfContoursTextActor=textActor;
+}
+
+//------------------------------------------------------------------------------------------------------------
+void wxVtkBaseView_SceneManager::SetLabelNumberOfContours( std::string label )
+{
+ _numberOfContoursTextActor->SetInput( label.c_str() );
+}
+
+//------------------------------------------------------------------------------------------------------------
+ContourWrap_ViewControl * wxVtkBaseView_SceneManager :: insertWrap( std::string theKeyName, manualContourBaseControler * manContourControl, manualViewBaseContour * manViewerContour )
{
ContourWrap_ViewControl * newContourWrap = new ContourWrap_ViewControl(manContourControl, manViewerContour);
if(_contours_ViewControl == NULL)
if( !append )
{
removeSceneContours();
- }
+ } // if !append
+
_sceneContours_ViewControl->insert(std::pair <std::string, ContourWrap_ViewControl *> ( theKeyName, contourWRP ) );
- if ( visualization )
+
+ if ( visualization==true )
{
contourWRP->getViewer()->AddCompleteContourActor( ifShowCtrlPoints );
- }
+ } // if visualization
- if( control )
+ if( control==true )
{
((vtkInteractorStyleBaseView*)_wxVtk_BaseView->GetInteractorStyleBaseView())->AddInteractorStyleMaracas( contourWRP->getControler() );
- }
+ } // if contour
if( !control )
{
contourWRP->getViewer()->SetColorNormalContour(1,0,0);
} else {
contourWRP->getViewer()->SetColorNormalContour(0,0,1);
- }
+ } // if !contour
- if( ifActive )
+ if( ifActive==true )
{
contourWRP->getControler()->SetActive( true );
contourWRP->getViewer()->RemoveTextActor();
- }
+ } // if ifActive
+
+ contourWRP->getViewer()->SetShowText(_showTextContour);
}
//------------------------------------------------------------------------------------------------------------
} // if
}
+ void wxVtkBaseView_SceneManager::SetShowTextContour(bool show)
+ {
+ _showTextContour = show;
+ }
+
bool wxVtkBaseView_SceneManager::isEditableCControler(std::string theKeyName){
ContourWrap_ViewControl* ccon = getContourWrap_ViewControlOf(theKeyName);
int GetImageDataSizeZ();
void GetImageDataRange( double *range );
void SetWidthContour(double width);
+ void SetShowTextContour(bool show);
//JCP 21 - 09 - 08
bool isEditableCControler(std::string theKeyName);
bool isCtrlPressed();
bool isShiftPressed();
char getLastKeyCode();
+
+ void SetLabelNumberOfContours( std::string label );
+
private:
//------------------------------------------------------------------------------------------------------------
// Private methods
//------------------------------------------------------------------------------------------------------------
+ void configureTextNumberOfContour();
//------------------------------------------------------------------------------------------------------------
double _widthOfControlPoint;
bool _ctrlKey;
bool _shiftKey;
+ bool _showTextContour;
+ vtkTextActor *_numberOfContoursTextActor;
};
#endif // __wxVtkBaseView_SceneManager_HEADER_FILE__