]> Creatis software - creaMaracasVisu.git/commitdiff
#3263 creaMaracasVisu Feature New Normal - ViewerNV sync ParallelScale Camera
authorEduardo DAVILA <davila@ei-ed-606.creatis.insa-lyon.fr>
Thu, 6 Jun 2019 09:42:34 +0000 (11:42 +0200)
committerEduardo DAVILA <davila@ei-ed-606.creatis.insa-lyon.fr>
Thu, 6 Jun 2019 09:42:34 +0000 (11:42 +0200)
1  2 
bbtk/src/bbcreaMaracasVisuColorLayerImageView.cxx
bbtk/src/bbcreaMaracasVisuColorLayerImageView.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/ColorLayerImageViewManager.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/LayerImageBase.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/LayerImageBase.h

index 1d85ad87684167d3ace2e6ed7d1748fdd0b81827,0fc2242b4f08dce552bb5ecdcb128a5af1cb911f..46f8d7076f46bd6b20d3b10160081b595a14ac0a
@@@ -75,9 -75,7 +75,10 @@@ void ColorLayerImageView::Process(
  
      bbSetOutputNewImage( clivp->GetColorLayerImageViewManager()->GetImageChangeInformation(0) );
      bbSetOutputLookupTable( clivp->GetColorLayerImageViewManager()->GetLookupTable(0) );
 +printf("EED ColorLayerImageView::Process A ptrLookupTable:%p\n",clivp->GetColorLayerImageViewManager()->GetLookupTable(0));
 +printf("EED ColorLayerImageView::Process B ptrLookupTable:%p\n",bbGetOutputLookupTable() );
 +
         if (firsttime==true)
         {
                firsttime=false;
index 934b0fe66745ff9982858fc61347fc6746ed6aa2,9b8cdc43fe22d2661060d8aaa526804993c078d9..73656fc52dcf1ab2597536e0e181e5f169d6e1c3
  #include "bbtkWxBlackBox.h"
  
  #include "wxVtkBaseView.h"
+ #include <vtkScalarsToColors.h>
  
 +#include <vtkScalarsToColors.h>
 +
 +
  namespace bbcreaMaracasVisu
  {
  
@@@ -102,8 -100,9 +103,8 @@@ BBTK_BEGIN_DESCRIBE_BLACK_BOX(ColorLaye
    BBTK_INPUT(ColorLayerImageView,ColorBarPosition,"default (10,105)",std::vector<int>,"");
  
    BBTK_OUTPUT(ColorLayerImageView,NewImage,"Image with correct Spacing",vtkImageData*,"");
-   BBTK_OUTPUT(ColorLayerImageView,LookupTable,"Image with correct Spacing",vtkScalarsToColors*,"");
+   BBTK_OUTPUT(ColorLayerImageView,LookupTable,"LookupTable",vtkScalarsToColors*,"");
  
 -
  BBTK_END_DESCRIBE_BLACK_BOX(ColorLayerImageView);
  //=====
  // Don't edit this file. This file is generated from xml description..
index 774d66383e84f740de12ced2a54fcb472bc3c47b,9f5de8ad3c63ee107d81ba23cb9a432b48b64706..1ba779ef890db57b2a421fa1e0e44174dae30cc6
@@@ -408,19 -408,6 +408,19 @@@ vtkImageData* ColorLayerImageViewManage
        return NULL;
  }
  
 +//----------------------------------------------------------------------------
 +vtkLookupTable*       ColorLayerImageViewManager::GetLookupTable(int id)
 +{
 +printf("EED ColorLayerImageViewManager::GetLookupTable 0 \n");
 +      if (_colorLayerImageViewLst[id]!=NULL)
 +      {
 +printf("EED ColorLayerImageViewManager::GetLookupTable 1 \n");
 +         return _colorLayerImageViewLst[id]->GetThresholdTable( );
 +      } // if 
 +printf("EED ColorLayerImageViewManager::GetLookupTable 2 \n");
 +      return NULL;
 +}
 +
  //----------------------------------------------------------------------------
  void ColorLayerImageViewManager::GetDimensionBase(int id,int *dim)
  {
@@@ -457,7 -444,6 +457,6 @@@ void ColorLayerImageViewManager::GetSpc
        } // if 
  }
  
- //----------------------------------------------------------------------------
  //----------------------------------------------------------------------------
  void ColorLayerImageViewManager::SetNewSpacingLayer(double *spc)
  {
    } // for 
  }
  
 -//----------------------------------------------------------------------------
 -vtkScalarsToColors* ColorLayerImageViewManager::GetLookupTable(int id)
 -{
 -      vtkScalarsToColors* lookuptable;
 -      if (_colorLayerImageViewLst[id]!=NULL)
 -      {
 -         lookuptable = _colorLayerImageViewLst[id]->GetLookupTable( );
 -      } // if 
 -      return lookuptable;
 -}
  
  // EOF
  
index 1a494c76043f5225386ac034b07dfa23aa9df8e3,5fd366cd9ce03bc4f4bf3c44684e1707702fd12b..f63a57ae9f68f0aef62277d9b1eed7a3e9957e0d
@@@ -32,7 -32,7 +32,7 @@@
  
  #include "wxMPRBaseData.h"
  #include "wxVtk2DBaseView.h"
 -#include "wxVTKRenderWindowInteractor.h"
 +#include "creawxVTKRenderWindowInteractor.h"
  #include "vtkTextProperty.h"
  
  
@@@ -192,15 -192,8 +192,15 @@@ void LayerImageBase::SetImage(vtkImageD
        spcBase[5]=0;
  
        _image = image;
 +
 +//EED 2017-01-01 Migration VTK7
 +#if VTK_MAJOR_VERSION <= 5
        _image->Update();
        _image->GetWholeExtent(ext);
 +#else
 +      _image->GetExtent(ext);
 +#endif
 +
        dimensionOriginalLayer[0] = ext[1]-ext[0]+1;
        dimensionOriginalLayer[1] = ext[3]-ext[2]+1;
        dimensionOriginalLayer[2] = ext[5]-ext[4]+1;
                vtkImageData    *imagebase              =       GetwxVtkBaseView()->GetVtkBaseData()->GetImageData();
                if (imagebase!=NULL) 
                {       
 +
 +//EED 2017-01-01 Migration VTK7
 +#if VTK_MAJOR_VERSION <= 5
                        imagebase->GetWholeExtent(ext);
 +#else
 +                      imagebase->GetExtent(ext);
 +#endif
 +
                        dimBase[0]=ext[1]-ext[0]+1;                             
                        dimBase[1]=ext[3]-ext[2]+1;                             
                        dimBase[2]=ext[5]-ext[4]+1;                             
                } // if imagebase
        } // if wxvtkbaseview
        _image->GetScalarRange( _range );
 -      _thresholdTable = vtkLookupTable::New();
 +//    _thresholdTable = vtkLookupTable::New();
  
 +
 +//EED 2017-01-01 Migration VTK7
 +#if VTK_MAJOR_VERSION <= 5
        _imageChangeInformation->SetInput(_image);
 +#else
 +      _imageChangeInformation->SetInputData(_image);
 +      _imageChangeInformation->Update();
 +#endif
 +
  }
  
  //------------------------------------------------------------------------------
