]> Creatis software - creaMaracasVisu.git/commitdiff
- new version
authorEduardo Davila <Eduardo.Davila@creatis.insa-lyon.fr>
Wed, 30 May 2012 17:23:11 +0000 (17:23 +0000)
committerEduardo Davila <Eduardo.Davila@creatis.insa-lyon.fr>
Wed, 30 May 2012 17:23:11 +0000 (17:23 +0000)
- flip

CMakeLists.txt
lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/ColorLayerImageView.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/LayerImageBase.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContourBaseControler.cpp
lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContourModelBullEyeSector.cpp
lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewPoints.cpp
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_N_ViewersWidget.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_ViewerWidget.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR2DView.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DView.cxx

index e1df889b9955a07bf11cf1d8e230d091ce32b3f1..7dd7db24b53977cf15b7c834c99ef5e7d4c58a93 100644 (file)
@@ -15,7 +15,7 @@ PROJECT(creaMaracasVisu)
 
 SET(PROJECT_MAJOR_VERSION 1)
 SET(PROJECT_MINOR_VERSION 0)
-SET(PROJECT_BUILD_VERSION 3)
+SET(PROJECT_BUILD_VERSION 4)
 
 #==================================
 
index de5beed391b4c8ea5370982435271ab1c5ab1be0..56bd443656d49ae3703d84f68e4851be729fbb3d 100644 (file)
@@ -86,8 +86,7 @@ void ColorLayerImageView::ConfigLookupTable()  // virtual
        double delta0=delta*0;
        double delta1=delta*1;
        double delta2=delta*2;
-//     double delta3=delta*3;
-       double delta3=maxTot;
+       double delta3=maxTot;  
 
        for(i = minTot; i <= maxTot; i++)
        {
index 0f3bdf67f2f52f0b66df7e97b3d526f407dfbce0..6f0d5e14b8d1747d126d032830d3f891dc7ec51b 100644 (file)
@@ -174,7 +174,7 @@ void LayerImageBase::onThreshold()
                                _thresholdActor = vtkImageActor::New( );
                                _thresholdActor->SetOpacity( 0.6 );
                                _thresholdActor->InterpolateOn(  );
-                               _thresholdActor->SetPosition( 0,0, 900-1 );
+                               _thresholdActor->SetPosition( 0,0, -900-1 );
                        } // _thresholdActor
                        _baseView->GetRenderer()->AddActor( _thresholdActor );
                        _actorPresent = true;
index 8e8782bd23358a316888f68c9756904456d4aa86..c5c7d5da0b4cc1f458b068f2abe5a781d60a5597 100644 (file)
@@ -10,7 +10,11 @@ manualContourBaseControler::manualContourBaseControler()
        _manViewBaseCont        = NULL;
        _manContModel           = NULL;
        _state                          = 0;
-       _z                                      = 900;
+       
+//EED 21 mars 2012  FLIP probleme  ..PLOP..
+//     _z                                      = 900;
+       _z                                      = -900;
+       
        _editable                       = true;
        _posibleToMove          = true;
        _moving                         = false;
index f9a145ba89bdb54198e8dd6ecfba1e2f6a9b5dfb..5eb1d40fa15d64eaad931cca6e954f83416bb58f 100644 (file)
@@ -108,7 +108,10 @@ void manualContourModelBullEyeSector::GetSpline_i_Point(int i, double *x, double
 
        *x = _ww*radio*angcos + _cx;
        *y = _hh*radio*angsin + _cy;
-       *z= 900;
+       
+//EED 21 mars 2012  FLIP probleme  ..PLOP..    
+//     *z= 900;
+       *z= -900;
 }
 
 //----------------------------------------------------------------
