]> Creatis software - creaContours.git/commitdiff
#3112 creaContours Bug New Normal - branch vtk7itk4 compilation with vtk7
authorEduardo DAVILA <davila@localhost.localdomain>
Fri, 4 Aug 2017 14:58:22 +0000 (16:58 +0200)
committerEduardo DAVILA <davila@localhost.localdomain>
Fri, 4 Aug 2017 14:58:22 +0000 (16:58 +0200)
lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.cxx
lib/kernel_ManagerContour_NDimensions/KernelManagerContour.cxx
lib/kernel_ManagerContour_NDimensions/itkVTKImageToImageFilter.txx

index 3d4413be34a071a8f99afdf762f7b8e8ee747966..39e3ac1468b3d241f5850fec1bba29cdcdcdab96 100644 (file)
@@ -1682,33 +1682,63 @@ printf("EED wxContourMainFrame::SegmentationOneSliceITK  Skypping this code.  No
 
        vtkMarchingContourFilter* cntVTK = vtkMarchingContourFilter::New( );
 
-       cntVTK->SetInput( idata );
-
        cntVTK->SetNumberOfContours( 1 );
        cntVTK->SetValue( 0, 255 );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+       cntVTK->SetInput( idata );
        cntVTK->Update( );
        cntVTK->UpdateInformation();
+#else
+       cntVTK->SetInputData( idata );
+#endif
 
        vtkCleanPolyData* cpd = vtkCleanPolyData::New( );
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        cpd->SetInput( cntVTK->GetOutput( ) );
        cpd->Update( );
        cpd->UpdateInformation();
+#else
+       cpd->SetInputData( cntVTK->GetOutput( ) );
+#endif
+
 
        vtkPolyDataConnectivityFilter* conn = vtkPolyDataConnectivityFilter::New( );
        conn->SetExtractionModeToLargestRegion( );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        conn->SetInput( cpd->GetOutput( ) );
        conn->Update( );
        conn->UpdateInformation();
+#else
+       conn->SetInputData( cpd->GetOutput( ) );
+#endif
+
 
        vtkStripper* vtkstripper = vtkStripper::New( );
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        vtkstripper->SetInput( conn->GetOutput() );
        vtkstripper->Update();
        vtkstripper->UpdateInformation();
+#else
+       vtkstripper->SetInputData( conn->GetOutput() );
+       cntVTK->Update();
+#endif
 
        vtkPolyData* polyDataResult =  cntVTK->GetOutput();
        //std::cout<<"Points "<<polyDataResult->GetNumberOfPoints()<<std::endl;
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        polyDataResult->Update( );
        polyDataResult->UpdateInformation();
+#else
+       // ..
+#endif
 
        //EED
                /*
@@ -1969,19 +1999,41 @@ void wxContourMainFrame::SegmentationOneSlice( int x, int y, int z, int isovalue
 //             y = y*spc[1];
 //             z = z*spc[3];
 
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        imageReslice->SetInput( imagedata );
+#else
+       imageReslice->SetInputData( imagedata );
+#endif
        imageReslice->SetInformationInput(imagedata);
        imageReslice->SetResliceAxesDirectionCosines(1,0,0, 0,1,0 ,0,0,1);
        imageReslice->SetResliceAxesOrigin(0,0,z);
        imageReslice->SetOutputDimensionality(2);
        imageReslice->SetInterpolationModeToLinear();
 
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+       // ..
+#else
+       imageReslice->Update();
+#endif
+
        imagedata = imageReslice->GetOutput();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        imagedata->Update();
        imagedata->UpdateInformation();
+#else
+       // ..
+#endif
 
        vtkContourFilter* cntVTK = vtkContourFilter::New( );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        cntVTK->SetInput( imagedata );
+#else
+       cntVTK->SetInputData( imagedata );
+#endif
 
        cntVTK->SetNumberOfContours( 1 );
        //cntVTK->SetValue( 0, vmin );
@@ -1992,7 +2044,12 @@ void wxContourMainFrame::SegmentationOneSlice( int x, int y, int z, int isovalue
        cntVTK->UpdateInformation();
 
        vtkCleanPolyData* cpd = vtkCleanPolyData::New( );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        cpd->SetInput( cntVTK->GetOutput( ) );
+#else
+       cpd->SetInputData( cntVTK->GetOutput( ) );
+#endif
        cpd->ConvertLinesToPointsOff( );
        cpd->Update( );
        cpd->UpdateInformation();
@@ -2001,27 +2058,47 @@ void wxContourMainFrame::SegmentationOneSlice( int x, int y, int z, int isovalue
        conn->SetExtractionModeToClosestPointRegion( );
        //conn->SetMaxRecursionDepth( 3000 );
 
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        conn->SetInput( cpd->GetOutput( ) );
+#else
+       conn->SetInputData( cpd->GetOutput( ) );
+#endif
 
        conn->SetClosestPoint( x, y, 0 );
        conn->Update( );
        conn->UpdateInformation();
 
        vtkCleanPolyData* cpd2 = vtkCleanPolyData::New( );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        cpd2->SetInput( conn->GetOutput( ) );
+#else
+       cpd2->SetInputData( conn->GetOutput( ) );
+#endif
        cpd2->Update();
        cpd2->UpdateInformation();
 
        vtkStripper* vtkstripper = vtkStripper::New( );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        vtkstripper->SetInput( cpd2->GetOutput() );
+#else
+       vtkstripper->SetInputData( cpd2->GetOutput() );
+#endif
        vtkstripper->Update();
        vtkstripper->UpdateInformation();
 
 
        vtkPolyData* polyDataResult =  vtkstripper->GetOutput();
 
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        polyDataResult->Update( );
        polyDataResult->UpdateInformation();
+#else
+       //...
+#endif
 
 /* EED
 ofstream myfile;
@@ -3065,10 +3142,21 @@ void wxContourMainFrame::SaveImageResult(std::string directory,std::string namef
 // Image Value
        
        vtkImageChangeInformation *valueChInfo = vtkImageChangeInformation::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        valueChInfo->SetInput(value);
+#else
+       valueChInfo->SetInputData(value);
+#endif
        valueChInfo->SetSpacingScale(spc);      
        vtkMetaImageWriter *writerValueImage = vtkMetaImageWriter::New( );
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        writerValueImage->SetInput( valueChInfo->GetOutput() );
+#else
+       writerValueImage->SetInputData( valueChInfo->GetOutput() );
+#endif
        writerValueImage->SetFileName( (const char *)filename.mb_str() );
        writerValueImage->SetFileDimensionality( 3 );
        writerValueImage->SetCompression(false);
@@ -3083,10 +3171,22 @@ void wxContourMainFrame::SaveImageResult(std::string directory,std::string namef
 
 
        vtkImageChangeInformation *maskChInfo = vtkImageChangeInformation::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        maskChInfo->SetInput(mask);
+#else
+       maskChInfo->SetInputData(mask);
+#endif
        maskChInfo->SetSpacingScale(spc);       
        vtkMetaImageWriter *writerMaskImage = vtkMetaImageWriter::New( );
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        writerMaskImage->SetInput( maskChInfo->GetOutput() );
+#else
+       writerMaskImage->SetInputData( maskChInfo->GetOutput() );
+#endif
+
        writerMaskImage->SetFileName( (const char *)filename.mb_str() );
        writerMaskImage->SetFileDimensionality( 3 );
        writerMaskImage->SetCompression(false);
index 3f4a144a4ba9afb48eead9f98a17b6835b497922..633d43859b37f1dc24b26e9bd276723efb62deb1 100644 (file)
@@ -112,8 +112,16 @@ void KernelManagerContour::setVectImages(std::vector<vtkImageData*> vectimg)
        for(int i = 0; i < (int)(vectimg.size()); i++){
                vtkImageData* img = vectimg[i];
                vtkImageChangeInformation* change = vtkImageChangeInformation::New();
+
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
                change->SetInformationInput(img);
                change->SetInputConnection(img->GetProducerPort());
+#else
+               change->SetInputData(img);
+#endif
+
                img->GetSpacing(spc);
                change->SetOutputSpacing(1,1,1);
 
index 585878bdc844b39e63b6ec8441360947f5b674e1..edfb3f402bd9c796ee75b7c4fde32dacddbf5efa 100644 (file)
@@ -103,7 +103,12 @@ void
 VTKImageToImageFilter<TOutputImage>
 ::SetInput( vtkImageData * inputImage )
 {
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
   m_Exporter->SetInput( inputImage );
+#else
+  m_Exporter->SetInputData( inputImage );
+#endif
 }