@@@ -260,9 -238,9 +260,9 @@@ void LayerImageBase::SetSpcOriginalLaye
  //------------------------------------------------------------------------------
  void LayerImageBase::SetNewSpacingLayer(double spc[3])
  {
 -      _newSpcLayer[0]=spc[0];
 -      _newSpcLayer[1]=spc[1];
 -      _newSpcLayer[2]=spc[2];
 +      _newSpcLayer[0] = spc[0];
 +      _newSpcLayer[1] = spc[1];
 +      _newSpcLayer[2] = spc[2];
        _imageChangeInformation->SetOutputSpacing( _newSpcLayer );  
  
  }
@@@ -386,7 -364,6 +386,7 @@@ void LayerImageBase::Refresh(
  //----------------------------------------------------------------------------
  vtkLookupTable* LayerImageBase::GetThresholdTable()
  {
 +printf("EED LayerImageBase::GetThresholdTable\n");
        return _thresholdTable;
  }
  
@@@ -498,14 -475,7 +498,14 @@@ void LayerImageBase::onThreshold(
                }  // !GetActorPresent()
  
                ConfigLookupTable();  // virtual method
 +
 +//EED 2017-01-01 Migration VTK7
 +#if VTK_MAJOR_VERSION <= 5
                _imageReslicer->SetInput( GetImage() );
 +#else
 +              _imageReslicer->SetInputData( GetImage() );
 +#endif
 +
                _imageReslicer->SetInformationInput( GetImage() );
  
                if (directionViewer==0)
                _imageReslicer->SetInterpolationModeToNearestNeighbor();
                _imageReslicer->Modified();
  
 -
 +//EED 2017-01-01 Migration VTK7
 +#if VTK_MAJOR_VERSION <= 5
 +              // ..
 +#else
 +              _imageReslicer->Update();
 +#endif
                vtkImageData *img = _imageReslicer->GetOutput();
  //            img->Update();
  //            img->UpdateInformation();
 -
  //            _thresholdTable->Update();
 +
 +//EED 2017-01-01 Migration VTK7
 +#if VTK_MAJOR_VERSION <= 5
                _thresholdMapper->SetInput( img );
 +#else
 +              _thresholdMapper->SetInputData( img );
 +#endif
 +
                _thresholdMapper->SetLookupTable( _thresholdTable );
 +
 +
 +//EED 2017-01-01 Migration VTK7
 +#if VTK_MAJOR_VERSION <= 5
                _thresholdActor->SetInput( _thresholdMapper->GetOutput() );
 +#else
 +              _thresholdMapper->Update();
 +              _thresholdActor->SetInputData( _thresholdMapper->GetOutput() );
 +#endif
 +              
                _thresholdActor->SetOpacity(_opacity);
 -
                _scalarbarActor->SetLookupTable( _thresholdTable );
  //            _scalarbarActor->SetLookupTable( _thresholdMapper->GetLookupTable() );
                _scalarbarActor->SetTitle("Value");
                _scalarbarActor->SetNumberOfLabels(4);
                int fontsize = _scalarbarActor->GetLabelTextProperty()->GetFontSize();
                _scalarbarActor->GetLabelTextProperty()->SetFontSize(fontsize/2);
 -
  //            _scalarbarActor->SetTextPad(4);  ??
 -
 -
                } // _image
  }
  
