Module Import alias Import alias identifier ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias alias alias alias TryExcept body Import alias identifier Expr Call NameLoad Str handlers ExceptHandler type NameLoad body Assign NameStore NameLoad orelse Assign NameStore NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Num FunctionDef arguments args defaults body Expr Call NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str TryExcept body Expr Call NameLoad Str handlers ExceptHandler type NameLoad body Pass decorator_list FunctionDef arguments args defaults body Assign NameStore Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Str keyword NameLoad Assert CompareEq AttributeLoad NameLoad attr Num Assert CompareEq AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Str keyword NameLoad Assert CompareIn Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index Str decorator_list Call NameLoad UnaryOpNot NameLoad FunctionDef arguments args defaults body Assign NameStore Call AttributeLoad NameLoad attr TupleLoad Num Num Assign SubscriptStore NameLoad Slice Num Num Assign NameStore Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad decorator_list Call NameLoad UnaryOpNot NameLoad Expr Str FunctionDef arguments args defaults body Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Str Assign NameStore Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Str Assert Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad decorator_list Call NameLoad UnaryOpNot NameLoad FunctionDef arguments args defaults body Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Str Assign NameStore Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad decorator_list Call NameLoad UnaryOpNot NameLoad ClassDef bases body FunctionDef arguments args NameParam NameParam NameParam defaults body Assign NameStore Call NameLoad keyword Str Assign NameStore AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Expr Call NameLoad NameLoad NameLoad Assign NameStore Call NameLoad NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body For NameStore ListLoad TupleLoad Num Num TupleLoad Num Num Num TupleLoad Num Num Num body For NameStore TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Assign NameStore BinOpMult Call AttributeLoad NameLoad attr NameLoad keyword NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad If Call AttributeLoad NameLoad attr NameLoad NameLoad body Expr Yield TupleLoad AttributeLoad NameLoad attr NameLoad NameLoad orelse Assign NameStore Call AttributeLoad BinOpMult NameLoad Num attr NameLoad Expr Yield TupleLoad AttributeLoad NameLoad attr NameLoad NameLoad decorator_list Call NameLoad UnaryOpNot NameLoad decorator_list If CompareEq NameLoad Str body ImportFrom alias Expr Call NameLoad
N/A N/A os.path N/A numpy np numpy.testing.decorators skipif numpy.testing assert_raises tempfile NamedTemporaryFile skimage data_dir skimage.io imread imsave use_plugin reset_plugins N/A N/A N/A SimpleITK sitk N/A N/A use_plugin simpleitk N/A N/A N/A ImportError N/A N/A sitk_available False N/A N/A sitk_available True N/A N/A N/A N/A np random seed 0 teardown N/A N/A N/A N/A N/A N/A reset_plugins N/A setup_module N/A N/A self N/A N/A N/A The effect of the `plugin.use` call may be overridden by later imports.
    Call `use_plugin` directly before the tests to ensure that sitk is used.

     N/A N/A N/A N/A use_plugin simpleitk N/A N/A N/A ImportError N/A N/A N/A test_imread_flatten N/A N/A N/A N/A N/A img N/A imread N/A N/A N/A os path join data_dir color.png flatten True N/A N/A N/A img ndim 2 N/A N/A N/A img dtype N/A np float64 N/A img N/A imread N/A N/A N/A os path join data_dir camera.png flatten True N/A N/A N/A N/A np sctype2char N/A img dtype N/A N/A np typecodes N/A AllInteger N/A N/A skipif N/A sitk_available test_bilevel N/A N/A N/A N/A N/A expected N/A N/A np zeros N/A 10 10 N/A N/A expected N/A 2 255 N/A img N/A imread N/A N/A N/A os path join data_dir checker_bilevel.png N/A N/A N/A N/A np testing assert_array_equal img expected N/A N/A skipif N/A sitk_available N/A 
#TODO: This test causes a Segmentation fault
@skipif(not sitk_available)
def test_imread_truncated_jpg():
    assert_raises((RuntimeError, ValueError),
                  imread,
                  os.path.join(data_dir, 'truncated.jpg'))
 test_imread_uint16 N/A N/A N/A N/A N/A expected N/A N/A np load N/A N/A N/A os path join data_dir chessboard_GRAY_U8.npy N/A img N/A imread N/A N/A N/A os path join data_dir chessboard_GRAY_U16.tif N/A N/A N/A np issubdtype N/A img dtype N/A np uint16 N/A N/A N/A N/A np testing assert_array_almost_equal img expected N/A N/A skipif N/A sitk_available test_imread_uint16_big_endian N/A N/A N/A N/A N/A expected N/A N/A np load N/A N/A N/A os path join data_dir chessboard_GRAY_U8.npy N/A img N/A imread N/A N/A N/A os path join data_dir chessboard_GRAY_U16B.tif N/A N/A N/A N/A np testing assert_array_almost_equal img expected N/A N/A skipif N/A sitk_available TestSave N/A N/A roundtrip N/A N/A self dtype x N/A N/A N/A f N/A NamedTemporaryFile suffix .mha N/A fname N/A f name N/A N/A N/A f close N/A N/A imsave fname x N/A y N/A imread fname N/A N/A N/A N/A np testing assert_array_almost_equal x y N/A test_imsave_roundtrip N/A N/A self N/A N/A N/A shape N/A N/A 10 10 N/A 10 10 3 N/A 10 10 4 N/A N/A dtype N/A N/A np uint8 N/A np uint16 N/A np float32 N/A np float64 N/A N/A x N/A N/A N/A np ones shape dtype dtype N/A N/A N/A np random rand shape N/A N/A N/A np issubdtype dtype float N/A N/A N/A N/A N/A self roundtrip dtype x N/A N/A x N/A N/A N/A x 255 astype dtype N/A N/A N/A N/A self roundtrip dtype x N/A N/A skipif N/A sitk_available N/A N/A N/A __name__ __main__ N/A numpy.testing run_module_suite N/A N/A run_module_suite