#include <cpPlugins/Plugins/ImageReader.h>
#include <cpPlugins/Interface/Image.h>
-#include <complex>
#include <set>
-#define ITK_MANUAL_INSTANTIATION
-#include <itkImage.h>
-
-#include <itkCovariantVector.h>
-#include <itkDiffusionTensor3D.h>
-#include <itkPoint.h>
-#include <itkRGBPixel.h>
-#include <itkRGBAPixel.h>
-#include <itkSymmetricSecondRankTensor.h>
-#include <itkVector.h>
-
-#undef ITK_MANUAL_INSTANTIATION
#include <itkImageFileReader.h>
#include <itkImageSeriesReader.h>
{
switch( io->GetNumberOfDimensions( ) )
{
- case 1: r = this->_GD0< 1 >( io, names ); break;
case 2: r = this->_GD0< 2 >( io, names ); break;
case 3: r = this->_GD0< 3 >( io, names ); break;
case 4: r = this->_GD0< 4 >( io, names ); break;
{
switch( D )
{
- case 1:
- r = this->_RealGD< itk::Offset< 1 >, 1 >( names );
- break;
case 2:
r = this->_RealGD< itk::Offset< 2 >, 2 >( names );
break;
break;
} // hctiws
}
+ else if( D == 4 )
+ {
+ switch( ct )
+ {
+ case itk::ImageIOBase::FLOAT:
+ r = this->_RealGD< itk::DiffusionTensor3D< float >, 4 >( names );
+ break;
+ case itk::ImageIOBase::DOUBLE:
+ r = this->_RealGD< itk::DiffusionTensor3D< double >, 4 >( names );
+ break;
+ default:
+ r = "ImageReader: Diffusion tensor type not supported.";
+ break;
+ } // hctiws
+ }
else
r = "ImageReader: Diffusion tensor dimension not supported.";
}
try
{
reader->Update( );
- this->m_Outputs[ 0 ]->SetITKDataObject( reader->GetOutput( ) );
+ cpPlugins::Interface::Image* out =
+ this->_Output< cpPlugins::Interface::Image >( 0 );
+ if( out != NULL )
+ out->SetITKImage< _I >( reader->GetOutput( ) );
+ else
+ r = "ImageReader: output not correctly created.";
}
catch( itk::ExceptionObject& err )
{
r = "ImageReader: " + std::string( err.GetDescription( ) );
- this->m_Outputs[ 0 ]->SetITKDataObject( NULL );
+ cpPlugins::Interface::Image* out =
+ this->_Output< cpPlugins::Interface::Image >( 0 );
+ if( out != NULL )
+ out->SetITKImage< _I >( NULL );
+ else
+ r = "ImageReader: output not correctly created.";
} // yrt
}
try
{
reader->Update( );
- this->m_Outputs[ 0 ]->SetITKDataObject( reader->GetOutput( ) );
+ cpPlugins::Interface::Image* out =
+ this->_Output< cpPlugins::Interface::Image >( 0 );
+ if( out != NULL )
+ out->SetITKImage< _I >( reader->GetOutput( ) );
+ else
+ r = "ImageReader: output not correctly created.";
}
catch( itk::ExceptionObject& err )
{
r = "ImageReader: " + std::string( err.GetDescription( ) );
- this->m_Outputs[ 0 ]->SetITKDataObject( NULL );
+ cpPlugins::Interface::Image* out =
+ this->_Output< cpPlugins::Interface::Image >( 0 );
+ if( out != NULL )
+ out->SetITKImage< _I >( NULL );
+ else
+ r = "ImageReader: output not correctly created.";
} // yrt
}