]> Creatis software - creaVtk.git/blobdiff - lib/creaVtk/cutImageSegmentation.cpp
#3110 creaVtk Bug New Normal - branch vtk7itk4 compilation with vtk7
[creaVtk.git] / lib / creaVtk / cutImageSegmentation.cpp
index 4fa20cadcad798fe0f8dcdc5230c63e70a96e874..f898f85d7bee3c7138ca20b8813f0065f2823a67 100644 (file)
@@ -51,11 +51,6 @@ cutImageSegmentation::GetResultImage()
        return m_ResultImage;
 }
 
-void cutImageSegmentation::InitValues()
-{
-
-       
-}
 
 void cutImageSegmentation::Process()
 {
@@ -160,16 +155,28 @@ void cutImageSegmentation::Process()
 
 
                double origin[3];
-               double *spacing = NULL;
-               spacing = m_Image->GetSpacing();
+               //double *spacing = NULL;
+               //spacing = m_Image->GetSpacing();
+
+               double spacing[3];
+               spacing[0] = 2.62565;
+               spacing[1] = 2.62565;
+               spacing[2] = 6.25;
 
                std::cout << "spacing 0:" << spacing[0]<< std::endl;
                std::cout << "spacing 1:" << spacing[1]<< std::endl;
                std::cout << "spacing 2:" << spacing[2]<< std::endl;
 
-               origin[0] = 63;//bounds[0];
-               origin[1] = 44;//bounds[2];
-               origin[2] = 4;//bounds[4];
+               //origin[0] = bounds[0] + spacing[0] / 2;
+               //origin[1] = bounds[2] + spacing[1] / 2;
+               //origin[2] = bounds[4] + spacing[2] / 2;
+
+
+               //MLER -- EED ??????????????????? 64,52,5
+               origin[0] = 64;
+               origin[1] = 52;
+               origin[2] = 5;
 
                std::cout << "origin;0:" << origin[0]<< std::endl;
                std::cout << "origin 1:" << origin[1]<< std::endl;
@@ -179,23 +186,39 @@ void cutImageSegmentation::Process()
                m_Image->SetOrigin(origin);
 
 
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
                extrude->SetInput(m_Mesh1);
+#else
+               extrude->SetInputData(m_Mesh1);
+#endif
                extrude->SetScaleFactor(1);
                extrude->SetExtrusionTypeToNormalExtrusion();
                extrude->SetVector(0,0,1);
                extrude->Update();
 
                dataToStencil->SetTolerance(0);
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
                dataToStencil->SetInput(extrude->GetOutput());
+#else
+               dataToStencil->SetInputData(extrude->GetOutput());
+#endif
                dataToStencil->SetOutputOrigin(origin);
                dataToStencil->SetOutputSpacing(spacing);
                dataToStencil->SetOutputWholeExtent(m_Image->GetExtent());
                dataToStencil->Update();
 
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
                imageStencil->SetInput(m_Image);
                imageStencil->SetStencil(dataToStencil->GetOutput());
+#else
+               imageStencil->SetInputData(m_Image);
+               imageStencil->SetStencilData(dataToStencil->GetOutput());
+#endif
                imageStencil->ReverseStencilOff();
-               imageStencil->SetBackgroundValue(0);
+               imageStencil->SetBackgroundValue(-200);
                imageStencil->Update();
 
                m_ResultImage = imageStencil->GetOutput();
@@ -204,7 +227,7 @@ void cutImageSegmentation::Process()
        }//i m_Mesh1 != Null
        else{
 
-               std::cout << "MLER cutImageSegmentation :: NO HAY MESH" << std::endl;
+               std::cout << "MLER cutImageSegmentation :: MESH NOT EXIST" << std::endl;
 
        }//else if m_Mesh1