MCPcopy Create free account
hub / github.com/ImageEngine/cortex / test

Method test

test/IECoreImage/ImageThinnerTest.py:43–61  ·  view source on GitHub ↗
( self )

Source from the content-addressed store, hash-verified

41class ImageThinnerTest( unittest.TestCase ) :
42
43 def test( self ) :
44
45 i = IECore.Reader.create( os.path.join( "test", "IECoreImage", "data", "tiff", "toTrace.tif" ) ).read()
46
47 IECoreImage.ImageThinner()( input=i, copyInput=False )
48
49 ii = IECore.Reader.create( os.path.join( "test", "IECoreImage", "data", "tiff", "toTraceThinned.tif" ) ).read()
50
51 i.blindData().clear()
52 ii.blindData().clear()
53
54 self.assertEqual( i.channelNames(), ii.channelNames() )
55 self.assertEqual( i.channelSize(), ii.channelSize() )
56 for c in i.channelNames() :
57 ic = i[c]
58 iic = ii[c]
59 for j in range( 0, i.channelSize() ) :
60 # the values may not match exactly due to color space conversions reading the tif on disk
61 self.assertAlmostEqual( ic[j], iic[j], delta = 0.0001 )
62
63if __name__ == "__main__":
64 unittest.main()

Callers

nothing calls this directly

Calls 8

joinMethod · 0.80
ImageThinnerMethod · 0.80
blindDataMethod · 0.80
channelSizeMethod · 0.80
readMethod · 0.45
createMethod · 0.45
clearMethod · 0.45
channelNamesMethod · 0.45

Tested by

no test coverage detected