def METHOD_NAME():
    """Test instantiating data then switching to displayed."""
    shape = (10, 15, 20)
    np.random.seed(0)
    data = np.random.random(shape)
    layer = Image(data)
    assert np.all(layer.data == data)
    assert layer.ndim == len(shape)
    np.testing.assert_array_equal(layer.extent.data[1], [s - 1 for s in shape])
    # check displayed data is initially 2D
    assert layer._data_view.shape == shape[-2:]
    layer._slice_dims(ndisplay=3)
    # check displayed data is now 3D
    assert layer._data_view.shape == shape[-3:]
    layer._slice_dims(ndisplay=2)
    # check displayed data is now 2D
    assert layer._data_view.shape == shape[-2:]
    layer = Image(data)
    layer._slice_dims(ndisplay=3)
    assert np.all(layer.data == data)
    assert layer.ndim == len(shape)
    np.testing.assert_array_equal(layer.extent.data[1], [s - 1 for s in shape])
    # check displayed data is initially 3D
    assert layer._data_view.shape == shape[-3:]
    layer._slice_dims(ndisplay=2)
    # check displayed data is now 2D
    assert layer._data_view.shape == shape[-2:]
    layer._slice_dims(ndisplay=3)
    # check displayed data is now 3D
    assert layer._data_view.shape == shape[-3:]