#include "bbtkWxBlackBox.h"
#include "wxVtkBaseView.h"
+ #include <vtkScalarsToColors.h>
+#include <vtkScalarsToColors.h>
+
+
namespace bbcreaMaracasVisu
{
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..
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)
{
} // 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
#include "wxMPRBaseData.h"
#include "wxVtk2DBaseView.h"
-#include "wxVTKRenderWindowInteractor.h"
+#include "creawxVTKRenderWindowInteractor.h"
#include "vtkTextProperty.h"
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
+
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
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 );
}
//----------------------------------------------------------------------------
vtkLookupTable* LayerImageBase::GetThresholdTable()
{
+printf("EED LayerImageBase::GetThresholdTable\n");
return _thresholdTable;
}
} // !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
}
wxVtkBaseView * baseView = _baseView;
baseView->GetRenderer()->RemoveActor( _thresholdActor );
baseView->GetRenderer()->RemoveActor( _scalarbarActor );
-
_actorPresent = false;
- }
-}
-
-//----------------------------------------------------------------------------
-vtkLookupTable *LayerImageBase::GetvtkLookupTable()
-{
- return _thresholdTable;
+ } // if _actorPresent
}
//----------------------------------------------------------------------------
_range[1]=max;
}
-
-
-
+ vtkScalarsToColors* LayerImageBase::GetLookupTable()
+ {
+ return _thresholdTable;
+ }
+
// EOF
#include "InteractorStyleMaracas.h"
#include "vtkImageChangeInformation.h"
-
//----------------------------------------------------------------------------------
//----------------------------------------------------------------------------------
//----------------------------------------------------------------------------------
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;