MCPcopy Create free account
hub / github.com/SimpleITK/SimpleITK / TEST

Function TEST

Testing/Unit/itkSliceImageFilterTest.cxx:87–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85} // namespace
86
87TEST(SliceImageFilterTests, PhysicalPoint1)
88{
89 const unsigned int ImageDimension = 2;
90 using PixelType = itk::Point<double, ImageDimension>;
91 using ImageType = itk::Image<PixelType, ImageDimension>;
92
93 using SourceType = itk::PhysicalPointImageSource<ImageType>;
94 SourceType::Pointer source = SourceType::New();
95
96
97 // these size are chosen as a power of two and a prime number.
98 SourceType::SizeValueType size[] = { 128, 127 };
99 source->SetSize(size);
100
101 float origin[] = { 1.1f, 2.22f };
102 source->SetOrigin(origin);
103
104
105 int step[ImageDimension];
106 ImageType::IndexType start;
107 ImageType::IndexType stop;
108 stop[0] = size[0];
109 stop[1] = size[1];
110
111 for (start[0] = 0; start[0] < 10; ++start[0])
112 for (start[1] = 0; start[1] < 10; ++start[1])
113 for (step[0] = 1; step[0] < 10; ++step[0])
114 for (step[1] = 1; step[1] < 10; ++step[1])
115 {
116
117 ImageType::Pointer img;
118
119 img = RunFilter<ImageType>(source->GetOutput(), start, stop, step);
120
121 EXPECT_TRUE(CheckValueIsPhysicalPoint(img.GetPointer()))
122 << "== Failed - step:" << step[0] << " " << step[1] << " start: " << start[0] << " " << start[1]
123 << std::endl;
124 }
125}
126
127TEST(SliceImageFilterTests, PhysicalPoint2)
128{

Callers

nothing calls this directly

Calls 5

SetSizeMethod · 0.80
GetNumberOfPixelsMethod · 0.80
SetOriginMethod · 0.45
GetSizeMethod · 0.45

Tested by

no test coverage detected