X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FmaracasVisuLib%2Fsrc%2Fkernel%2FmarDynData.cpp;h=663036071f571def1353848c349f826b96543d04;hb=d6fb1d5d3e478c70b90f5a4e27874e1478905195;hp=8ef4b5f483a69ea248de28a2f66024f7303f18c3;hpb=e4ef2b5df5aac431ff3b806f83b7dd5e55e89d86;p=creaMaracasVisu.git diff --git a/lib/maracasVisuLib/src/kernel/marDynData.cpp b/lib/maracasVisuLib/src/kernel/marDynData.cpp index 8ef4b5f..6630360 100644 --- a/lib/maracasVisuLib/src/kernel/marDynData.cpp +++ b/lib/maracasVisuLib/src/kernel/marDynData.cpp @@ -69,7 +69,12 @@ void marDynData::loadData( kVolume* vol, int* voi ) reset( ); vtkExtractVOI *crop = vtkExtractVOI::New(); +//EED 2017-01-01 Migration VTK7 +#if VTK_MAJOR_VERSION <= 5 crop->SetInput( vol->castVtk( ) ); +#else + crop->SetInputData( vol->castVtk( ) ); +#endif crop->SetVOI( voi ); //crop->SetSampleRate( getParameters( )->getVoxelSize( ), getParameters( )->getVoxelSize( ), getParameters( )->getVoxelSize( )); @@ -82,13 +87,23 @@ void marDynData::loadData( kVolume* vol, int* voi ) // RescalaIntercept = 0; vtkImageShiftScale *scale = vtkImageShiftScale::New(); +//EED 2017-01-01 Migration VTK7 +#if VTK_MAJOR_VERSION <= 5 scale->SetInput( crop->GetOutput( ) ); +#else + scale->SetInputData( crop->GetOutput( ) ); +#endif scale->SetScale(RescalaSlope); scale->SetShift(0); scale->SetOutputScalarTypeToShort(); scale->Update(); vtkImageShiftScale *shift = vtkImageShiftScale::New(); +//EED 2017-01-01 Migration VTK7 +#if VTK_MAJOR_VERSION <= 5 shift->SetInput( scale->GetOutput( ) ); +#else + shift->SetInputData( scale->GetOutput( ) ); +#endif shift->SetScale(1); shift->SetShift(RescalaIntercept); shift->SetOutputScalarTypeToShort(); @@ -96,7 +111,12 @@ void marDynData::loadData( kVolume* vol, int* voi ) vtkImageThreshold *threshold = vtkImageThreshold::New(); +//EED 2017-01-01 Migration VTK7 +#if VTK_MAJOR_VERSION <= 5 threshold->SetInput( shift->GetOutput( ) ); +#else + threshold->SetInputData( shift->GetOutput( ) ); +#endif threshold->ThresholdByUpper (-10000); threshold->ThresholdByLower (-1); threshold->SetInValue(0); @@ -105,7 +125,12 @@ void marDynData::loadData( kVolume* vol, int* voi ) threshold->SetOutputScalarTypeToUnsignedShort(); vtkImageResample* ir = vtkImageResample::New( ); +//EED 2017-01-01 Migration VTK7 +#if VTK_MAJOR_VERSION <= 5 ir->SetInput( threshold->GetOutput( ) ); +#else + ir->SetInputData( threshold->GetOutput( ) ); +#endif ir->SetDimensionality( 3 ); double voxelSize= getParameters( )->getVoxelSize( ); ir->SetAxisOutputSpacing( 0, voxelSize ); @@ -127,7 +152,13 @@ void marDynData::loadData( kVolume* vol, int* voi ) * Before we were using kgfoCrop which assume extent start at 0,0,0 */ vtkImageChangeInformation* change = vtkImageChangeInformation::New(); +//EED 2017-01-01 Migration VTK7 +#if VTK_MAJOR_VERSION <= 5 change->SetInput( ir->GetOutput() ); +#else + change->SetInputData( ir->GetOutput() ); +#endif + change->SetExtentTranslation( -ext[0], -ext[2], -ext[4] ); change->SetOutputSpacing ( voxelSize , voxelSize , voxelSize ); change->Update(); //important