- itk::ImageBase< D >* i =
- dynamic_cast< itk::ImageBase< D >* >( this->_GetInput( 0 ) );
-
- std::string r = "cpPlugins::Plugins::ImageWriter: itk::Image pixel type not supported";
- cpPlugins_ImageWriter_Pixel( r, char, D, i, _GD1 );
- else cpPlugins_ImageWriter_Pixel( r, short, D, i, _GD1 );
- else cpPlugins_ImageWriter_Pixel( r, int, D, i, _GD1 );
- else cpPlugins_ImageWriter_Pixel( r, long, D, i, _GD1 );
- else cpPlugins_ImageWriter_Pixel( r, unsigned char, D, i, _GD1 );
- else cpPlugins_ImageWriter_Pixel( r, unsigned short, D, i, _GD1 );
- else cpPlugins_ImageWriter_Pixel( r, unsigned int, D, i, _GD1 );
- else cpPlugins_ImageWriter_Pixel( r, unsigned long, D, i, _GD1 );
- else cpPlugins_ImageWriter_Pixel( r, float, D, i, _GD1 );
- else cpPlugins_ImageWriter_Pixel( r, double, D, i, _GD1 );
- else cpPlugins_ImageWriter_RGB( r, char, D, i, _GD1 );
- else cpPlugins_ImageWriter_RGB( r, short, D, i, _GD1 );
- else cpPlugins_ImageWriter_RGB( r, int, D, i, _GD1 );
- else cpPlugins_ImageWriter_RGB( r, long, D, i, _GD1 );
- else cpPlugins_ImageWriter_RGB( r, unsigned char, D, i, _GD1 );
- else cpPlugins_ImageWriter_RGB( r, unsigned short, D, i, _GD1 );
- else cpPlugins_ImageWriter_RGB( r, unsigned int, D, i, _GD1 );
- else cpPlugins_ImageWriter_RGB( r, unsigned long, D, i, _GD1 );
- else cpPlugins_ImageWriter_RGB( r, float, D, i, _GD1 );
- else cpPlugins_ImageWriter_RGB( r, double, D, i, _GD1 );
- return( r );
-}
-
-// -------------------------------------------------------------------------
-template< class P, unsigned int D >
-std::string cpPlugins::Plugins::ImageWriter::
-_GD1( )
-{
- typedef itk::Image< P, D > _TImage;
- typedef itk::ImageFileWriter< _TImage > _TImageWriter;
-
- TParameters::const_iterator fIt;
-
- // Get image pixelType
- fIt = this->m_Parameters.find( "FileName" );
- if( fIt == this->m_Parameters.end( ) )
- fIt = this->m_DefaultParameters.find( "FileName" );
-
- _TImageWriter* writer =
- dynamic_cast< _TImageWriter* >( this->m_Writer.GetPointer( ) );