index 45696c3097b78b564e0d3b1d53fc27d3321c067a..380c002a13fc30e0316c69cd592696244ca30378 100644 (file)
@@ -102,7 +102,12 @@ void manualViewPoints::RefreshContour()  // VIRTUAL
        {
                double xx = _manContModel->GetManualPoint(i)->GetX();
                double yy = _manContModel->GetManualPoint(i)->GetY();
-               double zz = 900; // RaC REVISAR !!
+               
+               
+//EED 21 mars 2012  FLIP probleme  ..PLOP..
+//             double zz = 900; // RaC REVISAR !!
+               
+               double zz = -900; // RaC REVISAR !!
 
                manualViewPoint *mv = _copyViewPoints[i];
 
index 38da613ae54c9cb8be9253c2d28e9f24e6f01507..53d7a4b683d98a74407f476ea458cfc0aa263aa3 100644 (file)
@@ -3,8 +3,8 @@
   Program:   wxMaracas
   Module:    $RCSfile: wxMaracas_N_ViewersWidget.cxx,v $
   Language:  C++
-  Date:      $Date: 2010/10/23 12:01:32 $
-  Version:   $Revision: 1.20 $
+  Date:      $Date: 2012/05/30 17:23:12 $
+  Version:   $Revision: 1.21 $
 
   Copyright: (c) 2002, 2003
   License:
                        spliter->SetMinimumPaneSize(1);
                        wxwindow1 = new wxMaracas_ViewerWidget(spliter, imagedata, (*nTypeView)[0], mvtkmprbasedata);
                        wxwindow2 = new wxMaracas_ViewerWidget(spliter, imagedata, (*nTypeView)[1], mvtkmprbasedata);
-                       spliter -> SplitVertically( wxwindow1 , wxwindow2  );
+                       spliter -> SplitHorizontally( wxwindow1 , wxwindow2  );
                        wxwindow = spliter;
                }else if (nTypeView->size()==3)
                {
                        spliterB->SetMinimumPaneSize(1);
 
                        spliter -> SplitVertically( spliterA , spliterB   );
-                       wxwindow1 = new wxMaracas_ViewerWidget(spliterA, imagedata, (*nTypeView)[0], mvtkmprbasedata);
-                       wxwindow2 = new wxMaracas_ViewerWidget(spliterA, imagedata, (*nTypeView)[1], mvtkmprbasedata);
-                       spliterA-> SplitHorizontally( wxwindow1 , wxwindow2  );
-                       wxwindow3 = new wxMaracas_ViewerWidget(spliterB, imagedata, (*nTypeView)[2], mvtkmprbasedata);
-                       wxwindow4 = new wxMaracas_ViewerWidget(spliterB, imagedata, (*nTypeView)[3], mvtkmprbasedata);
-                       spliterB-> SplitHorizontally( wxwindow3 , wxwindow4  );
+                       
+                       
+//EED 21 mars 2012  FLIP probleme  ..PLOP..                    
+//                     wxwindow1 = new wxMaracas_ViewerWidget(spliterA, imagedata, (*nTypeView)[0], mvtkmprbasedata);
+//                     wxwindow2 = new wxMaracas_ViewerWidget(spliterA, imagedata, (*nTypeView)[1], mvtkmprbasedata);
+//                     wxwindow3 = new wxMaracas_ViewerWidget(spliterB, imagedata, (*nTypeView)[2], mvtkmprbasedata);
+//                     wxwindow4 = new wxMaracas_ViewerWidget(spliterB, imagedata, (*nTypeView)[3], mvtkmprbasedata);
+//                     spliterA-> SplitHorizontally( wxwindow1 , wxwindow2  );
+//                     spliterB-> SplitHorizontally( wxwindow3 , wxwindow4  );
+                       
+                       wxwindow1 = new wxMaracas_ViewerWidget(spliterB, imagedata, (*nTypeView)[0], mvtkmprbasedata);
+                       wxwindow2 = new wxMaracas_ViewerWidget(spliterB, imagedata, (*nTypeView)[1], mvtkmprbasedata);
+                       wxwindow3 = new wxMaracas_ViewerWidget(spliterA, imagedata, (*nTypeView)[2], mvtkmprbasedata);
+                       wxwindow4 = new wxMaracas_ViewerWidget(spliterA, imagedata, (*nTypeView)[3], mvtkmprbasedata);
+                       spliterA-> SplitHorizontally( wxwindow3 , wxwindow4  );
+                       spliterB-> SplitHorizontally( wxwindow2 , wxwindow1  );
+                       
                        wxwindow = spliter;
                }
 
index 2cf4527abe77227506dd711ea3a1f96ef8d0f702..62d2fc75cca10a1575da22cc933ffb45f1d7a693 100644 (file)
@@ -3,8 +3,8 @@
   Program:   wxMaracas
   Module:    $RCSfile: wxMaracas_ViewerWidget.cxx,v $
   Language:  C++
