Skip to content

Commit

Permalink
COMP: fix VTK 6 compilation errors
Browse files Browse the repository at this point in the history
Change SetInput to SetInputData in Logic class.
Kept backward compatibility for VTK5 through version check.
  • Loading branch information
Nicole Aucoin committed Aug 6, 2014
1 parent 8df8ffc commit 86f6b69
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion Logic/vtkSlicerReportingModuleLogic.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1939,7 +1939,11 @@ std::string vtkSlicerReportingModuleLogic::DicomSegWrite(vtkCollection* labelNod
if(labelImage->GetScalarType() != 4)
{
vtkImageCast *cast = vtkImageCast::New();
#if (VTK_MAJOR_VERSION < 6)
cast->SetInput(labelImage);
#else
cast->SetInputData(labelImage);
#endif
cast->SetOutputScalarTypeToShort();
cast->Update();
vtkSmartPointer<vtkMRMLScalarVolumeNode> labelNode = vtkMRMLScalarVolumeNode::SafeDownCast(labelNodes->GetItemAsObject(0));
Expand Down Expand Up @@ -2552,7 +2556,7 @@ bool vtkSlicerReportingModuleLogic::DicomSegRead(vtkCollection* labelNodes, cons
else
{
// use the tag value only if the coding scheme designator and color
// name match!
// name match!
labelValue = tmpLabelValue;
}
}
Expand All @@ -2563,7 +2567,11 @@ bool vtkSlicerReportingModuleLogic::DicomSegRead(vtkCollection* labelNodes, cons
if(imageData->GetScalarType() != 4) // check if short
{
vtkImageCast *cast = vtkImageCast::New();
#if (VTK_MAJOR_VERSION < 6)
cast->SetInput(imageData);
#else
cast->SetInputData(imageData);
#endif
cast->SetOutputScalarTypeToShort();
cast->Update();
imageData->DeepCopy(cast->GetOutput());
Expand Down Expand Up @@ -2697,7 +2705,11 @@ void vtkSlicerReportingModuleLogic::PropagateFindingUpdateToMarkup()

vtkImageData* labelImage = labelVolumeNode->GetImageData();
vtkImageThreshold* thresh = vtkImageThreshold::New();
#if (VTK_MAJOR_VERSION < 6)
thresh->SetInput(labelImage);
#else
thresh->SetInputData(labelImage);
#endif
thresh->ThresholdByUpper(1);
thresh->SetInValue(reportNode->GetFindingLabel());
thresh->Update();
Expand Down

0 comments on commit 86f6b69

Please sign in to comment.