#include #include #include #include #include #include #include #include #include #include #include #include #include #include /* #include #include #include */ // ------------------------------------------------------------------------- cpPluginsImageFilters::IsoImageSlicer:: IsoImageSlicer( ) : Superclass( ) { this->_AddInput( "Input" ); this->_AddOutput< cpPlugins::Image >( "Output" ); std::vector< std::string > choices; choices.push_back( "float" ); choices.push_back( "double" ); this->m_Parameters.ConfigureAsChoices( "ScalarType", choices ); this->m_Parameters.SetSelectedChoice( "ScalarType", "float" ); /* TODO this->m_Parameters.ConfigureAsReal( "LowerThresholdValue" ); this->m_Parameters.ConfigureAsReal( "UpperThresholdValue" ); this->m_Parameters.ConfigureAsUint( "InsideValue" ); this->m_Parameters.ConfigureAsUint( "OutsideValue" ); this->m_Parameters.SetReal( "LowerThresholdValue", 0 ); this->m_Parameters.SetReal( "UpperThresholdValue", 10000 ); this->m_Parameters.SetReal( "InsideValue", 1 ); this->m_Parameters.SetReal( "OutsideValue", 0 ); */ } // ------------------------------------------------------------------------- cpPluginsImageFilters::IsoImageSlicer:: ~IsoImageSlicer( ) { } // ------------------------------------------------------------------------- std::string cpPluginsImageFilters::IsoImageSlicer:: _GenerateData( ) { auto image = this->GetInputData( "Input" )->GetITK< itk::DataObject >( ); std::string cpPlugin_Image_Demangle_Pixel_AllScalars( r, _GD0, image, 3 ); return( r ); } // ------------------------------------------------------------------------- template< class _TImage > std::string cpPluginsImageFilters::IsoImageSlicer:: _GD0( _TImage* image ) { if( image != NULL ) { auto choice = this->m_Parameters.GetSelectedChoice( "OutputResolution" ); if( choice == "float" ) return( this->_GD1< _TImage, float >( image ) ); else if( choice == "double" ) return( this->_GD1< _TImage, double >( image ) ); else return( "IsoImageSlicer: no valid scalar type." ); } else return( "ImageFilters::IsoImageSlicer: No valid input image." ); } // ------------------------------------------------------------------------- template< class _TImage, class _TScalar > std::string cpPluginsImageFilters::IsoImageSlicer:: _GD1( _TImage* image ) { typedef cpExtensions::Algorithms::IsoImageSlicer< _TImage, _TScalar > _TFilter; typedef typename _TFilter::TVector _TVector; typedef typename _TFilter::TMatrix _TMatrix; // Configure filter _TFilter* filter = this->_CreateITK< _TFilter >( ); filter->SetInput( image ); filter->SetInterpolator( NULL ); filter->SetTranslation( _TVector( ) ); filter->SetRotation( _TMatrix( ) ); filter->SetSize( 1 ); /* TODO filter->SetLowerThreshold( lower_val ); filter->SetUpperThreshold( upper_val ); filter->SetInsideValue( in_val ); filter->SetOutsideValue( out_val ); filter->Update( ); */ // Connect output this->GetOutputData( "Output" )->SetITK( filter->GetOutput( ) ); return( "" ); } #include #include template class cpPluginsImageFilters_EXPORT cpExtensions::Algorithms::BezierCurveFunction< itk::Vector< float, 3 > >; template class cpPluginsImageFilters_EXPORT cpExtensions::Algorithms::BezierCurveFunction< itk::Vector< double, 3 > >; // eof - $RCSfile$