-  Date:      $Date: 2011/10/31 16:23:59 $
-  Version:   $Revision: 1.34 $
+  Date:      $Date: 2012/05/30 17:23:12 $
+  Version:   $Revision: 1.35 $
 
   Copyright: (c) 2002, 2003
   License:
                if ( mwidgetMesure       !=NULL ) { mwidgetMesure->SetMesureScale( 1 );         }
                if ( mwxsphereview       !=NULL ) { mwxsphereview->Configure();                 }
 
+               
                if (mwxvtk3Dbaseview_Clipping3D !=NULL)
                {
                        mwxvtk3Dbaseview_Clipping3D->Configure();
                if (mwxvtkmpr3Dview                     !=NULL)
                {
                        mwxvtkmpr3Dview->Configure();
-                       mwxvtkmpr3Dview->ResetCamera(ext,org,spc);
+printf("EED wxMaracas_ViewerWidget::ConfigureVTK \n");                 
+//EED???                       mwxvtkmpr3Dview->ResetCamera(ext,org,spc);
                }
 
                if (mwxvtkclipping3Dview                !=NULL)
                        mwxvtkclipping3Dview->Configure();
                }
 
-
                //if(vtkmpr3Ddataviewer!=NULL){vtkmpr3Ddataviewer->Configure();}
 //             RefreshView();
 
index a109665df029a051d7b844105f8720ff207de229..90f4bf030ed1c2c62eb97a144e18465405899d39 100644 (file)
@@ -199,24 +199,27 @@ void wxVtk2DBaseView::Configure(bool okimage)
                        vtkCamera *camera = IV2->GetRenderer()->GetActiveCamera();
 
 //EED 17Avril2009
-/*
+//EED 21 mars 2012     FLIP problem  ..PLOP..
+                       
+                       // XY
                        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 );
 
                        // text information over the graphic window
                        if(_vtkIinfoTextImage == NULL){
-                               _vtkIinfoTextImage              = new vtkInfoTextImage();
-                               _vtkIinfoTextImageInteractor    = new vtkInfoTextImageInteractor();
+                               _vtkIinfoTextImage                                      = new vtkInfoTextImage();
+                               _vtkIinfoTextImageInteractor            = new vtkInfoTextImageInteractor();
                                ((vtkInteractorStyleBaseView*)this->GetInteractorStyleBaseView())->AddInteractorStyleMaracas(_vtkIinfoTextImageInteractor);
                        }
                        _vtkIinfoTextImage->SetWxVtk2DBaseView(this);
index 13ed4a85d063ee745ce2371d20e012ac48961675..849a6e7889d9586f4eb7e9f04d86b72d74432f35 100644 (file)
@@ -87,7 +87,7 @@ void wxVtkMPR2DView::Configure(){
        if(_lineAActor==NULL){
                _lineAActor = vtkActor::New();
                _lineAActor->GetProperty()->SetDiffuseColor(1,0,0);
-               _lineAActor->GetProperty()->SetLineWidth(2);
+               _lineAActor->GetProperty()->SetLineWidth(0.5);
 
                _ptsA = vtkPoints::New();
                _ptsA->SetNumberOfPoints(2);
@@ -117,7 +117,7 @@ void wxVtkMPR2DView::Configure(){
        if(_lineBActor==NULL){
                _lineBActor                                             =       vtkActor::New();
                _lineBActor->GetProperty()->SetDiffuseColor(1,0,0);
-               _lineBActor->GetProperty()->SetLineWidth(2);
+               _lineBActor->GetProperty()->SetLineWidth(0.5);
                _lineBMapper                                    =       vtkPolyDataMapper::New();
                _lineBActor->SetMapper(_lineBMapper);
 
@@ -150,29 +150,30 @@ 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     );
+    //EED 21 mars 2012  FLIP problem  ..PLOP..
+
+               if (_direction==0) {  // YZ
+                       camera->SetViewUp               (   0   ,    0          ,     1         );
+                       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     );
+               if (_direction==1) { // XZ
+                       camera->SetViewUp               (       0               ,       0       ,                     );
+                       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) {
+               if (_direction==2) {  // XY
                        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 );
                }
-       */
 
+/*
                if (_direction==0) {    // YZ
                        camera->SetViewUp               (   0   ,     1         ,     0         );
                        camera->SetPosition             (  10000,(y1+y2)/2      , (z1+z2)/2     );
@@ -193,7 +194,7 @@ void wxVtkMPR2DView::Configure(){
                        camera->SetFocalPoint   ((x1+x2)/2      , (y1+y2)/2     ,       0       );
                        camera->SetParallelScale( (x2-x1)/3.0 );
                }
-
+*/
 
        //      _imageViewer2XYZ->GetVtkImageViewer2()->SetColorWindow (160);
        //      _imageViewer2XYZ->GetVtkImageViewer2()->SetColorLevel (800);
