本文整理汇总了C++中TImage::getDimension方法的典型用法代码示例。如果您正苦于以下问题:C++ TImage::getDimension方法的具体用法?C++ TImage::getDimension怎么用?C++ TImage::getDimension使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TImage
的用法示例。
在下文中一共展示了TImage::getDimension方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createRegion
void CExtractRegion::createRegion( TImage& work, const TImage& input,
ushort xx, ushort yy, ushort zz, ushort intensity )
{
std::queue<blitz::TinyVector<ushort,3> > regionpts;
blitz::TinyVector<ushort,3> start( xx,yy,zz );
regionpts.push( start );
work(xx,yy,zz) = 1;
ushort zDim = 1;
if ( work.getDimension() == 3 ) zDim = work.getExtent(2);
bool changed = true;
while ( !regionpts.empty() )
{
blitz::TinyVector<ushort,3> vec = regionpts.front();
regionpts.pop();
ushort x = vec[0]; ushort y = vec[1]; ushort z = vec[2];
if ( x > work.getExtent(0) || y > work.getExtent(1) || z > zDim )
{
DS( vec );
exit(0);
}
if ( work(x,y,z) == 1 )
{
if ( x > 0 && x < work.getExtent(0) )
{
if ( input(x-1,y,z) == intensity && work(x-1,y,z)!=1 )
{ work(x-1,y,z)=1; changed = true; regionpts.push( blitz::TinyVector<ushort,3>( x-1,y,z ) ); }
if ( input(x+1,y,z) == intensity && work(x+1,y,z)!=1 )
{ work(x+1,y,z)=1; changed = true; regionpts.push( blitz::TinyVector<ushort,3>( x+1,y,z ) ); }
}
if ( y > 0 && y < work.getExtent(1) )
{
if ( input(x,y-1,z) == intensity && work(x,y-1,z)!=1 )
{ work(x,y-1,z)=1; changed = true; regionpts.push( blitz::TinyVector<ushort,3>( x,y-1,z ) );}
if ( input(x,y+1,z) == intensity && work(x,y+1,z)!=1 )
{ work(x,y+1,z)=1; changed = true; regionpts.push( blitz::TinyVector<ushort,3>( x,y+1,z ) );}
}
if ( z > 0 && z < zDim )
{
if ( input(x,y,z-1) == intensity && work(x,y,z-1)!=1 )
{ work(x,y,z-1)=1; changed = true; regionpts.push( blitz::TinyVector<ushort,3>( x,y,z-1 ) );}
if ( input(x,y,z+1) == intensity && work(x,y,z+1)!=1 )
{ work(x,y,z+1)=1; changed = true; regionpts.push( blitz::TinyVector<ushort,3>( x,y,z+1 ) );}
}
}
}
}