Пример #1
0
void Preprocess::DanielssonDistanceMap(void)
{
    typedef itk::DanielssonDistanceMapImageFilter<ImageType3D, FloatImageType3D>  DT_Type;
	DT_Type::Pointer filter = DT_Type::New();
	filter->SetInput( myImg );
	try
	{
		filter->Update();
	}
	catch( itk::ExceptionObject & err )
	{
		std::cerr << "ITK FILTER ERROR: " << err << std::endl;
	}
	
	myImg = RescaleFloatToImageType( filter->GetDistanceMap() );
}
bool VolumeProcess:: RunDanielssonDistanceMap(void)
{
    typedef itk::DanielssonDistanceMapImageFilter<ImageType, FloatImageType3D>  DT_Type;
	DT_Type::Pointer DTfilter = DT_Type::New();
	DTfilter->SetInput( m_outputImage );
	//DTfilter->GetDistanceMap();
	try
	{
		DTfilter->Update();
	}
	catch( itk::ExceptionObject & err )
	{
		std::cerr << "ITK FILTER ERROR: " << err << std::endl ;
		return false;
	}
	m_outputImage = RescaleFloatToImageType(DTfilter->GetDistanceMap());
	
	if(debug)
		std::cerr << "DanielssonDistanceMap Filter Done" << std::endl;
	return true;
}