MCPcopy Create free account
hub / github.com/Kitware/VTK / testImage2DScalar

Method testImage2DScalar

Filters/General/Testing/Python/tableBasedClip.py:47–74  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

45 self.assertEqual(c.GetOutput().GetNumberOfCells(), 0)
46
47 def testImage2DScalar(self):
48 planes = ['XY', 'XZ', 'YZ']
49 expectedNCells = [38, 46, 42]
50 expectedNClippedCells = [104, 104, 106]
51 for plane, nCells, nClippedCells in zip(planes,expectedNCells,expectedNClippedCells):
52 r = vtkRTAnalyticSource()
53 r.SetXFreq(600);
54 r.SetYFreq(400);
55 r.SetZFreq(900);
56 if plane == 'XY':
57 r.SetWholeExtent(-5, 5, -5, 5, 0, 0)
58 elif plane == 'XZ':
59 r.SetWholeExtent(-5, 5, 0, 0, -5, 5)
60 else:
61 r.SetWholeExtent(0, 0, -5, 5, -5, 5)
62 r.Update()
63
64 c = vtkTableBasedClipDataSet()
65 c.SetInputConnection(r.GetOutputPort())
66 c.SetUseValueAsOffset(0)
67 c.SetValue(150)
68 c.SetInsideOut(1)
69 c.SetGenerateClippedOutput(1)
70
71 c.Update()
72
73 self.assertEqual(c.GetOutput().GetNumberOfCells(), nCells)
74 self.assertEqual(c.GetClippedOutput().GetNumberOfCells(), nClippedCells)
75
76 def testImage(self):
77 r = vtkRTAnalyticSource()

Callers

nothing calls this directly

Calls 8

SetWholeExtentMethod · 0.45
UpdateMethod · 0.45
SetInputConnectionMethod · 0.45
GetOutputPortMethod · 0.45
SetValueMethod · 0.45
GetNumberOfCellsMethod · 0.45
GetOutputMethod · 0.45
GetClippedOutputMethod · 0.45

Tested by

no test coverage detected