@@ -237,7 +238,9 @@ void wxVtkMPR2DView::Refresh()
        int xx = 0, yy = 0, zz = 0;
        double *spc     = 0;
        double *origin  = 0;
-
+       
+       double xx1,yy1,zz1,xx2,yy2,zz2;
+       
 
        //GetVtkmprbasedata()->GetDimensionExtention(&x1,&x2,&y1,&y2,&z1,&z2);
 
@@ -253,13 +256,22 @@ void wxVtkMPR2DView::Refresh()
                y2 += origin[1];
                z1 += origin[2];
                z2 += origin[2];
+               
+               xx1 =           x1*spc[0];
+               yy1 =           y1*spc[1];
+               zz1 =           z1*spc[2];
+               
+               xx2 =           x2*spc[0];
+               yy2 =           y2*spc[1];
+               zz2 =           z2*spc[2];
+               
                x1 = (int)(x1*spc[0]);
                y1 = (int)(y1*spc[1]);
                z1 = (int)(z1*spc[2]);
-
-               x2 = (int)(x2*spc[0]);
-               y2 = (int)(y2*spc[1]);
-               z2 = (int)(z2*spc[2]);
+               
+               x2      = (int)(x2*spc[0]);
+               y2      = (int)(y2*spc[1]);
+               z2      = (int)(z2*spc[2]);
 
                xx = (int)(GetVtkmprbasedata()->GetX());
                yy = (int)(GetVtkmprbasedata()->GetY());
@@ -268,37 +280,62 @@ void wxVtkMPR2DView::Refresh()
                x =  round(xx*spc[0]);
                y =  round(yy*spc[1]);
                z =  round(zz*spc[2]);
