Created
February 21, 2014 09:33
-
-
Save iMichka/9131352 to your computer and use it in GitHub Desktop.
Hide ITK wrapping warnings
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class FetchStderr(object): | |
def write(self, err): | |
display = False | |
if display: | |
# Display the warnings | |
sys.stdout.write(err) | |
else: | |
# Do not display the warnings | |
pass | |
import sys | |
original_stderr = sys.stderr # Keep a reference to STDERR | |
sys.stderr = FetchStderr() # Redirect the real STDERR | |
import itk | |
# Load an empty image | |
an_image = itk.Image |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment