X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=plugins%2FImageGenericFilters%2FRegionOfInterestImageFilter.cxx;h=e73ac5928a836cd709074b4ab7407ba7a3a98294;hb=683fd9cb190ab6835d4c8b58eb2823dd8fbe0b8e;hp=b6bc5465f2f37f49c137c020c2f65731009b1abe;hpb=6bd5a267c827df95f0c1c8f8c0af0f918bf2b31c;p=cpPlugins.git diff --git a/plugins/ImageGenericFilters/RegionOfInterestImageFilter.cxx b/plugins/ImageGenericFilters/RegionOfInterestImageFilter.cxx index b6bc546..e73ac59 100644 --- a/plugins/ImageGenericFilters/RegionOfInterestImageFilter.cxx +++ b/plugins/ImageGenericFilters/RegionOfInterestImageFilter.cxx @@ -1,7 +1,10 @@ #include #include #include +#include +#include +#include #include // ------------------------------------------------------------------------- @@ -9,9 +12,11 @@ cpPluginsImageGenericFilters::RegionOfInterestImageFilter:: RegionOfInterestImageFilter( ) : Superclass( ) { - this->_ConfigureInput< cpPlugins::DataObjects::Image >( "Input", true, false ); - this->_ConfigureInput< cpPlugins::DataObjects::BoundingBox >( "BoundingBox", true, false ); - this->_ConfigureOutput< cpPlugins::DataObjects::Image >( "Output" ); + typedef cpPlugins::DataObjects::Image _TImage; + typedef cpPlugins::DataObjects::BoundingBox _TBBox; + this->_ConfigureInput< _TImage >( "Input", true, false ); + this->_ConfigureInput< _TBBox >( "BoundingBox", true, false ); + this->_ConfigureOutput< _TImage >( "Output" ); } // ------------------------------------------------------------------------- @@ -25,8 +30,9 @@ void cpPluginsImageGenericFilters::RegionOfInterestImageFilter:: _GenerateData( ) { auto o = this->GetInputData( "Input" ); - cpPlugins_Demangle_ImageScalars_Dims( o, _GD0 ); - else this->_Error( "Invalid input image." ); + cpPlugins_Demangle_Image_ScalarPixels_AllDims_1( o, _GD0 ) + cpPlugins_Demangle_Image_ColorPixels_AllDims_1( o, _GD0 ) + this->_Error( "Invalid input image." ); } // ------------------------------------------------------------------------- @@ -34,13 +40,14 @@ template< class _TImage > void cpPluginsImageGenericFilters::RegionOfInterestImageFilter:: _GD0( _TImage* input ) { + typedef cpPlugins::DataObjects::BoundingBox _TBBox; typedef itk::RegionOfInterestImageFilter< _TImage, _TImage > _TFilter; typedef typename _TImage::IndexType _TIndex; typedef typename _TImage::PointType _TPoint; typedef typename _TImage::RegionType _TRegion; typedef typename _TImage::SizeType _TSize; - auto bb = this->GetInput< cpPlugins::DataObjects::BoundingBox >( "BoundingBox" ); + auto bb = this->GetInput< _TBBox >( "BoundingBox" ); _TIndex i0, i1; input->TransformPhysicalPointToIndex( bb->GetMinimum< _TPoint >( ), i0 );