Skip to content

Commit

Permalink
test phase_preprocessing function
Browse files Browse the repository at this point in the history
  • Loading branch information
willgraf committed May 1, 2020
1 parent be61bf8 commit 268f3ec
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions deepcell_toolbox/processing_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,18 @@ def test_normalize():


def test_phase_preprocess():
height, width = 30, 30
height, width = 300, 300
img = _get_image(height, width)
# TODO: bugfix for phase preprocessing
# preprocessed_img = processing.phase_preprocess(img)
# TODO assert correctness

# make rank 4 (batch, X, y, channel)
img = np.expand_dims(img, axis=0)
img = np.expand_dims(img, axis=-1)

preprocessed_img = processing.phase_preprocess(img)
assert (preprocessed_img <= 1).all() and (preprocessed_img >= -1).all()

preprocessed_img = processing.phase_preprocess(img.astype('uint16'))
assert (preprocessed_img <= 1).all() and (preprocessed_img >= -1).all()


def test_mibi():
Expand All @@ -67,7 +74,7 @@ def test_mibi():

def test_pixelwise():
channels = 4
img = np.random.rand(300, 300, channels)
img = np.random.rand(1, 300, 300, channels)
pixelwise_img = processing.pixelwise(img)
np.testing.assert_equal(pixelwise_img.shape, (300, 300, 1))

Expand Down

0 comments on commit 268f3ec

Please sign in to comment.