SetInputConnection is for a filter to connect to another filter.
bFilter.SetInputConnection(aFilter.GetOutputPort())
SetInputData is for a filter to connect to a dataset
bFilter.SetInputData(aFilter.GetOutput())
The difference in behavior is that SetInputConnection setup the auto pipeline update mechanism, a render or update() down in the pipeline will trigger all preceding filters to update
reader.SetFileName('name.stl')
aFilter.SetInputConnection(reader.GetOutputPort())
// aFilter do some setting
bFilter.SetInputConnection(aFilter.GetOutputPort())
// bFilter do some setting
bFilter.Update()
SetInputData however need manual update() in each stage for the whole pipeline to work.
reader.SetFileName('name.stl')
reader.Update()
aFilter.SetInputData(reader.GetOutput())
// aFilter do some setting
aFilter.Update()
bFilter.SetInputData(aFilter.GetOutput())
// bFilter do some setting
bFilter.Update()
If any update() misses, you will get empty result error.