7 #ifndef __FWITKIO_ITKPP_HXX__ 8 #define __FWITKIO_ITKPP_HXX__ 10 #include "fwItkIO/itk.hpp" 12 #include <fwTools/DynamicType.hpp> 14 #include <itkCastImageFilter.h> 21 template<
class PIXELTYPE,
int VDimension,
class ScannerType >
22 typename ScannerType::Pointer itkppScannerFactory( ::fwData::Image::sptr imageData)
24 typedef itk::Image< PIXELTYPE, VDimension > ImageType;
26 typename ImageType::Pointer itkRoi = ::fwItkIO::itkImageFactory< ImageType >( imageData );
27 typedef itk::Image< unsigned char, VDimension > ROIType;
28 typedef itk::CastImageFilter< ImageType, ROIType > CasterType;
29 typename CasterType::Pointer caster = CasterType::New();
30 caster->SetInput( itkRoi );
33 typename ScannerType::Pointer scanner = ScannerType::New();
34 typename ROIType::Pointer outImg = caster->GetOutput();
35 scanner->SetMaskImage( outImg );
36 outImg->DisconnectPipeline();
43 #endif // __FWITKIO_ITKPP_HXX__ The namespace fwItkIO contains reader, writer and helper for itk image.