Skip to content

Commit

Permalink
ENH: add additional assertions for ttype parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
Leengit authored and dzenanz committed Dec 9, 2020
1 parent 25a71e3 commit aac01f1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Wrapping/Generators/Python/Tests/extras.py
Expand Up @@ -344,6 +344,8 @@ def custom_callback(name, progress):
numpyImage = np.random.randint(0, 256, (8, 12, 5)).astype(np.uint8)
image = itk.image_from_array(numpyImage, is_vector=False)
assert type(image) == type(itk.image_from_array(numpyImage, ttype=(type(image),)))
assert type(image) == type(itk.image_from_array(numpyImage, ttype=[type(image)]))
assert type(image) == type(itk.image_from_array(numpyImage, ttype=type(image)))
cast = image.astype(np.uint8)
assert cast == image
(input_image_template, (input_pixel_type, input_image_dimension)) = itk.template(image)
Expand All @@ -369,6 +371,8 @@ def custom_callback(name, progress):
numpyImage = np.random.randint(0, 256, (8, 5, 3)).astype(np.float32)
image = itk.image_from_array(numpyImage, is_vector=True)
assert type(image) == type(itk.image_from_array(numpyImage, ttype=(type(image),)))
assert type(image) == type(itk.image_from_array(numpyImage, ttype=[type(image)]))
assert type(image) == type(itk.image_from_array(numpyImage, ttype=type(image)))
vectorimage = itk.cast_image_filter(
Input=image, ttype=(type(image), itk.VectorImage[itk.F, 2])
)
Expand Down

0 comments on commit aac01f1

Please sign in to comment.