本文整理汇总了C++中VolumeCollection::FindRASPointsInSquare方法的典型用法代码示例。如果您正苦于以下问题:C++ VolumeCollection::FindRASPointsInSquare方法的具体用法?C++ VolumeCollection::FindRASPointsInSquare怎么用?C++ VolumeCollection::FindRASPointsInSquare使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VolumeCollection
的用法示例。
在下文中一共展示了VolumeCollection::FindRASPointsInSquare方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fnSave
//.........这里部分代码省略.........
stringstream ssError;
ssError << "NewUsingTemplate(float) failed value comparison, "
<< "was expecting 0.6789 but got " << value;
Assert( (fabs(0.6789 - value) < 0.00001), ssError.str() );
delete vol2;
}
{
VolumeCollection* vol2 = NULL;
try {
vol2 = new VolumeCollection();
vol2->MakeUsingTemplate( vol->GetID(), 10000 );
throw runtime_error( "MakeUsingTemplate(10000) didn't throw an error");
}
catch(...) {}
delete vol2;
}
dataTransform.SetMainTransform( 1, 0, 0, 0,
0, 1, 0, 0,
0, 0, 1, 0,
0, 0, 0, 1 );
vol->SetDataToWorldTransform( dataTransform.GetID() );
// FindRASPointsInSquare
{
Point3<float> sqRAS[4], cRAS;
sqRAS[0].Set( 0, -3, 71 );
sqRAS[1].Set( 0, 1, 71 );
sqRAS[2].Set( 0, 1, 67 );
sqRAS[3].Set( 0, -3, 67 );
cRAS.Set( 0, -1, 69 );
list<Point3<float> > points;
vol->FindRASPointsInSquare( cRAS.xyz(),
sqRAS[0].xyz(), sqRAS[1].xyz(),
sqRAS[2].xyz(), sqRAS[3].xyz(),
0, points );
list<Point3<float> >::iterator tPoint;
for ( tPoint = points.begin(); tPoint != points.end(); ++tPoint ) {
Point3<float> pRAS = *tPoint;
stringstream ssMsg;
ssMsg << "Failed: " << pRAS << " outside of square";
Assert( ( pRAS[0] == 0 &&
(pRAS[1] >= -3 && pRAS[1] <= 1) &&
(pRAS[2] >= 67 && pRAS[2] <= 71) ),
ssMsg.str() );
}
}
// VoxelIntersectsSegment
{
Point3<int> idx;
Point3<float> segIdxA, segIdxB;
Point3<float> intIdx;
idx.Set( 5, 5, 5 );
float aSegments[6][3] = { {3, 5.5, 5.5}, {6, 5.5, 5.5},
{5.5, 3, 5.5}, {5.5, 6, 5.5},
{5.5, 5.5, 3}, {5.5, 5.5, 6} };
for ( int nSegment = 0; nSegment < 6; nSegment += 2 ) {
segIdxA.Set( aSegments[nSegment] );