From 4443a8fe2b4992b6abee8531917fd0803018fc12 Mon Sep 17 00:00:00 2001 From: Eduardo Davila Date: Mon, 20 Apr 2009 07:39:24 +0000 Subject: [PATCH] BUG contour line --- .../wxWindows/Contour/AutoControlPoints.cxx | 64 +++++++++---------- .../wxWindows/Contour/ContourCrownWidget.cxx | 7 +- .../Contour/ExtractControlPoints2D.cxx | 2 +- .../wxWindows/Contour/Propagation.cxx | 19 +++--- .../src/interface/wxWindows/manualContour.cpp | 54 ++++++---------- .../src/interface/wxWindows/manualContour.h | 2 +- .../wxWindows/widgets/wxMPRWidget.cxx | 43 +++++++++++-- .../wxWindows/widgets/wxVtkBaseView.cxx | 15 +++++ 8 files changed, 118 insertions(+), 88 deletions(-) diff --git a/lib/maracasVisuLib/src/interface/wxWindows/Contour/AutoControlPoints.cxx b/lib/maracasVisuLib/src/interface/wxWindows/Contour/AutoControlPoints.cxx index aa12445..c17c1c5 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/Contour/AutoControlPoints.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/Contour/AutoControlPoints.cxx @@ -315,7 +315,7 @@ void AutoControlPoints::InterCircle(std::vector*InX, std::vector //std::ofstream file1; //file1.open( "Temp.txt" ); - for(i=0; i*InX, std::vecto vecX->set_var(_chargecontrolpointsX[i]); vecY->set_var(_chargecontrolpointsY[i]); - for(j=0; jsize(); j++) + for(j=0; j<(int)(InX->size()); j++) { jj = (j+1)%(InX->size()); m2 = Slope((*InX)[j],(*InY)[j],(*InX)[jj],(*InY)[jj]); @@ -737,7 +737,7 @@ void AutoControlPoints::IntersectionPoints() printf("\n\n There is an invalid intersection: Must see AutoControlPoints::IntersectionPoints() method"); } JCP 30-08-09 */ - for(i=0; i<_intervectorX.size(); i++){ + for(i=0; i<(int)(_intervectorX.size()); i++){ min = 9999; posj = -1; for(j=0; j<_intervectorX[i].getsize_vec(); j++) { @@ -814,14 +814,14 @@ void AutoControlPoints::ErrorBetweenContours() // FILE *fd; // fd = fopen("C:/bbtk_JS/data/interErrorData.txt","w"); - for(i=0; i<_interpointsX.size(); i++) + for(i=0; i<(int)(_interpointsX.size()); i++) { _errorvector.push_back( (sqrt( pow( _interpointsX[i]-_intervectorX[i].get_var(),2 ) + pow( _interpointsY[i]-_intervectorY[i].get_var(),2 ) )/_pathsize)*100 ); // fprintf(fd,"\n%d %f",i,_errorvector[i]); } // fclose(fd); double max = -1; - for(i=0; i<_errorvector.size(); i++) + for(i=0; i<(int)(_errorvector.size()); i++) { if(_interpointsX[i] != -1) { @@ -859,7 +859,7 @@ printf("\n XMAX = %f, YMAX = %f, XX = %f, YY = %f",xmax,ymax,xx,yy); for(i=(int)_errorpos; findA!=true; i++) { ii = i%_errorvector.size(); - for(j=0; j<_controlpointsX.size(); j++) + for(j=0; j<(int)(_controlpointsX.size()); j++) { if( ((float)_controlpointsX[j]-1.5<=(float)_intervectorX[ii].get_var()) && ((float)_intervectorX[ii].get_var()<=(float)_controlpointsX[j]+1.5) && ((float)_controlpointsY[j]-1.5<=(float)_intervectorY[ii].get_var()) && ((float)_intervectorY[ii].get_var()<=(float)_controlpointsY[j]+1.5) ) @@ -876,7 +876,7 @@ printf("\n XMAX = %f, YMAX = %f, XX = %f, YY = %f",xmax,ymax,xx,yy); { i = _errorvector.size(); } - for(j=0; j<_controlpointsX.size(); j++) + for(j=0; j<(int)(_controlpointsX.size()); j++) { if( ((float)_controlpointsX[j]-1.5<=(float)_intervectorX[i].get_var()) && ((float)_intervectorX[i].get_var()<=(float)_controlpointsX[j]+1.5) && ((float)_controlpointsY[j]-1.5<=(float)_intervectorY[i].get_var()) && ((float)_intervectorY[i].get_var()<=(float)_controlpointsY[j]+1.5) ) @@ -893,7 +893,7 @@ printf("\n XMAX = %f, YMAX = %f, XX = %f, YY = %f",xmax,ymax,xx,yy); if(posA tempX; std::vector tempY; std::vector tempZ; - for(i=0; i<_controlpointsX.size(); i++) + for(i=0; i<(int)(_controlpointsX.size()); i++) { if(i == id) { @@ -952,7 +952,7 @@ void AutoControlPoints::InterBetweenControl( ) // FILE *fd; // fd = fopen("C:/bbtk_JS/data/InterBetweenControl.txt","w"); - for(i=0; i<_chargecontrolpointsX.size()-1; i++) + for(i=0; i<(int)(_chargecontrolpointsX.size())-1; i++) { ii = (i+1)%(_chargecontrolpointsX.size()); m1 = Slope(_chargecontrolpointsX[i],_chargecontrolpointsY[i],_chargecontrolpointsX[ii],_chargecontrolpointsY[ii]); @@ -965,7 +965,7 @@ void AutoControlPoints::InterBetweenControl( ) vecX->set_var(_chargecontrolpointsX[i]); vecY->set_var(_chargecontrolpointsY[i]); - for(j=0; j<_chargecontrolpointsX.size(); j++) + for(j=0; j<(int)(_chargecontrolpointsX.size()); j++) { jj = (j+1)%(_chargecontrolpointsX.size()); m2 = Slope(_chargecontrolpointsX[j],_chargecontrolpointsY[j],_chargecontrolpointsX[jj],_chargecontrolpointsY[jj]); @@ -1021,7 +1021,7 @@ void AutoControlPoints::fixBetweenControl() float vecx,vecy,varx,vary; // FILE *fd; // fd = fopen("C:/bbtk_JS/data/InterBetweenControlFix.txt","w"); - for(i=0; i<_intervecXX.size(); i++) + for(i=0; i<(int)(_intervecXX.size()); i++) { Vector *vx = new Vector(); Vector *vy = new Vector(); @@ -1119,7 +1119,7 @@ void AutoControlPoints::PossibleIntersections( std::vector*InX, std::vec if(_intervectorX.size() != 0) { // fd = fopen("C:/bbtk_JS/data/InterPossibleIntersections.txt","w"); - for(i=0; i<_intervectorX.size(); i++) + for(i=0; i<(int)(_intervectorX.size()); i++) { // fprintf(fd,"\n Para X = %f, Y = %f",_intervectorX[i].get_var(),_intervectorY[i].get_var()); if(_intervectorX[i].getsize_vec() > 1) @@ -1136,7 +1136,7 @@ void AutoControlPoints::PossibleIntersections( std::vector*InX, std::vec ity = arrY.begin(); itxx = arrX.begin()+1; ityy = arrY.begin()+1; - for(j=0; j _intervectorX[i].get_var()) && (*ity < _intervectorY[i].get_var()) && @@ -1225,7 +1225,7 @@ void AutoControlPoints::PossibleIntersections( std::vector*InX, std::vec _intervectorX[i].resetVec(); _intervectorY[i].resetVec(); //printf("\n _intervector(%d) Size = %d",i,_intervectorX[i].getsize_vec()); - for(k=0; k x_int = %f, y_int = %f",arrX[k],arrY[k]); @@ -1247,10 +1247,10 @@ void AutoControlPoints::ControlInContour(std::vector*InX, std::vectorsize()) && (find!=true); j++) + for(j=0; (j<(int)(InX->size())) && (find!=true); j++) { if( ((*InX)[j]-range<=_controlpointsX[i]) && (_controlpointsX[i]<=(*InX)[j]+range) && ((*InY)[j]-range<=_controlpointsY[i]) && (_controlpointsY[i]<=(*InY)[j]+range) ) { @@ -1317,7 +1317,7 @@ for(i=0; i<_controlpointsX.size(); i++) _controlpointsY.clear(); _controlpointsZ.clear(); - for(i=0; i prom; i++) { prom = promactual; - for(i=0; i*InX, std:: ity = _controlpointsY.begin(); for(i=_contIncontpos[h],j=_contIncontpos[h]; (i>_contIncontpos[hh]) && (promactual1>prom1); i--) { - if(j == InX->size()) + if(j == (int)(InX->size())) { j = 0; } @@ -1503,7 +1503,7 @@ printf("\n"); _controlpointsZ.clear(); vf->copyVector(&_minmaxlocalX,&_controlpointsX); vf->copyVector(&_minmaxlocalY,&_controlpointsY); - for(int i=0; i<_minmaxlocalX.size(); i++) + for(int i=0; i<(int)(_minmaxlocalX.size()); i++) { _controlpointsZ.push_back( (*InZ)[0] ); } @@ -1550,7 +1550,7 @@ printf("\n"); if(inicontrolpoints<10) { int points = (int)((inipercentage*3*InX->size())/100); - for (int i=0; isize(); i++, h++) + for (int i=0; i<(int)(InX->size()); i++, h++) { if( h == points ) { @@ -1564,7 +1564,7 @@ printf("\n"); if(inicontrolpoints>=10) { int points = (int)((inipercentage*2*InX->size())/100); - for (int i=0; isize(); i++, h++) + for (int i=0; i<(int)(InX->size()); i++, h++) { if( h == points ) { @@ -1621,7 +1621,7 @@ void AutoControlPoints::GetInitialNewPoints(std::vector*InX, std::vector _controlpointsZ.clear(); vf->copyVector(&_minmaxlocalX,&_controlpointsX); vf->copyVector(&_minmaxlocalY,&_controlpointsY); - for(int i=0; i<_minmaxlocalX.size(); i++) + for(int i=0; i<(int)(_minmaxlocalX.size()); i++) { _controlpointsZ.push_back( (*InZ)[0] ); } diff --git a/lib/maracasVisuLib/src/interface/wxWindows/Contour/ContourCrownWidget.cxx b/lib/maracasVisuLib/src/interface/wxWindows/Contour/ContourCrownWidget.cxx index f05103c..8ce8e8e 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/Contour/ContourCrownWidget.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/Contour/ContourCrownWidget.cxx @@ -567,8 +567,7 @@ void wxMaracasCoutourTool::EreaseLastContour(wxCommandEvent& event) { while(!feof(fd)) { - fscanf(fd,""); // ?? JPRx - //fscanf(fd," %s %d",&firstline,&size); // JPRx +// //fscanf(fd," %s %d",&firstline,&size); // JPRx fscanf(fd," %s %d",firstline,&size); _SizesC.push_back(size); @@ -599,7 +598,7 @@ void wxMaracasCoutourTool::EreaseLastContour(wxCommandEvent& event) if(fd!=NULL) { int cont = 0; - for(i=0; i<_SizesC.size(); i++) + for(i=0; i<(int)(_SizesC.size()); i++) { fprintf(fd,"\nNumberOfPoints %d", _SizesC[i] ); for(j=0; j<_SizesC[i]; j++) @@ -670,7 +669,7 @@ void wxMaracasCoutourTool::EreaseLastCP(wxCommandEvent& event) if(fd!=NULL) { int cont = 0; - for(i=0; i<_SizesC.size(); i++) + for(i=0; i<(int)(_SizesC.size()); i++) { fprintf(fd,"\nNumberOfControlPoints %d", _SizesC[i] ); for(j=0; j<_SizesC[i]; j++) diff --git a/lib/maracasVisuLib/src/interface/wxWindows/Contour/ExtractControlPoints2D.cxx b/lib/maracasVisuLib/src/interface/wxWindows/Contour/ExtractControlPoints2D.cxx index bb9344e..6fb096d 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/Contour/ExtractControlPoints2D.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/Contour/ExtractControlPoints2D.cxx @@ -93,7 +93,7 @@ void ExtractControlPoints2D::GetSamplingControlPoints(std::vector*pOutX, int h = 1; //int j=0; // JPRx int points = (int)(_InX.size()/_numsampling); - for (int i=0; i<_InX.size(); i++, h++) + for (int i=0; i<(int)(_InX.size()); i++, h++) { if( h == points ) { diff --git a/lib/maracasVisuLib/src/interface/wxWindows/Contour/Propagation.cxx b/lib/maracasVisuLib/src/interface/wxWindows/Contour/Propagation.cxx index 2ccb89b..c6d2365 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/Contour/Propagation.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/Contour/Propagation.cxx @@ -54,7 +54,7 @@ void Vector::copyVector( std::vector*vec1, std::vector*vec2 ) if( vec1->size() != 0 ) { vec2->clear(); - for(i=0; isize(); i++) + for(i=0; i<(int)(vec1->size()); i++) { Vector *temp = new Vector(); temp->set_var( (*vec1)[i].get_var() ); @@ -71,7 +71,7 @@ void Vector::copyVector( std::vector*vec1, std::vector*vec2 ) void Vector::printVector(std::vector*vec1) { int i,j; - for(i=0; isize(); i++) + for(i=0; i<(int)(vec1->size()); i++) { printf("\n Pos (%d) => var = %f",i,(*vec1)[i].get_var()); for(j=0; j<(*vec1)[i].getsize_vec(); j++) @@ -110,7 +110,7 @@ int Vector::get_plane() //------------------------------------------------------------------------------------------------------------------------------------------ double Vector::get_x(int id) { - if( (-1*InX, std::vector*In } _KeyContourSizes.insert( _KeyContourSizes.begin() + idKeyContourSizes , InX->size() ); - for(i=0; isize(); i++) + for(i=0; i<(int)(InX->size()); i++) { _KeyContourX.insert( _KeyContourX.begin() + idKeyContour, (*InX)[i] ); _KeyContourY.insert( _KeyContourY.begin() + idKeyContour, (*InY)[i] ); @@ -1153,6 +1153,7 @@ vtkImageData* PropContour::CalculeSplinePropagation() { return method_Spline(&_KeyContourX,&_KeyContourY,&_KeyContourZ,&_KeyContourSizes); } + return NULL; } //--------------------------------------------------------------------------------------------------- void PropContour::GetKeyContours(std::vector*KeyX, std::vector*KeyY, std::vector*KeyZ, std::vector*KeyS) @@ -1163,11 +1164,11 @@ void PropContour::GetKeyContours(std::vector*KeyX, std::vector*K KeyZ->clear(); KeyS->clear(); - for(i=0; i<_KeyContourSizes.size(); i++) + for(i=0; i<(int)(_KeyContourSizes.size()); i++) { KeyS->push_back( _KeyContourSizes[i] ); } - for(i=0; i<_KeyContourX.size(); i++) + for(i=0; i<(int)(_KeyContourX.size()); i++) { KeyX->push_back( _KeyContourX[i] ); KeyY->push_back( _KeyContourY[i] ); @@ -1179,7 +1180,7 @@ void PropContour::GetPropagatedContours( std::vector*planevec ) { int i,j; planevec->clear(); - for(i=0; i<_planevector.size(); i++) + for(i=0; i<(int)(_planevector.size()); i++) { Vector *temp = new Vector(); temp->set_plane( _planevector[i].get_plane() ); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/manualContour.cpp b/lib/maracasVisuLib/src/interface/wxWindows/manualContour.cpp index a2b89d7..39fb250 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/manualContour.cpp +++ b/lib/maracasVisuLib/src/interface/wxWindows/manualContour.cpp @@ -144,8 +144,9 @@ void manualContourModelCircle::UpdateSpline() // virtal manualContourModelLine::manualContourModelLine() : manualContourModel() { - SetNumberOfPointsSpline(2); - SetNumberOfPointsSpline(2); +printf("EED manualContourModelLine::manualContourModelLine \n"); + // SetNumberOfPointsSpline(2); + SetNumberOfPointsSpline(100); } manualContourModelLine::~manualContourModelLine() @@ -174,8 +175,10 @@ int manualContourModelLine::GetTypeModel() //virtual return 6; } + //---------------------------------------------------------------- -void manualContourModelLine::GetSpline_i_Point(int i, double *x, double *y, double *z) // virtal +/* +void manualContourModelLine::GetSpline_i_Point(int i, double *x, double *y, double *z) // virtual { int np = GetSizeLstPoints(); if (np==0) @@ -210,34 +213,8 @@ void manualContourModelLine::GetSpline_i_Point(int i, double *x, double *y, doub *z = mp->GetZ(); } -/* - manualPoint *mp; - double difX,difY; - int np = GetSizeLstPoints( ); - int nps = GetNumberOfPointsSpline(); -// _deltaAngle=(3.14159265*2)/(nps-1); - _deltaAngle = 100/nps; - - if (np==2){ - - if (i==0){ - mp = GetManualPoint(0); - } else { - mp = GetManualPoint(1); - } - - *x = mp->GetX(); - *y = mp->GetY(); - *z = mp->GetZ(); - - }else { - *x=-1; - *y=-1; - *z=-1; - } -*/ } - +*/ // ---------------------------------------------------------------------------- @@ -511,7 +488,7 @@ void manualContourModelBullEyeSector::GetSpline_i_Point(int i, double *x, double *x = _ww*radio*angcos + _cx; *y = _hh*radio*angsin + _cy; - *z= -900; + *z= 900; } //---------------------------------------------------------------- @@ -1637,6 +1614,8 @@ bool manualViewContour::ifTouchContour(int x,int y,int z){ //ED //printf("\n Number of points %d ",nps_t); + printf("EED %p manualViewContour::ifTouchContour >>>> nps_t=%d nps=%d x=%f y=%f z=%f \n", this , nps_t, nps, xx, yy, zz ); + for( i = 0; i < nps_t; i++ ) { _pts->GetPoint(i%nps, ppA); @@ -1645,8 +1624,8 @@ bool manualViewContour::ifTouchContour(int x,int y,int z){ d2= sqrt( (ppB[0]-xx)*(ppB[0]-xx) + (ppB[1]-yy)*(ppB[1]-yy) + (ppB[2]-zz)*(ppB[2]-zz)); d3= sqrt( (ppB[0]-ppA[0])*(ppB[0]-ppA[0]) + (ppB[1]-ppA[1])*(ppB[1]-ppA[1]) + (ppB[2]-ppA[2])*(ppB[2]-ppA[2])); - //ED - //printf("\n Dist1 %f Dist2 %f Dist3 %f PT %d", d1,d2,d3,i); + //EED +printf("%f %f %f - ", ppB[0], ppB[1], ppB[2] ); if ( ((d1+d2)>=d3) && ((d1+d2)<=d3*1.3) ) { @@ -1654,6 +1633,13 @@ bool manualViewContour::ifTouchContour(int x,int y,int z){ i=nps; } } + +if (result==true) +{ + printf("EED %p manualViewContour::ifTouchContour true \n", this ); +} else { + printf("EED %p manualViewContour::ifTouchContour false \n", this ); +} return result; } @@ -4917,7 +4903,7 @@ manualContourBaseControler::manualContourBaseControler() _manViewBaseCont = NULL; _manContModel = NULL; _state = 0; - _z = -900; + _z = 900; _editable = true; _posibleToMove = true; _moving = false; diff --git a/lib/maracasVisuLib/src/interface/wxWindows/manualContour.h b/lib/maracasVisuLib/src/interface/wxWindows/manualContour.h index 4b953a8..f4b62dc 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/manualContour.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/manualContour.h @@ -169,7 +169,7 @@ public: virtual ~manualContourModelLine(); virtual manualContourModelLine *Clone(); void CopyAttributesTo( manualContourModelLine *cloneObject); - virtual void GetSpline_i_Point(int i, double *x, double *y, double *z); +// virtual void GetSpline_i_Point(int i, double *x, double *y, double *z); private: virtual int GetTypeModel(); }; diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMPRWidget.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMPRWidget.cxx index 1a8e933..f25e1f9 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMPRWidget.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMPRWidget.cxx @@ -3,8 +3,8 @@ Program: wxMaracas Module: $RCSfile: wxMPRWidget.cxx,v $ Language: C++ - Date: $Date: 2009/04/01 08:41:35 $ - Version: $Revision: 1.7 $ + Date: $Date: 2009/04/20 07:39:30 $ + Version: $Revision: 1.8 $ Copyright: (c) 2002, 2003 License: @@ -1381,9 +1381,11 @@ void vtkPlane2DView::Configure( ) GetInteractorStyleBaseView()->AddInteractorStyleMaracas( _interactorstyleplane2D ); vtkCamera *camera =_imageViewer2XYZ->GetVtkImageViewer2()->GetRenderer()->GetActiveCamera(); + camera->SetViewUp ( 0 , 1 , 0 ); - camera->SetFocalPoint ((0+_sizeIma)/2 , (0+_sizeIma)/2 , 0 ); camera->SetPosition ((0+_sizeIma)/2 , (0+_sizeIma)/2 , 10000 ); + + camera->SetFocalPoint ((0+_sizeIma)/2 , (0+_sizeIma)/2 , 0 ); camera->SetClippingRange(0.01, 100000); camera->ComputeViewPlaneNormal(); camera->SetParallelScale( _sizeIma/3.0 ); @@ -2043,6 +2045,9 @@ void wxVtkMPR2DView::Configure(){ vtkCamera *camera =_imageViewer2XYZ->GetVtkImageViewer2()->GetRenderer()->GetActiveCamera(); + +//EED 17Avril2009 +/* if (_direction==0) { camera->SetViewUp ( 0 , -1 , 0 ); camera->SetPosition ( -10000,(y1+y2)/2 , (z1+z2)/2 ); @@ -2063,7 +2068,31 @@ void wxVtkMPR2DView::Configure(){ camera->SetFocalPoint ((x1+x2)/2 , (y1+y2)/2 , 0 ); camera->SetParallelScale( (x2-x1)/3.0 ); } - + */ + + if (_direction==0) { + camera->SetViewUp ( 0 , 1 , 0 ); + camera->SetPosition ( 10000,(y1+y2)/2 , (z1+z2)/2 ); + camera->SetFocalPoint ( 0 , (y1+y2)/2 , (z1+z2)/2 ); + camera->SetParallelScale( (z2-z1)/3.0 ); + } + + if (_direction==1) { + camera->SetViewUp ( 0 , 0 , -1 ); + camera->SetPosition ((x1+x2)/2 , 10000 , (z1+z2)/2 ); + camera->SetFocalPoint ((x1+x2)/2 , 0 , (z1+z2)/2 ); + camera->SetParallelScale( (x2-x1)/3.0 ); + } + + if (_direction==2) { + camera->SetViewUp ( 0 , 1 , 0 ); + camera->SetPosition ((x1+x2)/2 , (y1+y2)/2 , 10000); + camera->SetFocalPoint ((x1+x2)/2 , (y1+y2)/2 , 0 ); + camera->SetParallelScale( (x2-x1)/3.0 ); + } + + + } // _imageViewer2XYZ->GetVtkImageViewer2()->SetColorWindow (160); @@ -4685,10 +4714,10 @@ void wxPanelCuttingImageData::OnExtract(wxCommandEvent& event) double contBeforPorc = 100*(double)contBefor/(double)totalSubVolume; double contAfterPorc = 100*(double)contAfter/(double)totalSubVolume; infoToVo.Printf(_T("%dx%dx%d = %d"),dim[0],dim[1],dim[2], dim[0]*dim[1]*dim[2] ); - infoSuVo.Printf(_T("%d") , totalSubVolume); + infoSuVo.Printf(_T("%ld") , totalSubVolume); infoSuVoA.Printf(_T("%.2f"), _actualCuttingModel->GetTheoricVolume() ); - infoPixLe.Printf(_T("%d pix. (%.2f %s) - %.2f mm^3"),contBefor, contBeforPorc ,_T("%"),contBefor*volumeUnit); - infoPixHi.Printf(_T("%d pix. (%.2f %s) - %.2f mm^3"),contAfter, contAfterPorc ,_T("%"),contAfter*volumeUnit); + infoPixLe.Printf(_T("%ld pix. (%.2f %s) - %.2f mm^3"),contBefor, contBeforPorc ,_T("%"),contBefor*volumeUnit); + infoPixHi.Printf(_T("%ld pix. (%.2f %s) - %.2f mm^3"),contAfter, contAfterPorc ,_T("%"),contAfter*volumeUnit); _infoToVo->SetLabel(infoToVo); _infoSuVo->SetLabel(infoSuVo); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkBaseView.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkBaseView.cxx index 64b9e0a..83f6940 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkBaseView.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkBaseView.cxx @@ -1647,9 +1647,18 @@ void wxVtk2DBaseView::Configure(bool okimage) vtkImageViewer2 *IV2=_imageViewer2XYZ->GetVtkImageViewer2(); vtkCamera *camera = IV2->GetRenderer()->GetActiveCamera(); + +//EED 17Avril2009 +/* camera->SetViewUp ( spx*0 , -spy*1 , spz*0 ); camera->SetPosition ( spx*(x1+x2)/2 , spy*(y1+y2)/2 , -spz*10000 ); camera->SetFocalPoint ( spx*(x1+x2)/2 , spy*(y1+y2)/2 , spz*0 ); +*/ + camera->SetViewUp ( spx*0 , spy*1 , spz*0 ); + camera->SetPosition ( spx*(x1+x2)/2 , spy*(y1+y2)/2 , spz*10000 ); + camera->SetFocalPoint ( spx*(x1+x2)/2 , spy*(y1+y2)/2 , spz*0 ); + + camera->SetClippingRange( 0.01 , 1000000 ); camera->ComputeViewPlaneNormal(); camera->SetParallelScale( spx*(x2-x1)/3.0 ); @@ -1826,8 +1835,14 @@ void wxVtk3DBaseView::Configure() // (ResetCamera() method) this vector is used to position the camera // to look at the data in this direction. _aCamera = vtkCamera::New(); +//EED 17Avril2009 +/* _aCamera->SetViewUp (0, 0, -1); _aCamera->SetPosition (0, 1, 0); + */ + _aCamera->SetViewUp (0, 1, 0); + _aCamera->SetPosition (0, 0, 1); + _aCamera->SetFocalPoint (0, 0, 0); _aCamera->ComputeViewPlaneNormal(); } -- 2.47.1