@@@ -617,8 -571,15 +617,8 @@@ void LayerImageBase::onThresholdRemove(
                wxVtkBaseView * baseView = _baseView;
                baseView->GetRenderer()->RemoveActor( _thresholdActor );
                baseView->GetRenderer()->RemoveActor( _scalarbarActor );
 -
                _actorPresent = false;
 -      }
 -}
 -
 -//----------------------------------------------------------------------------
 -vtkLookupTable *LayerImageBase::GetvtkLookupTable()
 -{
 -    return _thresholdTable;
 +      }  // if _actorPresent
  }
  
  //----------------------------------------------------------------------------
@@@ -637,5 -598,13 +637,10 @@@ void LayerImageBase::GetImageScalarRang
        _range[1]=max;
  }
  
 -
 -
 -
+ vtkScalarsToColors* LayerImageBase::GetLookupTable()
+ {
+       return _thresholdTable;
+ }
  // EOF
  
index 52235c38fa18e764911bd0e43c870386f7da51e5,ac329685949d6210ac67b99ae89a2ccfb0cea900..f5abbb6b61cc6add81fd915486288db483203e15
@@@ -47,6 -47,7 +47,6 @@@
  #include "InteractorStyleMaracas.h"
  #include "vtkImageChangeInformation.h"
  
 -
  //----------------------------------------------------------------------------------
  //----------------------------------------------------------------------------------
  //----------------------------------------------------------------------------------
@@@ -101,8 -102,7 +101,8 @@@ class LayerImageBas
                void onThresholdRemove();
                wxVtkBaseView *GetwxVtkBaseView();
                void Refresh();
 -              vtkLookupTable *GetvtkLookupTable();
 +              vtkLookupTable *GetThresholdTable();
 +
                vtkImageReslice *GetvtkImageReslice();
                virtual int GetX();
                virtual int GetY();
                void GetDimensionBase(int *dim);
                void GetSpcOriginalLayer(double *spc);
                void GetSpcBase(double *spc);
+               vtkScalarsToColors* GetLookupTable();
  
    private:
                int                                                     _X;
                void                                            CleanXYZ(double &x, double &y, double &z);
  
    protected:
 -              vtkLookupTable                          *GetThresholdTable();
                double                                          _range[2];
                std::vector<double>             _rangeForColorBar;
                std::vector<int>                        _colorBarPosition;