本文整理汇总了C++中proportionaltimegeometry::Pointer::CountTimeSteps方法的典型用法代码示例。如果您正苦于以下问题:C++ Pointer::CountTimeSteps方法的具体用法?C++ Pointer::CountTimeSteps怎么用?C++ Pointer::CountTimeSteps使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类proportionaltimegeometry::Pointer
的用法示例。
在下文中一共展示了Pointer::CountTimeSteps方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: itkDebugMacro
void mitk::ProbeFilter::GenerateOutputInformation()
{
mitk::Surface::ConstPointer input = this->GetInput();
mitk::Image::ConstPointer source = this->GetSource();
mitk::Surface::Pointer output = this->GetOutput();
if(input.IsNull()) return;
if(source.IsNull()) return;
if(input->GetGeometry()==NULL) return;
if(source->GetGeometry()==NULL) return;
if( (input->GetTimeGeometry()->CountTimeSteps()==1) && (source->GetTimeGeometry()->CountTimeSteps()>1) )
{
Geometry3D::Pointer geo3D = Geometry3D::New();
BaseGeometry::Pointer geometry3D = dynamic_cast<BaseGeometry*>(geo3D.GetPointer());
geometry3D->Initialize();
geometry3D->SetBounds(source->GetTimeGeometry()->GetBoundsInWorld());
ProportionalTimeGeometry::Pointer outputTimeGeometry = ProportionalTimeGeometry::New();
outputTimeGeometry->Initialize(geometry3D, source->GetTimeGeometry()->CountTimeSteps());
outputTimeGeometry->SetFirstTimePoint(source->GetTimeGeometry()->GetMinimumTimePoint());
TimePointType stepDuration = source->GetTimeGeometry()->GetMaximumTimePoint(0) - source->GetTimeGeometry()->GetMinimumTimePoint(0);
outputTimeGeometry->SetStepDuration(stepDuration);
output->Expand(outputTimeGeometry->CountTimeSteps());
output->SetTimeGeometry( outputTimeGeometry );
}
else
output->SetGeometry( static_cast<BaseGeometry*>(input->GetGeometry()->Clone().GetPointer()) );
itkDebugMacro(<<"GenerateOutputInformation()");
}
示例2: Clear
void mitk::Image::Initialize(const mitk::PixelType& type, unsigned int dimension, const unsigned int *dimensions, unsigned int channels)
{
Clear();
m_Dimension=dimension;
if(!dimensions)
itkExceptionMacro(<< "invalid zero dimension image");
unsigned int i;
for(i=0;i<dimension;++i)
{
if(dimensions[i]<1)
itkExceptionMacro(<< "invalid dimension[" << i << "]: " << dimensions[i]);
}
// create new array since the old was deleted
m_Dimensions = new unsigned int[MAX_IMAGE_DIMENSIONS];
// initialize the first four dimensions to 1, the remaining 4 to 0
FILL_C_ARRAY(m_Dimensions, 4, 1u);
FILL_C_ARRAY((m_Dimensions+4), 4, 0u);
// copy in the passed dimension information
std::memcpy(m_Dimensions, dimensions, sizeof(unsigned int)*m_Dimension);
this->m_ImageDescriptor = mitk::ImageDescriptor::New();
this->m_ImageDescriptor->Initialize( this->m_Dimensions, this->m_Dimension );
for(i=0;i<4;++i)
{
m_LargestPossibleRegion.SetIndex(i, 0);
m_LargestPossibleRegion.SetSize (i, m_Dimensions[i]);
}
m_LargestPossibleRegion.SetIndex(i, 0);
m_LargestPossibleRegion.SetSize(i, channels);
if(m_LargestPossibleRegion.GetNumberOfPixels()==0)
{
delete [] m_Dimensions;
m_Dimensions = NULL;
return;
}
for( unsigned int i=0u; i<channels; i++)
{
this->m_ImageDescriptor->AddNewChannel( type );
}
PlaneGeometry::Pointer planegeometry = PlaneGeometry::New();
planegeometry->InitializeStandardPlane(m_Dimensions[0], m_Dimensions[1]);
SlicedGeometry3D::Pointer slicedGeometry = SlicedGeometry3D::New();
slicedGeometry->InitializeEvenlySpaced(planegeometry, m_Dimensions[2]);
if(dimension>=4)
{
TimeBounds timebounds;
timebounds[0] = 0.0;
timebounds[1] = 1.0;
slicedGeometry->SetTimeBounds(timebounds);
}
ProportionalTimeGeometry::Pointer timeGeometry = ProportionalTimeGeometry::New();
timeGeometry->Initialize(slicedGeometry, m_Dimensions[3]);
for (TimeStepType step = 0; step < timeGeometry->CountTimeSteps(); ++step)
{
timeGeometry->GetGeometryForTimeStep(step)->ImageGeometryOn();
}
SetTimeGeometry(timeGeometry);
ImageDataItemPointer dnull=NULL;
m_Channels.assign(GetNumberOfChannels(), dnull);
m_Volumes.assign(GetNumberOfChannels()*m_Dimensions[3], dnull);
m_Slices.assign(GetNumberOfChannels()*m_Dimensions[3]*m_Dimensions[2], dnull);
ComputeOffsetTable();
Initialize();
m_Initialized = true;
}