typedef std::vector< AirwaysTree > AirwaysVector;
-#include <itkCastImageFilter.h>
-
// Auxiliar struct to save info for execution.
typedef void* TImagePointer;
struct TreeInfo{
void CastImage( )
{
- auto image = this->myWorkspace->GetFilter( "reader" )->GetOutputData( "Output" )->GetITK< itk::Image< unsigned char, 3 > >( );
- typedef itk::CastImageFilter< itk::Image< unsigned char, 3 >, TInputImage > _TCast;
- _TCast::Pointer cast = _TCast::New( );
- cast->SetInput( image );
- cast->Update( );
- this->Image = cast->GetOutput( );
- this->Image->DisconnectPipeline( );
+ try
+ {
+ this->myWorkspace->Execute( "cast" );
+ }
+ catch( itk::ExceptionObject& err )
+ {
+ std::cerr << "Error: " << err << std::endl;
+ std::exit( 1 );
+
+ } // yrt
+ this->Image =
+ this->myWorkspace->GetFilter( "cast" )->GetOutputData( "Output" )->
+ GetITK< TInputImage >( );
}
TInputImage::Pointer Image;