diff --git a/src/visualization/CellPopulationPyChasteActorGenerator.cpp b/src/visualization/CellPopulationPyChasteActorGenerator.cpp index 94d8cd0b..4351ef15 100644 --- a/src/visualization/CellPopulationPyChasteActorGenerator.cpp +++ b/src/visualization/CellPopulationPyChasteActorGenerator.cpp @@ -324,17 +324,17 @@ void CellPopulationPyChasteActorGenerator::AddPottsBasedCellPopulationActor } } - vtkSmartPointer p_geometry_filter_pre = - vtkSmartPointer::New(); - #if VTK_MAJOR_VERSION <= 5 - p_geometry_filter_pre->SetInput(p_potts_grid); - #else - p_geometry_filter_pre->SetInputData(p_potts_grid); - #endif + auto p_geometry_filter_pre = vtkSmartPointer::New(); + p_geometry_filter_pre->SetInputData(p_potts_grid); vtkSmartPointer p_threshold = vtkSmartPointer::New(); p_threshold->SetInputConnection(p_geometry_filter_pre->GetOutputPort()); + +#if VTK_MAJOR_VERSION < 9 p_threshold->ThresholdByUpper(0.0); +#else + p_threshold->SetUpperThreshold(0.0); +#endif p_threshold->SetInputArrayToProcess(0, 0, 0, vtkDataObject::FIELD_ASSOCIATION_CELLS, "Cell Id"); vtkSmartPointer p_geom_filter = vtkSmartPointer::New(); @@ -366,12 +366,16 @@ void CellPopulationPyChasteActorGenerator::AddPottsBasedCellPopulationActor for(unsigned idx=0; idxGetNumberOfCells(); idx++) { vtkSmartPointer p_local_threshold = vtkSmartPointer::New(); - #if VTK_MAJOR_VERSION <= 5 - p_local_threshold->SetInput(p_geom_filter->GetOutput()); - #else - p_local_threshold->SetInputData(p_geom_filter->GetOutput()); - #endif - p_local_threshold->ThresholdBetween(p_element_base_ids->GetTuple1(idx), p_element_base_ids->GetTuple1(idx)); + p_local_threshold->SetInputData(p_geom_filter->GetOutput()); + +#if VTK_MAJOR_VERSION < 9 + p_local_threshold->ThresholdBetween(p_element_base_ids->GetTuple1(idx), + p_element_base_ids->GetTuple1(idx)); +#else + p_threshold->SetLowerThreshold(p_element_base_ids->GetTuple1(idx)); + p_threshold->SetUpperThreshold(p_element_base_ids->GetTuple1(idx)); +#endif + p_local_threshold->SetInputArrayToProcess(0, 0, 0, vtkDataObject::FIELD_ASSOCIATION_CELLS, "Cell Base Id"); vtkSmartPointer p_local_geom_filter = vtkSmartPointer::New(); @@ -1110,12 +1114,12 @@ void CellPopulationPyChasteActorGenerator::AddMeshBasedCellPopulationActor( p_scaled_ctf->Build(); vtkSmartPointer p_threshold = vtkSmartPointer::New(); - #if VTK_MAJOR_VERSION <= 5 - p_threshold->SetInput(p_voronoi_grid); - #else - p_threshold->SetInputData(p_voronoi_grid); - #endif + p_threshold->SetInputData(p_voronoi_grid); +#if VTK_MAJOR_VERSION < 9 p_threshold->ThresholdByUpper(0.0); +#else + p_threshold->SetUpperThreshold(0.0); +#endif p_threshold->SetInputArrayToProcess(0, 0, 0, vtkDataObject::FIELD_ASSOCIATION_CELLS, "CellColors"); vtkSmartPointer p_geom_filter = vtkSmartPointer::New();