-
+               
                if ((xx!=_backX) || (yy!=_backY) || (zz!=_backZ)) {
 
                        if (_direction==0) {    // YZ
                                if(_imageViewer2XYZ)
+                               {
                                        _imageViewer2XYZ->SetXSlice( (int)(GetVtkmprbasedata()->GetX()) );
-                               _ptsA->SetPoint(0, x2, y1  , z );
-                               _ptsA->SetPoint(1, x2, y2  , z );
-                               _ptsB->SetPoint(0, x2, y   , z1);
-                               _ptsB->SetPoint(1, x2, y   , z2);
+                               }
+//EED 21 mars 2012  FLIP probleme  ..PLOP..
+                               //_ptsA->SetPoint(0, x2, y1  , z );
+                               //_ptsA->SetPoint(1, x2, y2  , z );
+                               //_ptsB->SetPoint(0, x2, y   , z1);
+                               //_ptsB->SetPoint(1, x2, y   , z2);
+                               _ptsA->SetPoint(0, xx2, yy1  , z  );
+                               _ptsA->SetPoint(1, xx2, yy2  , z  );
+                               _ptsB->SetPoint(0, xx2, y    , zz1);
+                               _ptsB->SetPoint(1, xx2, y    , zz2);
                        }
                        if (_direction==1) {    // XZ
                                if(_imageViewer2XYZ)
+                               {
                                        _imageViewer2XYZ->SetYSlice( (int)(GetVtkmprbasedata()->GetY()) );
-                           _ptsA->SetPoint(0, x1 , y2 , z );
-                               _ptsA->SetPoint(1, x2 , y2 , z );
-                               _ptsB->SetPoint(0, x  , y2 , z1);
-                               _ptsB->SetPoint(1, x  , y2 , z2);
+                               }
+//EED 21 mars 2012  FLIP probleme  ..PLOP..
+                           //_ptsA->SetPoint(0, x1 , y2 , z );
+                               //_ptsA->SetPoint(1, x2 , y2 , z );
+                               //_ptsB->SetPoint(0, x  , y2 , z1);
+                               //_ptsB->SetPoint(1, x  , y2 , z2);
+                           _ptsA->SetPoint(0, xx1 , y1 , z  );
+                               _ptsA->SetPoint(1, xx2 , y1 , z  );
+                               _ptsB->SetPoint(0, x   , y1 , zz1);
+                               _ptsB->SetPoint(1, x   , y1 , zz2);
                        }
                        if (_direction==2) {    // XY
                                if(_imageViewer2XYZ)
+                               {
                                        _imageViewer2XYZ->SetZSlice( (int)(GetVtkmprbasedata()->GetZ()) );
+                               }
                        //      _ptsA->SetPoint(0, x1 , y , -z2 );
                        //      _ptsA->SetPoint(1, x2 , y , -z2 );
                        //      _ptsB->SetPoint(0, x  , y1, -z2 );
                        //      _ptsB->SetPoint(1, x  , y2, -z2 );
 
-                               _ptsA->SetPoint(0, x1 , y , z2 );
-                               _ptsA->SetPoint(1, x2 , y , z2 );
-                               _ptsB->SetPoint(0, x  , y1, z2 );
-                               _ptsB->SetPoint(1, x  , y2, z2 );
+                               
+//EED 21 mars 2012  FLIP probleme  ..PLOP..
+                               //_ptsA->SetPoint(0, x1 , y , z2 );
+                               //_ptsA->SetPoint(1, x2 , y , z2 );
+                               //_ptsB->SetPoint(0, x  , y1, z2 );
+                               //_ptsB->SetPoint(1, x  , y2, z2 );
+                               
+                               _ptsA->SetPoint(0, xx1 , y  , z1 );
+                               _ptsA->SetPoint(1, xx2 , y  , z1 );
+                               _ptsB->SetPoint(0, x   , yy1, z1 );
+                               _ptsB->SetPoint(1, x   , yy2, z1 );
+                               
+                               
                        }
                        _backX=xx;
                        _backY=yy;
index 179f325554b6a69f48437ffc82c9d2d9ce06eaff..a05e83116d1ba54587ac7b1f06b107b029e70b34 100644 (file)
@@ -74,8 +74,15 @@ void wxVtkMPR3DView::ResetCamera(int* ext, double* origin,double* spc)
 {
        if(ext == NULL){
                _wxvtk3Dbaseview->GetRenderer()->ResetCamera ();
-               _wxvtk3Dbaseview->GetCamera()->Dolly(1.5);
+               _wxvtk3Dbaseview->GetCamera()->Dolly(2.0);
+               
+//EED 21 mars 2012  FLIP probleme  ..PLOP..
+               _wxvtk3Dbaseview->GetCamera()->Roll(180);
+               _wxvtk3Dbaseview->GetCamera()->Yaw(180+30);
+               _wxvtk3Dbaseview->GetCamera()->Pitch(-22);
+               
        }else{
+               
                /*double x = (spc[0])*(origin[0]+(((double)ext[1]-(double)ext[0])/2.0));
                double y = (spc[1])*(origin[1]+(double)ext[3]);
                double z = (spc[2])*(origin[2]+(((double)ext[5]-(double)ext[4])/2.0));*/
@@ -85,6 +92,7 @@ void wxVtkMPR3DView::ResetCamera(int* ext, double* origin,double* spc)
                double y1=(spc[1])*((double)ext[3]+origin[1]);
                double z0=(spc[2])*((double)ext[4]+origin[2]);
                double z1=(spc[2])*((double)ext[5]+origin[2]);*/
+               
                double x0=(spc[0])*((double)ext[0]);
                double x1=(spc[0])*((double)ext[1]);
                double y0=(spc[1])*((double)ext[2]);
@@ -95,7 +103,9 @@ void wxVtkMPR3DView::ResetCamera(int* ext, double* origin,double* spc)
                _wxvtk3Dbaseview->GetRenderer()->ResetCamera(x0,x1,y0,y1,z0,z1);
                //_wxvtk3Dbaseview->GetCamera()->SetPosition(x,y,z);
                _wxvtk3Dbaseview->GetCamera()->Dolly(1.5);
+               
        }
+       
 }
 
 //-------------------------------------------------------------------
@@ -103,6 +113,7 @@ void wxVtkMPR3DView::Configure()
 {
        vtkImageData *imageData = GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->GetImageData();
 
+       printf("EED wxMaracas_ViewerWidget::ConfigureVTK \n");                  
        _wxvtk3Dbaseview->Configure();
        _wxvtkmpr3DviewCntrlPanel->UpdateControlPanel();
 
@@ -207,7 +218,7 @@ void wxVtkMPR3DView::Configure()
                _contourMapper->SetScalarRange( imageData->GetScalarRange() );
 
 
-               ConfigureFreePlanes();
+       ConfigureFreePlanes();
        }
 
 //     _pointWidget->SetPosition( x,y,z );