This might produce an empty image. Try setting ThresholdBelow
to a value other than zero. Try 100, 300, and 1000.
The contour
filter’s input will be null pointer. Of course it complains.
Also, generating an isosurface should be done on the original volume, not a thresholded one. In essence you are trying to combine ITK’s and VTK’s way of extracting isosurface, but in a weird (improper) way.
For start, I suggest you stick either to ITK’s example, or VTK’s one.