From 9b11582dc5062474361432e46838c4e790c21f10 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Leonardo=20Fl=C3=B3rez-Valencia?= Date: Tue, 1 Nov 2016 17:14:52 -0500 Subject: [PATCH] ... --- lib/Instances/BaseObjects.i | 2 +- lib/Instances/CMakeLists.txt | 2 + lib/Instances/ImageComplexFilters.i | 15 +++ .../Algorithms/GradientImageFunctionBase.h | 2 + lib/cpPlugins/BaseObjects/Parameters.cxx | 116 +++++++++++++++-- lib/cpPlugins/BaseObjects/Parameters.h | 69 +++++----- lib/cpPlugins/BaseObjects/Widget.cxx | 3 +- lib/cpPlugins/DataObjects/Image.d | 1 + lib/cpPlugins/QT/OpenFileDialog.cxx | 112 +++++++++++++++++ lib/cpPlugins/QT/OpenFileDialog.h | 46 +++++++ lib/cpPlugins/QT/SaveFileDialog.cxx | 81 ++++++++++++ lib/cpPlugins/QT/SaveFileDialog.h | 46 +++++++ ...rvatureAnisotropicDiffusionImageFilter.cxx | 13 +- plugins/CMakeLists.txt | 6 + .../PolyLineParametricPathToSimple3DCurve.cxx | 3 +- plugins/IO/ImageReader.cxx | 118 +++++------------- plugins/IO/ImageReaderQDialog.h | 38 ------ plugins/IO/ImageWriter.cxx | 77 +----------- plugins/IO/ImageWriterQDialog.h | 38 ------ plugins/IO/MeshWriter.cxx | 25 +++- plugins/IO/MeshWriter.h | 3 + .../ImageArithmeticFilters/PowImageFilter.cxx | 3 +- .../BinaryContourImageFilter.cxx | 10 +- .../SignedMaurerDistanceMapImageFilter.cxx | 13 +- .../RescaleIntensityImageFilter.cxx | 7 +- .../ImageGradientFilters/FluxImageFilter.cxx | 72 +++++------ .../GulsunTekImageFilter.cxx | 118 ++++++------------ .../GulsunTekImageFilter.h | 4 +- .../ImageGradientFilters.i | 30 +++++ .../ImageGradientFilters/MFluxImageFilter.cxx | 72 +++++------ .../MultiScaleGaussianImageFilter.cxx | 14 --- plugins/ImageMeshFilters/RasterMeshFilter.cxx | 10 +- .../BinaryDilateParaImageFilter.cxx | 47 +++---- .../BinaryErodeParaImageFilter.cxx | 47 +++---- .../ImageParaMorphologyFilter.i | 17 +++ .../BinaryThresholdImageFilter.cxx | 62 ++++----- .../ImageThresholdFilters.i | 3 + .../ImageToBoundingBoxFromThreshold.cxx | 53 ++++---- .../UnaryThresholdImageFilter.cxx | 54 ++++---- plugins/MeshSources/CylinderSource.cxx | 9 +- plugins/MeshSources/SphereSource.cxx | 9 +- plugins/Widgets/SplineWidget.cxx | 3 +- 42 files changed, 794 insertions(+), 679 deletions(-) create mode 100644 lib/Instances/ImageComplexFilters.i create mode 100644 lib/cpPlugins/QT/OpenFileDialog.cxx create mode 100644 lib/cpPlugins/QT/OpenFileDialog.h create mode 100644 lib/cpPlugins/QT/SaveFileDialog.cxx create mode 100644 lib/cpPlugins/QT/SaveFileDialog.h delete mode 100644 plugins/IO/ImageReaderQDialog.h delete mode 100644 plugins/IO/ImageWriterQDialog.h create mode 100644 plugins/ImageGradientFilters/ImageGradientFilters.i create mode 100644 plugins/ImageParaMorphologyFilters/ImageParaMorphologyFilter.i diff --git a/lib/Instances/BaseObjects.i b/lib/Instances/BaseObjects.i index 384aad5..88d6266 100644 --- a/lib/Instances/BaseObjects.i +++ b/lib/Instances/BaseObjects.i @@ -24,7 +24,7 @@ instances itk::SymmetricEigenAnalysis< itk::Matrix< #real_types#, #process_dims# instances itk::SimpleDataObjectDecorator< #scalar_pixels# > -define my_vectors=Vector;Point +define my_vectors=FixedArray;Vector;Point minstances #_export_# std::ostream& itk::operator<< < #real_types#, #process_dims# >( std::ostream& a, itk::#my_vectors#< #real_types#, #process_dims# > const& b ) diff --git a/lib/Instances/CMakeLists.txt b/lib/Instances/CMakeLists.txt index aaa936e..8ede413 100644 --- a/lib/Instances/CMakeLists.txt +++ b/lib/Instances/CMakeLists.txt @@ -5,6 +5,7 @@ SET( ImageIterators ImageNeighborhoodIterators ImageFiltersBases + ImageComplexFilters BoundingBoxes Meshes ) @@ -28,6 +29,7 @@ TARGET_LINK_LIBRARIES(cpInstances_SimpleImages cpInstances_BaseObjects) TARGET_LINK_LIBRARIES(cpInstances_ImageIterators cpInstances_SimpleImages) TARGET_LINK_LIBRARIES(cpInstances_ImageNeighborhoodIterators cpInstances_SimpleImages) TARGET_LINK_LIBRARIES(cpInstances_ImageFiltersBases cpInstances_SimpleImages) +TARGET_LINK_LIBRARIES(cpInstances_ImageComplexFilters cpInstances_ImageFiltersBases cpInstances_ImageIterators) TARGET_LINK_LIBRARIES(cpInstances_BoundingBoxes cpInstances_BaseObjects) TARGET_LINK_LIBRARIES(cpInstances_Meshes cpInstances_BoundingBoxes) diff --git a/lib/Instances/ImageComplexFilters.i b/lib/Instances/ImageComplexFilters.i new file mode 100644 index 0000000..167c0f5 --- /dev/null +++ b/lib/Instances/ImageComplexFilters.i @@ -0,0 +1,15 @@ +header #define ITK_MANUAL_INSTANTIATION + +cinclude itkCovariantVector.h + +tinclude itkImageToImageFilter:h|hxx +tinclude itkInPlaceImageFilter:h|hxx +tinclude itkRecursiveSeparableImageFilter:h|hxx + +instances itk::ImageToImageFilter< itk::Image< #scalar_pixels#, #process_dims# >, itk::Image< itk::CovariantVector< #real_types#, #process_dims# >, #process_dims# > > +instances itk::ImageToImageFilter< itk::Image< itk::CovariantVector< #real_types#, #process_dims# >, #process_dims# >, itk::Image< #scalar_pixels#, #process_dims# > > +instances itk::RecursiveSeparableImageFilter< itk::Image< #scalar_pixels#, #process_dims# >, itk::Image< #real_types#, #process_dims# > > + +instances itk::InPlaceImageFilter< itk::Image< itk::CovariantVector< #real_types#, #process_dims# >, #process_dims# >, itk::Image< itk::CovariantVector< #real_types#, #process_dims# >, #process_dims# > > + +** eof - $RCSfile$ diff --git a/lib/cpExtensions/Algorithms/GradientImageFunctionBase.h b/lib/cpExtensions/Algorithms/GradientImageFunctionBase.h index f6d3e5c..7350495 100644 --- a/lib/cpExtensions/Algorithms/GradientImageFunctionBase.h +++ b/lib/cpExtensions/Algorithms/GradientImageFunctionBase.h @@ -1,6 +1,8 @@ #ifndef __CPEXTENSIONS__ALGORITHMS__GRADIENTIMAGEFUNCTIONBASE__H__ #define __CPEXTENSIONS__ALGORITHMS__GRADIENTIMAGEFUNCTIONBASE__H__ +#include +#include #include namespace cpExtensions diff --git a/lib/cpPlugins/BaseObjects/Parameters.cxx b/lib/cpPlugins/BaseObjects/Parameters.cxx index e77c2cc..d552786 100644 --- a/lib/cpPlugins/BaseObjects/Parameters.cxx +++ b/lib/cpPlugins/BaseObjects/Parameters.cxx @@ -349,12 +349,24 @@ GetRawParameters( ) const // ------------------------------------------------------------------------- #define cpPlugins_BaseObjects_Parameters_Configure_Code( Y ) \ void cpPlugins::BaseObjects::Parameters:: \ - ConfigureAs##Y( const std::string& name ) \ - { this->_Configure< Y >( name ); } \ + ConfigureAs##Y( const std::string& name, const T##Y& init ) \ + { \ + this->_Configure< Y >( name ); \ + this->Set##Y( name, init ); \ + } \ bool cpPlugins::BaseObjects::Parameters:: \ Has##Y( const std::string& name ) const \ { return( this->_Has< Y >( name ) ); } +// ------------------------------------------------------------------------- +#define cpPlugins_BaseObjects_Parameters_ConfigureList_Code( Y ) \ + void cpPlugins::BaseObjects::Parameters:: \ + ConfigureAs##Y##List( const std::string& name ) \ + { this->_Configure< Y##List >( name ); } \ + bool cpPlugins::BaseObjects::Parameters:: \ + Has##Y##List( const std::string& name ) const \ + { return( this->_Has< Y##List >( name ) ); } + // ------------------------------------------------------------------------- #define cpPlugins_BaseObjects_Parameters_GetSet_Code( Y ) \ cpPlugins::BaseObjects::Parameters::T##Y \ @@ -390,15 +402,16 @@ cpPlugins_BaseObjects_Parameters_Configure_Code( Real ); cpPlugins_BaseObjects_Parameters_Configure_Code( OpenFileName ); cpPlugins_BaseObjects_Parameters_Configure_Code( SaveFileName ); cpPlugins_BaseObjects_Parameters_Configure_Code( PathName ); -cpPlugins_BaseObjects_Parameters_Configure_Code( StringList ); -cpPlugins_BaseObjects_Parameters_Configure_Code( BoolList ); -cpPlugins_BaseObjects_Parameters_Configure_Code( IntList ); -cpPlugins_BaseObjects_Parameters_Configure_Code( UintList ); -cpPlugins_BaseObjects_Parameters_Configure_Code( RealList ); -cpPlugins_BaseObjects_Parameters_Configure_Code( OpenFileNameList ); -cpPlugins_BaseObjects_Parameters_Configure_Code( SaveFileNameList ); -cpPlugins_BaseObjects_Parameters_Configure_Code( PathNameList ); -cpPlugins_BaseObjects_Parameters_Configure_Code( Choices ); + +cpPlugins_BaseObjects_Parameters_ConfigureList_Code( String ); +cpPlugins_BaseObjects_Parameters_ConfigureList_Code( Bool ); +cpPlugins_BaseObjects_Parameters_ConfigureList_Code( Int ); +cpPlugins_BaseObjects_Parameters_ConfigureList_Code( Uint ); +cpPlugins_BaseObjects_Parameters_ConfigureList_Code( Real ); +cpPlugins_BaseObjects_Parameters_ConfigureList_Code( OpenFileName ); +cpPlugins_BaseObjects_Parameters_ConfigureList_Code( SaveFileName ); +cpPlugins_BaseObjects_Parameters_ConfigureList_Code( PathName ); + cpPlugins_BaseObjects_Parameters_GetSet_Code( Bool ); cpPlugins_BaseObjects_Parameters_GetSet_Code( Int ); cpPlugins_BaseObjects_Parameters_GetSet_Code( Uint ); @@ -406,15 +419,92 @@ cpPlugins_BaseObjects_Parameters_GetSet_Code( Real ); cpPlugins_BaseObjects_Parameters_GetSet_Code( OpenFileName ); cpPlugins_BaseObjects_Parameters_GetSet_Code( SaveFileName ); cpPlugins_BaseObjects_Parameters_GetSet_Code( PathName ); + cpPlugins_BaseObjects_Parameters_GetSetList_Code( String ); cpPlugins_BaseObjects_Parameters_GetSetList_Code( Bool ); cpPlugins_BaseObjects_Parameters_GetSetList_Code( Int ); cpPlugins_BaseObjects_Parameters_GetSetList_Code( Uint ); cpPlugins_BaseObjects_Parameters_GetSetList_Code( Real ); -cpPlugins_BaseObjects_Parameters_GetSetList_Code( OpenFileName ); -cpPlugins_BaseObjects_Parameters_GetSetList_Code( SaveFileName ); cpPlugins_BaseObjects_Parameters_GetSetList_Code( PathName ); +// ------------------------------------------------------------------------- +std::vector< cpPlugins::BaseObjects::Parameters::TOpenFileName > +cpPlugins::BaseObjects::Parameters:: +GetOpenFileNameList( const std::string& name ) const +{ + return( this->_GetList< TOpenFileName, OpenFileNameList >( name ) ); +} + +// ------------------------------------------------------------------------- +void cpPlugins::BaseObjects::Parameters:: +AddToOpenFileNameList( + const std::string& name, + const cpPlugins::BaseObjects::Parameters::TOpenFileName& v + ) +{ + auto i = this->m_Parameters.find( name ); + if( i != this->m_Parameters.end( ) ) + { + if( i->second.first == OpenFileNameList ) + { + auto pos = name.find_last_of( "/\\" ); + if( i->second.second == "" ) + i->second.second = name.substr( 0, pos ); + i->second.second += std::string( "#" ); + i->second.second += name.substr( pos + 1 ); + this->Modified( ); + + } // fi + + } // fi +} + +// ------------------------------------------------------------------------- +void cpPlugins::BaseObjects::Parameters:: +ClearOpenFileNameList( const std::string& name ) +{ + this->_ClearList< OpenFileNameList >( name ); +} + +// ------------------------------------------------------------------------- +std::vector< cpPlugins::BaseObjects::Parameters::TSaveFileName > +cpPlugins::BaseObjects::Parameters:: +GetSaveFileNameList( const std::string& name ) const +{ + return( this->_GetList< TSaveFileName, SaveFileNameList >( name ) ); +} + +// ------------------------------------------------------------------------- +void cpPlugins::BaseObjects::Parameters:: +AddToSaveFileNameList( + const std::string& name, + const cpPlugins::BaseObjects::Parameters::TSaveFileName& v + ) +{ + auto i = this->m_Parameters.find( name ); + if( i != this->m_Parameters.end( ) ) + { + if( i->second.first == SaveFileNameList ) + { + auto pos = name.find_last_of( "/\\" ); + if( i->second.second == "" ) + i->second.second = name.substr( 0, pos ); + i->second.second += std::string( "#" ); + i->second.second += name.substr( pos + 1 ); + this->Modified( ); + + } // fi + + } // fi +} + +// ------------------------------------------------------------------------- +void cpPlugins::BaseObjects::Parameters:: +ClearSaveFileNameList( const std::string& name ) +{ + this->_ClearList< SaveFileNameList >( name ); +} + // ------------------------------------------------------------------------- template< unsigned int _Enum > void cpPlugins::BaseObjects::Parameters:: diff --git a/lib/cpPlugins/BaseObjects/Parameters.h b/lib/cpPlugins/BaseObjects/Parameters.h index 338c8af..fd6764b 100644 --- a/lib/cpPlugins/BaseObjects/Parameters.h +++ b/lib/cpPlugins/BaseObjects/Parameters.h @@ -17,13 +17,18 @@ namespace tinyxml2 } // ------------------------------------------------------------------------- -#define cpPlugins_BaseObjects_Parameters_Configure( Y ) \ - void ConfigureAs##Y( const std::string& name ); \ +#define cpPlugins_BaseObjects_Parameters_Configure( Y ) \ + void ConfigureAs##Y( const std::string& name, const T##Y& init ); \ bool Has##Y( const std::string& name ) const // ------------------------------------------------------------------------- -#define cpPlugins_BaseObjects_Parameters_GetSet( Y ) \ - T##Y Get##Y( const std::string& name ) const; \ +#define cpPlugins_BaseObjects_Parameters_ConfigureList( Y ) \ + void ConfigureAs##Y##List( const std::string& name ); \ + bool Has##Y##List( const std::string& name ) const + +// ------------------------------------------------------------------------- +#define cpPlugins_BaseObjects_Parameters_GetSet( Y ) \ + T##Y Get##Y( const std::string& name ) const; \ void Set##Y( const std::string& name, const T##Y& v ) // ------------------------------------------------------------------------- @@ -46,18 +51,18 @@ namespace cpPlugins // Frienship with forward declaration to improve Qt dialog execution friend class cpPlugins::QT::ParametersDialog; friend std::ostream& operator<<( std::ostream& o, const Parameters& p ) - { - for( - auto i = p.m_Parameters.begin( ); - i != p.m_Parameters.end( ); - ++i - ) - o << i->first << ": (" - << i->second.first << " | " - << i->second.second << ")" - << std::endl; - return( o ); - } + { + for( + auto i = p.m_Parameters.begin( ); + i != p.m_Parameters.end( ); + ++i + ) + o << i->first << ": (" + << i->second.first << " | " + << i->second.second << ")" + << std::endl; + return( o ); + } public: typedef Parameters Self; @@ -93,15 +98,15 @@ namespace cpPlugins cpPlugins_BaseObjects_Parameters_Configure( OpenFileName ); cpPlugins_BaseObjects_Parameters_Configure( SaveFileName ); cpPlugins_BaseObjects_Parameters_Configure( PathName ); - cpPlugins_BaseObjects_Parameters_Configure( StringList ); - cpPlugins_BaseObjects_Parameters_Configure( BoolList ); - cpPlugins_BaseObjects_Parameters_Configure( IntList ); - cpPlugins_BaseObjects_Parameters_Configure( UintList ); - cpPlugins_BaseObjects_Parameters_Configure( RealList ); - cpPlugins_BaseObjects_Parameters_Configure( OpenFileNameList ); - cpPlugins_BaseObjects_Parameters_Configure( SaveFileNameList ); - cpPlugins_BaseObjects_Parameters_Configure( PathNameList ); - cpPlugins_BaseObjects_Parameters_Configure( Choices ); + + cpPlugins_BaseObjects_Parameters_ConfigureList( String ); + cpPlugins_BaseObjects_Parameters_ConfigureList( Bool ); + cpPlugins_BaseObjects_Parameters_ConfigureList( Int ); + cpPlugins_BaseObjects_Parameters_ConfigureList( Uint ); + cpPlugins_BaseObjects_Parameters_ConfigureList( Real ); + cpPlugins_BaseObjects_Parameters_ConfigureList( OpenFileName ); + cpPlugins_BaseObjects_Parameters_ConfigureList( SaveFileName ); + cpPlugins_BaseObjects_Parameters_ConfigureList( PathName ); cpPlugins_BaseObjects_Parameters_GetSet( Bool ); cpPlugins_BaseObjects_Parameters_GetSet( Int ); @@ -170,25 +175,25 @@ namespace cpPlugins const TParameters& GetRawParameters( ) const; template< unsigned int _Enum > - inline void _Configure( const std::string& name ); + inline void _Configure( const std::string& name ); template< unsigned int _Enum > - inline bool _Has( const std::string& name ) const; + inline bool _Has( const std::string& name ) const; template< class _Type, unsigned int _Enum > - inline _Type _Get( const std::string& name ) const; + inline _Type _Get( const std::string& name ) const; template< class _Type, unsigned int _Enum > - inline void _Set( const std::string& name, const _Type& v ); + inline void _Set( const std::string& name, const _Type& v ); template< class _Type, unsigned int _Enum > - inline std::vector< _Type > _GetList( const std::string& name ) const; + inline std::vector< _Type > _GetList( const std::string& name ) const; template< class _Type, unsigned int _Enum > - inline void _AddToList( const std::string& name, const _Type& v ); + inline void _AddToList( const std::string& name, const _Type& v ); template< unsigned int _Enum > - inline void _ClearList( const std::string& name ); + inline void _ClearList( const std::string& name ); private: // Purposely not implemented diff --git a/lib/cpPlugins/BaseObjects/Widget.cxx b/lib/cpPlugins/BaseObjects/Widget.cxx index 93bf1b9..fe842aa 100644 --- a/lib/cpPlugins/BaseObjects/Widget.cxx +++ b/lib/cpPlugins/BaseObjects/Widget.cxx @@ -35,8 +35,7 @@ cpPlugins::BaseObjects::Widget:: Widget( ) : Superclass( ) { - this->m_Parameters.ConfigureAsString( "Text" ); - this->m_Parameters.SetString( "Text", "" ); + this->m_Parameters.ConfigureAsString( "Text", "" ); } // ------------------------------------------------------------------------- diff --git a/lib/cpPlugins/DataObjects/Image.d b/lib/cpPlugins/DataObjects/Image.d index 0ed7696..0d8a325 100644 --- a/lib/cpPlugins/DataObjects/Image.d +++ b/lib/cpPlugins/DataObjects/Image.d @@ -19,5 +19,6 @@ ColorPixels_AllDims itk::Image< itk::#color_pixels#< #scalar_pixels# >, #process ColorPixels_VisualDims itk::Image< itk::#color_pixels#< #scalar_pixels# >, #visual_dims# > VectorPixels_AllDims itk::Image< itk::#vectors#< #real_types#, #process_dims# >, #process_dims# > VectorPixels_VisualDims itk::Image< itk::#vectors#< #real_types#, #visual_dims# >, #visual_dims# > +CovariantVectorPixels_AllDims itk::Image< itk::CovariantVector< #real_types#, #process_dims# >, #process_dims# > ** eof - $RCSfile$ diff --git a/lib/cpPlugins/QT/OpenFileDialog.cxx b/lib/cpPlugins/QT/OpenFileDialog.cxx new file mode 100644 index 0000000..1027250 --- /dev/null +++ b/lib/cpPlugins/QT/OpenFileDialog.cxx @@ -0,0 +1,112 @@ +#include + +#ifdef cpPlugins_QT4 + +#include + +// ------------------------------------------------------------------------- +cpPlugins::QT::OpenFileDialog:: +OpenFileDialog( QWidget* parent ) + : QFileDialog( parent ), + m_Parameters( NULL ), + m_Name( "" ) +{ + this->connect( + this, SIGNAL( accepted( ) ), this, SLOT( _dlg_Accepted( ) ) + ); + this->setWindowTitle( "Open an(some) file(s)" ); +} + +// ------------------------------------------------------------------------- +cpPlugins::QT::OpenFileDialog:: +~OpenFileDialog( ) +{ +} + +// ------------------------------------------------------------------------- +void cpPlugins::QT::OpenFileDialog:: +SetParameters( + cpPlugins::BaseObjects::Parameters* params, const std::string& name + ) +{ + if( params == NULL ) + { + this->m_Parameters = NULL; + this->m_Name = ""; + return; + + } // fi + auto param_type = params->GetType( name ); + if( + param_type != cpPlugins::BaseObjects::Parameters::OpenFileName && + param_type != cpPlugins::BaseObjects::Parameters::OpenFileNameList + ) + { + this->m_Parameters = NULL; + this->m_Name = ""; + return; + + } // fi + this->m_Parameters = params; + this->m_Name = name; + + QStringList filters; + auto extensions = this->m_Parameters->GetAcceptedFileExtensions( name ); + if( extensions != "" ) + filters << extensions.c_str( ); + filters << "Any file (*)"; + if( param_type == cpPlugins::BaseObjects::Parameters::OpenFileName ) + this->setFileMode( QFileDialog::ExistingFile ); + else + this->setFileMode( QFileDialog::ExistingFiles ); + this->setNameFilters( filters ); + this->setAcceptMode( QFileDialog::AcceptOpen ); + if( param_type == cpPlugins::BaseObjects::Parameters::OpenFileName ) + { + auto file = this->m_Parameters->GetOpenFileName( this->m_Name ); + if( file == "" ) + file = "."; + QFileInfo info( file.c_str( ) ); + this->setDirectory( info.canonicalPath( ) ); + } + else + { + auto files = this->m_Parameters->GetOpenFileNameList( this->m_Name ); + if( files.size( ) > 0 ) + { + QFileInfo info( files[ 0 ].c_str( ) ); + this->setDirectory( info.canonicalPath( ) ); + } + else + this->setDirectory( "." ); + + } // fi +} + +// ------------------------------------------------------------------------- +void cpPlugins::QT::OpenFileDialog:: +_dlg_Accepted( ) +{ + if( this->m_Parameters != NULL ) + { + auto files = this->selectedFiles( ); + auto param_type = this->m_Parameters->GetType( this->m_Name ); + if( param_type == cpPlugins::BaseObjects::Parameters::OpenFileNameList ) + { + this->m_Parameters->ClearOpenFileNameList( this->m_Name ); + for( auto fIt = files.begin( ); fIt != files.end( ); ++fIt ) + this->m_Parameters->AddToOpenFileNameList( + this->m_Name, fIt->toStdString( ) + ); + } + else + this->m_Parameters->SetOpenFileName( + this->m_Name, files[ 0 ].toStdString( ) + ); + + } // fi +} + +#endif // cpPlugins_QT4 + +// eof - $RCSfile$ diff --git a/lib/cpPlugins/QT/OpenFileDialog.h b/lib/cpPlugins/QT/OpenFileDialog.h new file mode 100644 index 0000000..8b1e304 --- /dev/null +++ b/lib/cpPlugins/QT/OpenFileDialog.h @@ -0,0 +1,46 @@ +#ifndef __cpPlugins__QT__OpenFileDialog__h__ +#define __cpPlugins__QT__OpenFileDialog__h__ + +#include + +#ifdef cpPlugins_QT4 + +#include + +namespace cpPlugins{ namespace BaseObjects { class Parameters; } } + +namespace cpPlugins +{ + namespace QT + { + /** + */ + class OpenFileDialog + : public QFileDialog + { + Q_OBJECT; + public: + OpenFileDialog( QWidget* parent = 0 ); + virtual ~OpenFileDialog( ); + + void SetParameters( + cpPlugins::BaseObjects::Parameters* params, const std::string& name + ); + + protected slots: + void _dlg_Accepted( ); + + protected: + cpPlugins::BaseObjects::Parameters* m_Parameters; + std::string m_Name; + }; + + } // ecapseman + +} // ecapseman + +#endif // cpPlugins_QT4 + +#endif // __cpPlugins__QT__OpenFileDialog__h__ + +// eof - $RCSfile$ diff --git a/lib/cpPlugins/QT/SaveFileDialog.cxx b/lib/cpPlugins/QT/SaveFileDialog.cxx new file mode 100644 index 0000000..7fb1f63 --- /dev/null +++ b/lib/cpPlugins/QT/SaveFileDialog.cxx @@ -0,0 +1,81 @@ +#include + +#ifdef cpPlugins_QT4 + +#include + +// ------------------------------------------------------------------------- +cpPlugins::QT::SaveFileDialog:: +SaveFileDialog( QWidget* parent ) + : QFileDialog( parent ), + m_Parameters( NULL ), + m_Name( "" ) +{ + this->connect( + this, SIGNAL( accepted( ) ), this, SLOT( _dlg_Accepted( ) ) + ); + this->setWindowTitle( "Save a file" ); +} + +// ------------------------------------------------------------------------- +cpPlugins::QT::SaveFileDialog:: +~SaveFileDialog( ) +{ +} + +// ------------------------------------------------------------------------- +void cpPlugins::QT::SaveFileDialog:: +SetParameters( + cpPlugins::BaseObjects::Parameters* params, const std::string& name + ) +{ + if( params == NULL ) + { + this->m_Parameters = NULL; + this->m_Name = ""; + return; + + } // fi + auto param_type = params->GetType( name ); + if( param_type != cpPlugins::BaseObjects::Parameters::SaveFileName ) + { + this->m_Parameters = NULL; + this->m_Name = ""; + return; + + } // fi + this->m_Parameters = params; + this->m_Name = name; + + QStringList filters; + auto extensions = this->m_Parameters->GetAcceptedFileExtensions( name ); + if( extensions != "" ) + filters << extensions.c_str( ); + filters << "Any file (*)"; + this->setFileMode( QFileDialog::AnyFile ); + this->setNameFilters( filters ); + this->setAcceptMode( QFileDialog::AcceptOpen ); + auto file = this->m_Parameters->GetSaveFileName( this->m_Name ); + if( file == "" ) + file = "."; + QFileInfo info( file.c_str( ) ); + this->setDirectory( info.canonicalPath( ) ); +} + +// ------------------------------------------------------------------------- +void cpPlugins::QT::SaveFileDialog:: +_dlg_Accepted( ) +{ + if( this->m_Parameters != NULL ) + { + auto files = this->selectedFiles( ); + this->m_Parameters->SetSaveFileName( + this->m_Name, files[ 0 ].toStdString( ) + ); + + } // fi +} + +#endif // cpPlugins_QT4 + +// eof - $RCSfile$ diff --git a/lib/cpPlugins/QT/SaveFileDialog.h b/lib/cpPlugins/QT/SaveFileDialog.h new file mode 100644 index 0000000..36abd2f --- /dev/null +++ b/lib/cpPlugins/QT/SaveFileDialog.h @@ -0,0 +1,46 @@ +#ifndef __cpPlugins__QT__SaveFileDialog__h__ +#define __cpPlugins__QT__SaveFileDialog__h__ + +#include + +#ifdef cpPlugins_QT4 + +#include + +namespace cpPlugins{ namespace BaseObjects { class Parameters; } } + +namespace cpPlugins +{ + namespace QT + { + /** + */ + class SaveFileDialog + : public QFileDialog + { + Q_OBJECT; + public: + SaveFileDialog( QWidget* parent = 0 ); + virtual ~SaveFileDialog( ); + + void SetParameters( + cpPlugins::BaseObjects::Parameters* params, const std::string& name + ); + + protected slots: + void _dlg_Accepted( ); + + protected: + cpPlugins::BaseObjects::Parameters* m_Parameters; + std::string m_Name; + }; + + } // ecapseman + +} // ecapseman + +#endif // cpPlugins_QT4 + +#endif // __cpPlugins__QT__SaveFileDialog__h__ + +// eof - $RCSfile$ diff --git a/plugins/AnisotropicDiffusion/CurvatureAnisotropicDiffusionImageFilter.cxx b/plugins/AnisotropicDiffusion/CurvatureAnisotropicDiffusionImageFilter.cxx index d8ce659..ad82dc8 100644 --- a/plugins/AnisotropicDiffusion/CurvatureAnisotropicDiffusionImageFilter.cxx +++ b/plugins/AnisotropicDiffusion/CurvatureAnisotropicDiffusionImageFilter.cxx @@ -13,10 +13,10 @@ CurvatureAnisotropicDiffusionImageFilter( ) this->_ConfigureInput< _TImage >( "Input", true, false ); this->_ConfigureOutput< _TImage >( "Output" ); - this->m_Parameters.ConfigureAsUint( "NumberOfIterations" ); - this->m_Parameters.ConfigureAsBool( "UseImageSpacing" ); - this->m_Parameters.ConfigureAsReal( "ConductanceParameter" ); - this->m_Parameters.ConfigureAsReal( "TimeStep" ); + this->m_Parameters.ConfigureAsUint( "NumberOfIterations", 5 ); + this->m_Parameters.ConfigureAsBool( "UseImageSpacing", false ); + this->m_Parameters.ConfigureAsReal( "ConductanceParameter", 3 ); + this->m_Parameters.ConfigureAsReal( "TimeStep", 0.0625 ); std::vector< std::string > choices; #ifdef cpPlugins_CONFIG_REAL_TYPES_float choices.push_back( "float" ); @@ -25,11 +25,6 @@ CurvatureAnisotropicDiffusionImageFilter( ) choices.push_back( "double" ); #endif // cpPlugins_CONFIG_REAL_TYPES_double this->m_Parameters.ConfigureAsChoices( "OutputResolution", choices ); - - this->m_Parameters.SetUint( "NumberOfIterations", 5 ); - this->m_Parameters.SetBool( "UseImageSpacing", false ); - this->m_Parameters.SetReal( "ConductanceParameter", 3 ); - this->m_Parameters.SetReal( "TimeStep", 0.0625 ); } // ------------------------------------------------------------------------- diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt index fccbeca..c8223be 100644 --- a/plugins/CMakeLists.txt +++ b/plugins/CMakeLists.txt @@ -48,5 +48,11 @@ TARGET_LINK_LIBRARIES( cpPluginsImageDistanceMaps cpPluginsImageThresholdFilters ) +IF(ParabolicMorphology_LOADED) + TARGET_LINK_LIBRARIES( + cpPluginsImageParaMorphologyFilters + cpPluginsImageThresholdFilters + ) +ENDIF(ParabolicMorphology_LOADED) ## eof - $RSCfile$ diff --git a/plugins/GenericFilters/PolyLineParametricPathToSimple3DCurve.cxx b/plugins/GenericFilters/PolyLineParametricPathToSimple3DCurve.cxx index 24952b0..5271174 100644 --- a/plugins/GenericFilters/PolyLineParametricPathToSimple3DCurve.cxx +++ b/plugins/GenericFilters/PolyLineParametricPathToSimple3DCurve.cxx @@ -16,8 +16,7 @@ PolyLineParametricPathToSimple3DCurve( ) this->_ConfigureInput< _TPath >( "Input", true, false ); this->_ConfigureOutput< _TCurve >( "Output" ); - this->m_Parameters.ConfigureAsUint( "NumberOfSamples" ); - this->m_Parameters.SetUint( "NumberOfSamples", 0 ); + this->m_Parameters.ConfigureAsUint( "NumberOfSamples", 0 ); } // ------------------------------------------------------------------------- diff --git a/plugins/IO/ImageReader.cxx b/plugins/IO/ImageReader.cxx index a54a540..972ae5b 100644 --- a/plugins/IO/ImageReader.cxx +++ b/plugins/IO/ImageReader.cxx @@ -1,75 +1,13 @@ #include -#include #include +#include #include #include #include #ifdef cpPlugins_QT4 - -#include -#include - -// ------------------------------------------------------------------------- -cpPluginsIO::ImageReaderQDialog:: -ImageReaderQDialog( QWidget* parent ) - : QFileDialog( parent ), - m_ProcessObject( NULL ) -{ - this->connect( - this, SIGNAL( accepted( ) ), this, SLOT( _dlg_Accepted( ) ) - ); - this->setWindowTitle( "Open an(some) image(s)" ); -} - -// ------------------------------------------------------------------------- -cpPluginsIO::ImageReaderQDialog:: -~ImageReaderQDialog( ) -{ -} - -// ------------------------------------------------------------------------- -void cpPluginsIO::ImageReaderQDialog:: -setProcessObject( cpPlugins::BaseObjects::ProcessObject* obj ) -{ - if( obj == NULL ) - return; - this->m_ProcessObject = obj; - auto param = this->m_ProcessObject->GetParameters( ); - auto extensions = param->GetAcceptedFileExtensions( "FileNames" ); - auto files = param->GetOpenFileNameList( "FileNames" ); - - QStringList filters; - if( extensions != "" ) - filters << extensions.c_str( ); - filters << "Any file (*)"; - this->setFileMode( QFileDialog::ExistingFiles ); - this->setNameFilters( filters ); - this->setAcceptMode( QFileDialog::AcceptOpen ); - if( files.size( ) > 0 ) - { - QFileInfo info( files[ 0 ].c_str( ) ); - this->setDirectory( info.canonicalPath( ) ); - - } // fi -} - -// ------------------------------------------------------------------------- -void cpPluginsIO::ImageReaderQDialog:: -_dlg_Accepted( ) -{ - if( this->m_ProcessObject != NULL ) - { - auto param = this->m_ProcessObject->GetParameters( ); - auto files = this->selectedFiles( ); - param->ClearOpenFileNameList( "FileNames" ); - for( auto fIt = files.begin( ); fIt != files.end( ); ++fIt ) - param->AddToOpenFileNameList( "FileNames", fIt->toStdString( ) ); - - } // fi -} - +# include #endif // cpPlugins_QT4 // ------------------------------------------------------------------------- @@ -77,11 +15,11 @@ QDialog* cpPluginsIO::ImageReader:: CreateQDialog( ) { #ifdef cpPlugins_QT4 - ImageReaderQDialog* dlg = NULL; + cpPlugins::QT::OpenFileDialog* dlg = NULL; if( QApplication::instance( ) != NULL ) { - dlg = new ImageReaderQDialog( ); - dlg->setProcessObject( this ); + dlg = new cpPlugins::QT::OpenFileDialog( ); + dlg->SetParameters( &( this->m_Parameters ), "FileNames" ); } // fi return( dlg ); @@ -116,38 +54,37 @@ _GenerateData( ) { // Get filenames auto fnames = this->m_Parameters.GetOpenFileNameList( "FileNames" ); - if( fnames.size( ) >= 1 ) + if( fnames.size( ) > 1 ) { + std::stringstream fname_str; + fname_str << fnames[ 0 ] << cpPlugins_PATH_SEPARATOR << fnames[ 1 ]; + std::string fname = fname_str.str( ); + // Guess image properties itk::ImageIOBase::Pointer io = itk::ImageIOFactory::CreateImageIO( - fnames[ 0 ].c_str( ), - itk::ImageIOFactory::ReadMode + fname.c_str( ), itk::ImageIOFactory::ReadMode ); if( io.IsNotNull( ) ) { - io->SetFileName( fnames[ 0 ] ); + io->SetFileName( fname ); io->ReadImageInformation( ); - if( fnames.size( ) >= 1 ) - { - bool success = false; - unsigned int dim = io->GetNumberOfDimensions( ); + bool success = false; + unsigned int dim = io->GetNumberOfDimensions( ); #ifdef cpPlugins_CONFIG_PROCESS_DIMENSIONS_1 - if( dim == 1 ) success = this->_GD0< 1 >( io ); + if( dim == 1 ) success = this->_GD0< 1 >( io ); #endif // cpPlugins_CONFIG_PROCESS_DIMENSIONS_1 #ifdef cpPlugins_CONFIG_PROCESS_DIMENSIONS_2 - if( dim == 2 ) success = this->_GD0< 2 >( io ); + if( dim == 2 ) success = this->_GD0< 2 >( io ); #endif // cpPlugins_CONFIG_PROCESS_DIMENSIONS_2 #ifdef cpPlugins_CONFIG_PROCESS_DIMENSIONS_3 - if( dim == 3 ) success = this->_GD0< 3 >( io ); + if( dim == 3 ) success = this->_GD0< 3 >( io ); #endif // cpPlugins_CONFIG_PROCESS_DIMENSIONS_3 #ifdef cpPlugins_CONFIG_PROCESS_DIMENSIONS_4 - if( dim == 4 ) success = this->_GD0< 4 >( io ); + if( dim == 4 ) success = this->_GD0< 4 >( io ); #endif // cpPlugins_CONFIG_PROCESS_DIMENSIONS_4 - if( !success ) - this->_Error( "Image dimension not supported." ); - - } // fi + if( !success ) + this->_Error( "Image dimension not supported." ); } else this->_Error( @@ -340,10 +277,13 @@ _GD1( itk::ImageIOBase* io ) // Get filenames auto fnames = this->m_Parameters.GetOpenFileNameList( "FileNames" ); - if( fnames.size( ) == 1 ) + if( fnames.size( ) == 2 ) { + std::stringstream fname_str; + fname_str << fnames[ 0 ] << cpPlugins_PATH_SEPARATOR << fnames[ 1 ]; + auto f = this->_CreateITK< itk::ImageFileReader< _TImage > >( ); - f->SetFileName( fnames[ 0 ] ); + f->SetFileName( fname_str.str( ) ); f->SetImageIO( io ); try { @@ -361,8 +301,12 @@ _GD1( itk::ImageIOBase* io ) else // if( fnames.size( ) > 1 ) { auto f = this->_CreateITK< itk::ImageSeriesReader< _TImage > >( ); - for( auto i = fnames.begin( ); i != fnames.end( ); ++i ) - f->AddFileName( *i ); + auto i = fnames.begin( ); + std::stringstream dir; + dir << *i << cpPlugins_PATH_SEPARATOR; + i++; + for( ; i != fnames.end( ); ++i ) + f->AddFileName( dir.str( ) + *i ); f->SetImageIO( io ); try { diff --git a/plugins/IO/ImageReaderQDialog.h b/plugins/IO/ImageReaderQDialog.h deleted file mode 100644 index 80f57e1..0000000 --- a/plugins/IO/ImageReaderQDialog.h +++ /dev/null @@ -1,38 +0,0 @@ -#ifndef __cpPluginsIO__ImageReaderQDialog__h__ -#define __cpPluginsIO__ImageReaderQDialog__h__ - -#include - -#ifdef cpPlugins_QT4 - -#include - -namespace cpPlugins { namespace BaseObjects { class ProcessObject; } } - -namespace cpPluginsIO -{ - /** - */ - class ImageReaderQDialog - : public QFileDialog - { - Q_OBJECT; - public: - ImageReaderQDialog( QWidget* parent = 0 ); - virtual ~ImageReaderQDialog( ); - void setProcessObject( cpPlugins::BaseObjects::ProcessObject* obj ); - - protected slots: - void _dlg_Accepted( ); - - protected: - cpPlugins::BaseObjects::ProcessObject* m_ProcessObject; - }; - -} // ecapseman - -#endif // cpPlugins_QT4 - -#endif // __cpPluginsIO__ImageReaderQDialog__h__ - -// eof - $RCSfile$ diff --git a/plugins/IO/ImageWriter.cxx b/plugins/IO/ImageWriter.cxx index 8fcf08e..c5aa3df 100644 --- a/plugins/IO/ImageWriter.cxx +++ b/plugins/IO/ImageWriter.cxx @@ -1,78 +1,13 @@ #include -#include #include #include +#include #include #include #ifdef cpPlugins_QT4 - -#include -#include - -// ------------------------------------------------------------------------- -cpPluginsIO::ImageWriterQDialog:: -ImageWriterQDialog( QWidget* parent ) - : QFileDialog( parent ), - m_ProcessObject( NULL ) -{ - this->connect( - this, SIGNAL( accepted( ) ), this, SLOT( _dlg_Accepted( ) ) - ); - this->setWindowTitle( "Save an image" ); -} - -// ------------------------------------------------------------------------- -cpPluginsIO::ImageWriterQDialog:: -~ImageWriterQDialog( ) -{ -} - -// ------------------------------------------------------------------------- -void cpPluginsIO::ImageWriterQDialog:: -setProcessObject( cpPlugins::BaseObjects::ProcessObject* obj ) -{ - if( obj == NULL ) - return; - this->m_ProcessObject = obj; - auto parameters = this->m_ProcessObject->GetParameters( ); - auto extensions = parameters->GetAcceptedFileExtensions( "FileName" ); - auto filename = parameters->GetSaveFileName( "FileName" ); - - QStringList filters; - if( extensions != "" ) - filters << extensions.c_str( ); - filters << "Any file (*)"; - this->setFileMode( QFileDialog::AnyFile ); - this->setNameFilters( filters ); - this->setAcceptMode( QFileDialog::AcceptSave ); - if( filename != "" ) - { - QFileInfo info( filename.c_str( ) ); - if( info.exists( ) ) - this->setDirectory( info.canonicalPath( ) ); - else - this->setDirectory( "." ); - } - else - this->setDirectory( "." ); -} - -// ------------------------------------------------------------------------- -void cpPluginsIO::ImageWriterQDialog:: -_dlg_Accepted( ) -{ - if( this->m_ProcessObject != NULL ) - { - auto param = this->m_ProcessObject->GetParameters( ); - auto files = this->selectedFiles( ); - if( files.size( ) > 0 ) - param->SetSaveFileName( "FileName", files.begin( )->toStdString( ) ); - - } // fi -} - +# include #endif // cpPlugins_QT4 // ------------------------------------------------------------------------- @@ -80,11 +15,11 @@ QDialog* cpPluginsIO::ImageWriter:: CreateQDialog( ) { #ifdef cpPlugins_QT4 - ImageWriterQDialog* dlg = NULL; + cpPlugins::QT::SaveFileDialog* dlg = NULL; if( QApplication::instance( ) != NULL ) { - dlg = new ImageWriterQDialog( ); - dlg->setProcessObject( this ); + dlg = new cpPlugins::QT::SaveFileDialog( ); + dlg->SetParameters( &( this->m_Parameters ), "FileName" ); } // fi return( dlg ); @@ -100,7 +35,7 @@ ImageWriter( ) { this->_ConfigureInput< cpPlugins::DataObjects::Image >( "Input", true, false ); this->m_Parameters.Clear( ); - this->m_Parameters.ConfigureAsSaveFileName( "FileName" ); + this->m_Parameters.ConfigureAsSaveFileName( "FileName", "" ); this->m_Parameters.SetAcceptedFileExtensions( "FileName", "Image files (*.bmp *.png *.jpg *.jpeg *.dcm *.mhd *.nhdr *.nrrd *.tiff)" diff --git a/plugins/IO/ImageWriterQDialog.h b/plugins/IO/ImageWriterQDialog.h deleted file mode 100644 index c1f1400..0000000 --- a/plugins/IO/ImageWriterQDialog.h +++ /dev/null @@ -1,38 +0,0 @@ -#ifndef __cpPluginsIO__ImageWriterQDialog__h__ -#define __cpPluginsIO__ImageWriterQDialog__h__ - -#include - -#ifdef cpPlugins_QT4 - -#include - -namespace cpPlugins { namespace BaseObjects { class ProcessObject; } } - -namespace cpPluginsIO -{ - /** - */ - class ImageWriterQDialog - : public QFileDialog - { - Q_OBJECT; - public: - ImageWriterQDialog( QWidget* parent = 0 ); - virtual ~ImageWriterQDialog( ); - void setProcessObject( cpPlugins::BaseObjects::ProcessObject* obj ); - - protected slots: - void _dlg_Accepted( ); - - protected: - cpPlugins::BaseObjects::ProcessObject* m_ProcessObject; - }; - -} // ecapseman - -#endif // cpPlugins_QT4 - -#endif // __cpPluginsIO__ImageWriterQDialog__h__ - -// eof - $RCSfile$ diff --git a/plugins/IO/MeshWriter.cxx b/plugins/IO/MeshWriter.cxx index 986eebb..8bb075e 100644 --- a/plugins/IO/MeshWriter.cxx +++ b/plugins/IO/MeshWriter.cxx @@ -1,9 +1,32 @@ #include #include +#include #include #include +#ifdef cpPlugins_QT4 +# include +#endif // cpPlugins_QT4 + +// ------------------------------------------------------------------------- +QDialog* cpPluginsIO::MeshWriter:: +CreateQDialog( ) +{ +#ifdef cpPlugins_QT4 + cpPlugins::QT::SaveFileDialog* dlg = NULL; + if( QApplication::instance( ) != NULL ) + { + dlg = new cpPlugins::QT::SaveFileDialog( ); + dlg->SetParameters( &( this->m_Parameters ), "FileName" ); + + } // fi + return( dlg ); +#else // cpPlugins_QT4 + return( NULL ); +#endif // cpPlugins_QT4 +} + // ------------------------------------------------------------------------- cpPluginsIO::MeshWriter:: MeshWriter( ) @@ -13,7 +36,7 @@ MeshWriter( ) this->_ConfigureInput< _TMesh >( "Input", true, false ); this->m_Parameters.Clear( ); - this->m_Parameters.ConfigureAsSaveFileName( "FileName" ); + this->m_Parameters.ConfigureAsSaveFileName( "FileName", "" ); this->m_Parameters.SetAcceptedFileExtensions( "FileName", "Mesh files (*.vtk)" diff --git a/plugins/IO/MeshWriter.h b/plugins/IO/MeshWriter.h index 8b8b59f..ba17022 100644 --- a/plugins/IO/MeshWriter.h +++ b/plugins/IO/MeshWriter.h @@ -12,6 +12,9 @@ namespace cpPluginsIO : public cpPlugins::BaseObjects::ProcessObject { cpPluginsObject( MeshWriter, cpPlugins::BaseObjects::ProcessObject, IO ); + + public: + virtual QDialog* CreateQDialog( ) cpPlugins_OVERRIDE; }; } // ecapseman diff --git a/plugins/ImageArithmeticFilters/PowImageFilter.cxx b/plugins/ImageArithmeticFilters/PowImageFilter.cxx index 62c2a85..74ef30d 100644 --- a/plugins/ImageArithmeticFilters/PowImageFilter.cxx +++ b/plugins/ImageArithmeticFilters/PowImageFilter.cxx @@ -14,8 +14,7 @@ PowImageFilter( ) this->_ConfigureInput< _TImage >( "Input2", true, false ); this->_ConfigureOutput< _TImage >( "Output" ); - this->m_Parameters.ConfigureAsReal( "Constant" ); - this->m_Parameters.SetReal( "Constant", 1 ); + this->m_Parameters.ConfigureAsReal( "Constant", 1 ); } // ------------------------------------------------------------------------- diff --git a/plugins/ImageDistanceMaps/BinaryContourImageFilter.cxx b/plugins/ImageDistanceMaps/BinaryContourImageFilter.cxx index ade2580..e9b9c0a 100644 --- a/plugins/ImageDistanceMaps/BinaryContourImageFilter.cxx +++ b/plugins/ImageDistanceMaps/BinaryContourImageFilter.cxx @@ -14,13 +14,9 @@ BinaryContourImageFilter( ) this->_ConfigureInput< _TImage >( "Input", true, false ); this->_ConfigureOutput< _TImage >( "Output" ); - this->m_Parameters.ConfigureAsReal( "BackgroundValue" ); - this->m_Parameters.ConfigureAsReal( "ForegroundValue" ); - this->m_Parameters.ConfigureAsBool( "FullyConnected" ); - - this->m_Parameters.SetReal( "BackgroundValue", 0 ); - this->m_Parameters.SetReal( "ForegroundValue", 1 ); - this->m_Parameters.SetBool( "FullyConnected", false ); + this->m_Parameters.ConfigureAsReal( "BackgroundValue", 0 ); + this->m_Parameters.ConfigureAsReal( "ForegroundValue", 1 ); + this->m_Parameters.ConfigureAsBool( "FullyConnected", false ); } // ------------------------------------------------------------------------- diff --git a/plugins/ImageDistanceMaps/SignedMaurerDistanceMapImageFilter.cxx b/plugins/ImageDistanceMaps/SignedMaurerDistanceMapImageFilter.cxx index 5a7a033..237e15a 100644 --- a/plugins/ImageDistanceMaps/SignedMaurerDistanceMapImageFilter.cxx +++ b/plugins/ImageDistanceMaps/SignedMaurerDistanceMapImageFilter.cxx @@ -14,10 +14,10 @@ SignedMaurerDistanceMapImageFilter( ) this->_ConfigureInput< _TImage >( "Input", true, false ); this->_ConfigureOutput< _TImage >( "Output" ); - this->m_Parameters.ConfigureAsReal( "BackgroundValue" ); - this->m_Parameters.ConfigureAsBool( "InsideIsPositive" ); - this->m_Parameters.ConfigureAsBool( "SquaredDistance" ); - this->m_Parameters.ConfigureAsBool( "UseImageSpacing" ); + this->m_Parameters.ConfigureAsReal( "BackgroundValue", 0 ); + this->m_Parameters.ConfigureAsBool( "InsideIsPositive", true ); + this->m_Parameters.ConfigureAsBool( "SquaredDistance", false ); + this->m_Parameters.ConfigureAsBool( "UseImageSpacing", true ); std::vector< std::string > choices; #ifdef cpPlugins_CONFIG_REAL_TYPES_float @@ -27,11 +27,6 @@ SignedMaurerDistanceMapImageFilter( ) choices.push_back( "double" ); #endif // cpPlugins_CONFIG_REAL_TYPES_double this->m_Parameters.ConfigureAsChoices( "OutputResolution", choices ); - - this->m_Parameters.SetReal( "BackgroundValue", 0 ); - this->m_Parameters.SetBool( "InsideIsPositive", true ); - this->m_Parameters.SetBool( "SquaredDistance", false ); - this->m_Parameters.SetBool( "UseImageSpacing", true ); } // ------------------------------------------------------------------------- diff --git a/plugins/ImageGenericFilters/RescaleIntensityImageFilter.cxx b/plugins/ImageGenericFilters/RescaleIntensityImageFilter.cxx index 38681d9..a484a62 100644 --- a/plugins/ImageGenericFilters/RescaleIntensityImageFilter.cxx +++ b/plugins/ImageGenericFilters/RescaleIntensityImageFilter.cxx @@ -13,11 +13,8 @@ RescaleIntensityImageFilter( ) this->_ConfigureInput< _TImage >( "Input", true, false ); this->_ConfigureOutput< _TImage >( "Output" ); - this->m_Parameters.ConfigureAsReal( "OutputMinimum" ); - this->m_Parameters.ConfigureAsReal( "OutputMaximum" ); - - this->m_Parameters.SetReal( "OutputMinimum", 0 ); - this->m_Parameters.SetReal( "OutputMaximum", 1 ); + this->m_Parameters.ConfigureAsReal( "OutputMinimum", 0 ); + this->m_Parameters.ConfigureAsReal( "OutputMaximum", 1 ); } // ------------------------------------------------------------------------- diff --git a/plugins/ImageGradientFilters/FluxImageFilter.cxx b/plugins/ImageGradientFilters/FluxImageFilter.cxx index 8231a82..8aa7dd6 100644 --- a/plugins/ImageGradientFilters/FluxImageFilter.cxx +++ b/plugins/ImageGradientFilters/FluxImageFilter.cxx @@ -2,15 +2,8 @@ #include #include -/* TODO - #include - #include - - #include - #include - #include - #include -*/ +#include +#include // ------------------------------------------------------------------------- cpPluginsImageGradientFilters::FluxImageFilter:: @@ -22,15 +15,10 @@ FluxImageFilter( ) this->_ConfigureInput< _TImage >( "Mask", false, false ); this->_ConfigureOutput< _TImage >( "Output" ); - this->m_Parameters.ConfigureAsReal( "MinRadius" ); - this->m_Parameters.ConfigureAsReal( "MaxRadius" ); - this->m_Parameters.ConfigureAsReal( "RadiusStep" ); - this->m_Parameters.ConfigureAsUint( "RadialSampling" ); - - this->m_Parameters.SetReal( "MinRadius", 0 ); - this->m_Parameters.SetReal( "MaxRadius", 1 ); - this->m_Parameters.SetReal( "RadiusStep", 1 ); - this->m_Parameters.SetUint( "RadialSampling", 4 ); + this->m_Parameters.ConfigureAsReal( "MinRadius", 0 ); + this->m_Parameters.ConfigureAsReal( "MaxRadius", 1 ); + this->m_Parameters.ConfigureAsReal( "RadiusStep", 1 ); + this->m_Parameters.ConfigureAsUint( "RadialSampling", 4 ); } // ------------------------------------------------------------------------- @@ -43,11 +31,9 @@ cpPluginsImageGradientFilters::FluxImageFilter:: void cpPluginsImageGradientFilters::FluxImageFilter:: _GenerateData( ) { - /* TODO - auto o = this->GetInputData( "Input" ); - cpPlugins_Demangle_ImageCovariantVectors_Dims( o, _GD0 ); - else this->_Error( "Invalid input image." ); - */ + auto o = this->GetInputData( "Input" ); + cpPlugins_Demangle_Image_CovariantVectorPixels_AllDims_1( o, _GD0 ) + this->_Error( "Invalid input image." ); } // ------------------------------------------------------------------------- @@ -55,29 +41,27 @@ template< class _TImage > void cpPluginsImageGradientFilters::FluxImageFilter:: _GD0( _TImage* image ) { - /* TODO - typedef typename _TImage::PixelType _TGradient; - typedef cpExtensions::Algorithms::FluxMedialness< _TImage > _TFunction; - typedef typename _TFunction::TOutput _TScalar; - typedef itk::Image< _TScalar, _TImage::ImageDimension > _TOutputImage; - typedef cpExtensions::Algorithms::ImageFunctionFilter< _TImage, _TOutputImage, _TFunction > _TFilter; + typedef typename _TImage::PixelType _TGradient; + typedef cpExtensions::Algorithms::FluxMedialness< _TImage > _TFunction; + typedef typename _TFunction::TOutput _TScalar; + typedef itk::Image< _TScalar, _TImage::ImageDimension > _TOutputImage; + typedef cpExtensions::Algorithms::ImageFunctionFilter< _TImage, _TOutputImage, _TFunction > _TFilter; - auto filter = this->_CreateITK< _TFilter >( ); - auto function = filter->GetFunction( ); - if( function == NULL ) - { - filter->SetFunction( _TFunction::New( ) ); - function = filter->GetFunction( ); + auto filter = this->_CreateITK< _TFilter >( ); + auto function = filter->GetFunction( ); + if( function == NULL ) + { + filter->SetFunction( _TFunction::New( ) ); + function = filter->GetFunction( ); - } // fi - function->SetMinRadius( this->m_Parameters.GetReal( "MinRadius" ) ); - function->SetMaxRadius( this->m_Parameters.GetReal( "MaxRadius" ) ); - function->SetRadiusStep( this->m_Parameters.GetReal( "RadiusStep" ) ); - function->SetRadialSampling( this->m_Parameters.GetUint( "RadialSampling" ) ); - filter->SetInput( image ); - filter->Update( ); - this->GetOutput( "Output" )->SetITK( filter->GetOutput( ) ); - */ + } // fi + function->SetMinRadius( this->m_Parameters.GetReal( "MinRadius" ) ); + function->SetMaxRadius( this->m_Parameters.GetReal( "MaxRadius" ) ); + function->SetRadiusStep( this->m_Parameters.GetReal( "RadiusStep" ) ); + function->SetRadialSampling( this->m_Parameters.GetUint( "RadialSampling" ) ); + filter->SetInput( image ); + filter->Update( ); + this->GetOutput( "Output" )->SetITK( filter->GetOutput( ) ); } // eof - $RCSfile$ diff --git a/plugins/ImageGradientFilters/GulsunTekImageFilter.cxx b/plugins/ImageGradientFilters/GulsunTekImageFilter.cxx index 4c46897..089b6d5 100644 --- a/plugins/ImageGradientFilters/GulsunTekImageFilter.cxx +++ b/plugins/ImageGradientFilters/GulsunTekImageFilter.cxx @@ -1,16 +1,9 @@ #include #include #include - -/* TODO - #include - #include - #include - #include - #include - #include -*/ +#include +#include // ------------------------------------------------------------------------- cpPluginsImageGradientFilters::GulsunTekImageFilter:: @@ -23,15 +16,10 @@ GulsunTekImageFilter( ) this->_ConfigureInput< _TImage >( "Mask", false, false ); this->_ConfigureOutput< _TImage >( "Output" ); - this->m_Parameters.ConfigureAsReal( "MinRadius" ); - this->m_Parameters.ConfigureAsReal( "MaxRadius" ); - this->m_Parameters.ConfigureAsUint( "ProfileSampling" ); - this->m_Parameters.ConfigureAsUint( "RadialSampling" ); - - this->m_Parameters.SetReal( "MinRadius", 0 ); - this->m_Parameters.SetReal( "MaxRadius", 1 ); - this->m_Parameters.SetUint( "ProfileSampling", 4 ); - this->m_Parameters.SetUint( "RadialSampling", 10 ); + this->m_Parameters.ConfigureAsReal( "MinRadius", 0 ); + this->m_Parameters.ConfigureAsReal( "MaxRadius", 1 ); + this->m_Parameters.ConfigureAsUint( "ProfileSampling", 4 ); + this->m_Parameters.ConfigureAsUint( "RadialSampling", 10 ); } // ------------------------------------------------------------------------- @@ -44,11 +32,9 @@ cpPluginsImageGradientFilters::GulsunTekImageFilter:: void cpPluginsImageGradientFilters::GulsunTekImageFilter:: _GenerateData( ) { - /* TODO - auto o = this->GetInputData( "Input" ); - cpPlugins_Demangle_ImageCovariantVectors_Dims( o, _GD0 ); - else this->_Error( "Invalid input image." ); - */ + auto o = this->GetInputData( "Input" ); + cpPlugins_Demangle_Image_CovariantVectorPixels_AllDims_1( o, _GD0 ) + this->_Error( "Invalid input image." ); } // ------------------------------------------------------------------------- @@ -56,73 +42,41 @@ template< class _TImage > void cpPluginsImageGradientFilters::GulsunTekImageFilter:: _GD0( _TImage* image ) { - /* TODO - typedef itk::Image< char, _TImage::ImageDimension > _TChar; - typedef itk::Image< short, _TImage::ImageDimension > _TShort; - typedef itk::Image< int, _TImage::ImageDimension > _TInt; - typedef itk::Image< long, _TImage::ImageDimension > _TLong; - typedef itk::Image< float, _TImage::ImageDimension > _TFloat; - typedef itk::Image< double, _TImage::ImageDimension > _TDouble; - typedef itk::Image< unsigned char, _TImage::ImageDimension > _TUChar; - typedef itk::Image< unsigned short, _TImage::ImageDimension > _TUShort; - typedef itk::Image< unsigned int, _TImage::ImageDimension > _TUInt; - typedef itk::Image< unsigned long, _TImage::ImageDimension > _TULong; + typedef itk::Image< bool, _TImage::ImageDimension > _TDummy; - auto m = this->GetInput( "Mask" ); - auto ci = m->GetITK< _TChar >( ); - auto si = m->GetITK< _TShort >( ); - auto ii = m->GetITK< _TInt >( ); - auto li = m->GetITK< _TLong >( ); - auto fi = m->GetITK< _TFloat >( ); - auto di = m->GetITK< _TDouble >( ); - auto uci = m->GetITK< _TUChar >( ); - auto usi = m->GetITK< _TUShort >( ); - auto uii = m->GetITK< _TUInt >( ); - auto uli = m->GetITK< _TULong >( ); - if ( ci != NULL ) this->_GD1( image, ci ); - else if( si != NULL ) this->_GD1( image, si ); - else if( ii != NULL ) this->_GD1( image, ii ); - else if( li != NULL ) this->_GD1( image, li ); - else if( fi != NULL ) this->_GD1( image, fi ); - else if( di != NULL ) this->_GD1( image, di ); - else if( uci != NULL ) this->_GD1( image, uci ); - else if( usi != NULL ) this->_GD1( image, usi ); - else if( uii != NULL ) this->_GD1( image, uii ); - else if( uli != NULL ) this->_GD1( image, uli ); - else this->_GD1( image, ci ); - */ + auto o = this->GetInputData( "Mask" ); + cpPlugins_Demangle_Image_ScalarPixels_2( o, _GD1, _TImage::ImageDimension, image ) + this->_GD1< _TDummy, _TImage >( NULL, image ); } // ------------------------------------------------------------------------- -template< class _TImage, class _TMask > +template< class _TMask, class _TImage > void cpPluginsImageGradientFilters::GulsunTekImageFilter:: -_GD1( _TImage* image, _TMask* mask ) +_GD1( _TMask* mask, _TImage* image ) { - /* TODO - typedef typename _TImage::PixelType _TGradient; - typedef cpExtensions::Algorithms::GulsunTekMedialness< _TImage, _TMask > _TFunction; - typedef typename _TFunction::TOutput _TScalar; - typedef itk::Image< _TScalar, _TImage::ImageDimension > _TOutputImage; - typedef cpExtensions::Algorithms::ImageFunctionFilter< _TImage, _TOutputImage, _TFunction > _TFilter; + typedef typename _TImage::PixelType _TGradient; + typedef cpExtensions::Algorithms::GulsunTekMedialness< _TImage, _TMask > _TFunction; + typedef typename _TFunction::TOutput _TScalar; + typedef itk::Image< _TScalar, _TImage::ImageDimension > _TOutputImage; + typedef cpExtensions::Algorithms::ImageFunctionFilter< _TImage, _TOutputImage, _TFunction > _TFilter; - auto filter = this->_CreateITK< _TFilter >( ); - auto function = filter->GetFunction( ); - if( function == NULL ) - { - filter->SetFunction( _TFunction::New( ) ); - function = filter->GetFunction( ); + auto filter = this->_CreateITK< _TFilter >( ); + auto function = filter->GetFunction( ); + if( function == NULL ) + { + filter->SetFunction( _TFunction::New( ) ); + function = filter->GetFunction( ); - } // fi - function->SetMinRadius( this->m_Parameters.GetReal( "MinRadius" ) ); - function->SetMaxRadius( this->m_Parameters.GetReal( "MaxRadius" ) ); - function->SetProfileSampling( this->m_Parameters.GetUint( "ProfileSampling" ) ); - function->SetRadialSampling( this->m_Parameters.GetUint( "RadialSampling" ) ); - filter->SetInput( image ); - if( mask != NULL ) - function->SetMask( mask ); - filter->Update( ); - this->GetOutput( "Output" )->SetITK( filter->GetOutput( ) ); - */ + } // fi + function->SetMinRadius( this->m_Parameters.GetReal( "MinRadius" ) ); + function->SetMaxRadius( this->m_Parameters.GetReal( "MaxRadius" ) ); + function->SetProfileSampling( this->m_Parameters.GetUint( "ProfileSampling" ) ); + function->SetRadialSampling( this->m_Parameters.GetUint( "RadialSampling" ) ); + filter->SetInput( image ); + if( mask != NULL ) + function->SetMask( mask ); + filter->Update( ); + this->GetOutput( "Output" )->SetITK( filter->GetOutput( ) ); } // eof - $RCSfile$ diff --git a/plugins/ImageGradientFilters/GulsunTekImageFilter.h b/plugins/ImageGradientFilters/GulsunTekImageFilter.h index e48623c..6242a4c 100644 --- a/plugins/ImageGradientFilters/GulsunTekImageFilter.h +++ b/plugins/ImageGradientFilters/GulsunTekImageFilter.h @@ -21,8 +21,8 @@ namespace cpPluginsImageGradientFilters template< class _TImage > inline void _GD0( _TImage* image ); - template< class _TImage, class _TMask > - inline void _GD1( _TImage* image, _TMask* mask ); + template< class _TMask, class _TImage > + inline void _GD1( _TMask* mask, _TImage* image ); }; } // ecapseman diff --git a/plugins/ImageGradientFilters/ImageGradientFilters.i b/plugins/ImageGradientFilters/ImageGradientFilters.i new file mode 100644 index 0000000..95bff3a --- /dev/null +++ b/plugins/ImageGradientFilters/ImageGradientFilters.i @@ -0,0 +1,30 @@ +header #define ITK_MANUAL_INSTANTIATION + +define funcs=GulsunTekMedialness;FluxMedialness;MFluxMedialness +define all_funcs=GradientImageFunctionBase;#funcs# +define itk_filters=RecursiveGaussianImageFilter;GradientRecursiveGaussianImageFilter + +tinclude itk#itk_filters#:h|hxx +tinclude cpExtensions/Algorithms/#all_funcs#:h|hxx +tinclude cpExtensions/Algorithms/ImageFunctionFilter:h|hxx +tinclude cpExtensions/Algorithms/MultiScaleGaussianImageFilter:h|hxx + +cinclude itkImageAdaptor.hxx +cinclude itkImageFunction.hxx +cinclude itkImageConstIteratorWithIndex.hxx +cinclude itkUnaryFunctorImageFilter.hxx +cinclude itkBinaryFunctorImageFilter.hxx +cinclude itkImageRegionIteratorWithIndex.hxx +cinclude itkImageRegionConstIteratorWithIndex.hxx +cinclude itkSimpleDataObjectDecorator.hxx + +instances itk::RecursiveGaussianImageFilter< itk::Image< #scalar_pixels#, #process_dims# >, itk::Image< #real_types#, #process_dims# > > +instances itk::GradientRecursiveGaussianImageFilter< itk::Image< #scalar_pixels#, #process_dims# >, itk::Image< itk::CovariantVector< #real_types#, #process_dims# >, #process_dims# > > + +instances cpExtensions::Algorithms::#all_funcs#< itk::Image< itk::CovariantVector< #real_types#, #process_dims# >, #process_dims# >, itk::Image< #scalar_pixels#, #process_dims# > > + +instances cpExtensions::Algorithms::ImageFunctionFilter< itk::Image< itk::CovariantVector< #real_types#, #process_dims# >, #process_dims# >, itk::Image< #real_types#, #process_dims# >, cpExtensions::Algorithms::#funcs#< itk::Image< itk::CovariantVector< #real_types#, #process_dims# >, #process_dims# >, itk::Image< #scalar_pixels#, #process_dims# > > > + +instances cpExtensions::Algorithms::MultiScaleGaussianImageFilter< itk::Image< #scalar_pixels#, #process_dims# >, itk::Image< itk::CovariantVector< #real_types#, #process_dims# >, #process_dims# > > + +** eof - $RCSfile$ diff --git a/plugins/ImageGradientFilters/MFluxImageFilter.cxx b/plugins/ImageGradientFilters/MFluxImageFilter.cxx index 8575a59..657cd1e 100644 --- a/plugins/ImageGradientFilters/MFluxImageFilter.cxx +++ b/plugins/ImageGradientFilters/MFluxImageFilter.cxx @@ -2,15 +2,8 @@ #include #include -/* TODO - #include - #include - - #include - #include - #include - #include -*/ +#include +#include // ------------------------------------------------------------------------- cpPluginsImageGradientFilters::MFluxImageFilter:: @@ -22,15 +15,10 @@ MFluxImageFilter( ) this->_ConfigureInput< _TImage >( "Mask", false, false ); this->_ConfigureOutput< _TImage >( "Output" ); - this->m_Parameters.ConfigureAsReal( "MinRadius" ); - this->m_Parameters.ConfigureAsReal( "MaxRadius" ); - this->m_Parameters.ConfigureAsReal( "RadiusStep" ); - this->m_Parameters.ConfigureAsUint( "RadialSampling" ); - - this->m_Parameters.SetReal( "MinRadius", 0 ); - this->m_Parameters.SetReal( "MaxRadius", 1 ); - this->m_Parameters.SetReal( "RadiusStep", 1 ); - this->m_Parameters.SetUint( "RadialSampling", 4 ); + this->m_Parameters.ConfigureAsReal( "MinRadius", 0 ); + this->m_Parameters.ConfigureAsReal( "MaxRadius", 1 ); + this->m_Parameters.ConfigureAsReal( "RadiusStep", 1 ); + this->m_Parameters.ConfigureAsUint( "RadialSampling", 4 ); } // ------------------------------------------------------------------------- @@ -43,11 +31,9 @@ cpPluginsImageGradientFilters::MFluxImageFilter:: void cpPluginsImageGradientFilters::MFluxImageFilter:: _GenerateData( ) { - /* TODO - auto o = this->GetInputData( "Input" ); - cpPlugins_Demangle_ImageCovariantVectors_Dims( o, _GD0 ); - else this->_Error( "Invalid input image." ); - */ + auto o = this->GetInputData( "Input" ); + cpPlugins_Demangle_Image_CovariantVectorPixels_AllDims_1( o, _GD0 ) + this->_Error( "Invalid input image." ); } // ------------------------------------------------------------------------- @@ -55,29 +41,27 @@ template< class _TImage > void cpPluginsImageGradientFilters::MFluxImageFilter:: _GD0( _TImage* image ) { - /* TODO - typedef typename _TImage::PixelType _TGradient; - typedef cpExtensions::Algorithms::MFluxMedialness< _TImage > _TFunction; - typedef typename _TFunction::TOutput _TScalar; - typedef itk::Image< _TScalar, _TImage::ImageDimension > _TOutputImage; - typedef cpExtensions::Algorithms::ImageFunctionFilter< _TImage, _TOutputImage, _TFunction > _TFilter; + typedef typename _TImage::PixelType _TGradient; + typedef cpExtensions::Algorithms::MFluxMedialness< _TImage > _TFunction; + typedef typename _TFunction::TOutput _TScalar; + typedef itk::Image< _TScalar, _TImage::ImageDimension > _TOutputImage; + typedef cpExtensions::Algorithms::ImageFunctionFilter< _TImage, _TOutputImage, _TFunction > _TFilter; - auto filter = this->_CreateITK< _TFilter >( ); - auto function = filter->GetFunction( ); - if( function == NULL ) - { - filter->SetFunction( _TFunction::New( ) ); - function = filter->GetFunction( ); + auto filter = this->_CreateITK< _TFilter >( ); + auto function = filter->GetFunction( ); + if( function == NULL ) + { + filter->SetFunction( _TFunction::New( ) ); + function = filter->GetFunction( ); - } // fi - function->SetMinRadius( this->m_Parameters.GetReal( "MinRadius" ) ); - function->SetMaxRadius( this->m_Parameters.GetReal( "MaxRadius" ) ); - function->SetRadiusStep( this->m_Parameters.GetReal( "RadiusStep" ) ); - function->SetRadialSampling( this->m_Parameters.GetUint( "RadialSampling" ) ); - filter->SetInput( image ); - filter->Update( ); - this->GetOutput( "Output" )->SetITK( filter->GetOutput( ) ); - */ + } // fi + function->SetMinRadius( this->m_Parameters.GetReal( "MinRadius" ) ); + function->SetMaxRadius( this->m_Parameters.GetReal( "MaxRadius" ) ); + function->SetRadiusStep( this->m_Parameters.GetReal( "RadiusStep" ) ); + function->SetRadialSampling( this->m_Parameters.GetUint( "RadialSampling" ) ); + filter->SetInput( image ); + filter->Update( ); + this->GetOutput( "Output" )->SetITK( filter->GetOutput( ) ); } // eof - $RCSfile$ diff --git a/plugins/ImageGradientFilters/MultiScaleGaussianImageFilter.cxx b/plugins/ImageGradientFilters/MultiScaleGaussianImageFilter.cxx index d4e74e8..b3b4565 100644 --- a/plugins/ImageGradientFilters/MultiScaleGaussianImageFilter.cxx +++ b/plugins/ImageGradientFilters/MultiScaleGaussianImageFilter.cxx @@ -4,20 +4,6 @@ #include -/* TODO - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include -*/ - // ------------------------------------------------------------------------- cpPluginsImageGradientFilters::MultiScaleGaussianImageFilter:: MultiScaleGaussianImageFilter( ) diff --git a/plugins/ImageMeshFilters/RasterMeshFilter.cxx b/plugins/ImageMeshFilters/RasterMeshFilter.cxx index 20a6769..f2226db 100644 --- a/plugins/ImageMeshFilters/RasterMeshFilter.cxx +++ b/plugins/ImageMeshFilters/RasterMeshFilter.cxx @@ -18,13 +18,9 @@ RasterMeshFilter( ) this->_ConfigureInput< _TDataObject >( "Template", false, false ); this->_ConfigureOutput< _TImage >( "Output" ); - this->m_Parameters.ConfigureAsUint( "InsideValue" ); - this->m_Parameters.ConfigureAsUint( "OutsideValue" ); - this->m_Parameters.ConfigureAsUint( "MinimumSize" ); - - this->m_Parameters.SetUint( "InsideValue", 1 ); - this->m_Parameters.SetUint( "OutsideValue", 0 ); - this->m_Parameters.SetUint( "MinimumSize", 100 ); + this->m_Parameters.ConfigureAsUint( "InsideValue", 1 ); + this->m_Parameters.ConfigureAsUint( "OutsideValue", 0 ); + this->m_Parameters.ConfigureAsUint( "MinimumSize", 100 ); } // ------------------------------------------------------------------------- diff --git a/plugins/ImageParaMorphologyFilters/BinaryDilateParaImageFilter.cxx b/plugins/ImageParaMorphologyFilters/BinaryDilateParaImageFilter.cxx index 3f11eae..17dedfd 100644 --- a/plugins/ImageParaMorphologyFilters/BinaryDilateParaImageFilter.cxx +++ b/plugins/ImageParaMorphologyFilters/BinaryDilateParaImageFilter.cxx @@ -1,13 +1,8 @@ #include #include +#include -/* TODO - #include - #include - #include - #include - #include -*/ +#include // ------------------------------------------------------------------------- cpPluginsImageParaMorphologyFilters::BinaryDilateParaImageFilter:: @@ -18,13 +13,9 @@ BinaryDilateParaImageFilter( ) this->_ConfigureInput< _TImage >( "Input", true, false ); this->_ConfigureOutput< _TImage >( "Output" ); - this->m_Parameters.ConfigureAsReal( "Radius" ); - this->m_Parameters.ConfigureAsBool( "Circular" ); - this->m_Parameters.ConfigureAsBool( "UseImageSpacing" ); - - this->m_Parameters.SetReal( "Radius", 3 ); - this->m_Parameters.SetBool( "Circular", true ); - this->m_Parameters.SetBool( "UseImageSpacing", false ); + this->m_Parameters.ConfigureAsReal( "Radius", 3 ); + this->m_Parameters.ConfigureAsBool( "Circular", true ); + this->m_Parameters.ConfigureAsBool( "UseImageSpacing", false ); } // ------------------------------------------------------------------------- @@ -37,11 +28,9 @@ cpPluginsImageParaMorphologyFilters::BinaryDilateParaImageFilter:: void cpPluginsImageParaMorphologyFilters::BinaryDilateParaImageFilter:: _GenerateData( ) { - /* TODO - auto o = this->GetInputData( "Input" ); - cpPlugins_Demangle_ImageScalars_Dims( o, _GD0 ); - else this->_Error( "No valid input image." ); - */ + auto o = this->GetInputData( "Input" ); + cpPlugins_Demangle_Image_ScalarPixels_AllDims_1( o, _GD0 ) + this->_Error( "No valid input image." ); } // ------------------------------------------------------------------------- @@ -49,17 +38,15 @@ template< class _TImage > void cpPluginsImageParaMorphologyFilters::BinaryDilateParaImageFilter:: _GD0( _TImage* image ) { - /* TODO - typedef itk::BinaryDilateParaImageFilter< _TImage > _TFilter; - - auto filter = this->_CreateITK< _TFilter >( ); - filter->SetInput( image ); - filter->SetRadius( this->m_Parameters.GetReal( "Radius" ) ); - filter->SetCircular( this->m_Parameters.GetBool( "Circular" ) ); - filter->SetUseImageSpacing( this->m_Parameters.GetBool( "UseImageSpacing" ) ); - filter->Update( ); - this->GetOutput( "Output" )->SetITK( filter->GetOutput( ) ); - */ + typedef itk::BinaryDilateParaImageFilter< _TImage > _TFilter; + + auto filter = this->_CreateITK< _TFilter >( ); + filter->SetInput( image ); + filter->SetRadius( this->m_Parameters.GetReal( "Radius" ) ); + filter->SetCircular( this->m_Parameters.GetBool( "Circular" ) ); + filter->SetUseImageSpacing( this->m_Parameters.GetBool( "UseImageSpacing" ) ); + filter->Update( ); + this->GetOutput( "Output" )->SetITK( filter->GetOutput( ) ); } // eof - $RCSfile$ diff --git a/plugins/ImageParaMorphologyFilters/BinaryErodeParaImageFilter.cxx b/plugins/ImageParaMorphologyFilters/BinaryErodeParaImageFilter.cxx index c123e19..349e84c 100644 --- a/plugins/ImageParaMorphologyFilters/BinaryErodeParaImageFilter.cxx +++ b/plugins/ImageParaMorphologyFilters/BinaryErodeParaImageFilter.cxx @@ -1,13 +1,8 @@ #include #include +#include -/* TODO - #include - #include - #include - #include - #include -*/ +#include // ------------------------------------------------------------------------- cpPluginsImageParaMorphologyFilters::BinaryErodeParaImageFilter:: @@ -18,13 +13,9 @@ BinaryErodeParaImageFilter( ) this->_ConfigureInput< _TImage >( "Input", true, false ); this->_ConfigureOutput< _TImage >( "Output" ); - this->m_Parameters.ConfigureAsReal( "Radius" ); - this->m_Parameters.ConfigureAsBool( "Circular" ); - this->m_Parameters.ConfigureAsBool( "UseImageSpacing" ); - - this->m_Parameters.SetReal( "Radius", 3 ); - this->m_Parameters.SetBool( "Circular", true ); - this->m_Parameters.SetBool( "UseImageSpacing", false ); + this->m_Parameters.ConfigureAsReal( "Radius", 3 ); + this->m_Parameters.ConfigureAsBool( "Circular", true ); + this->m_Parameters.ConfigureAsBool( "UseImageSpacing", false ); } // ------------------------------------------------------------------------- @@ -37,11 +28,9 @@ cpPluginsImageParaMorphologyFilters::BinaryErodeParaImageFilter:: void cpPluginsImageParaMorphologyFilters::BinaryErodeParaImageFilter:: _GenerateData( ) { - /* TODO - auto o = this->GetInputData( "Input" ); - cpPlugins_Demangle_ImageScalars_Dims( o, _GD0 ); - else this->_Error( "No valid input image." ); - */ + auto o = this->GetInputData( "Input" ); + cpPlugins_Demangle_Image_ScalarPixels_AllDims_1( o, _GD0 ) + this->_Error( "No valid input image." ); } // ------------------------------------------------------------------------- @@ -49,17 +38,15 @@ template< class _TImage > void cpPluginsImageParaMorphologyFilters::BinaryErodeParaImageFilter:: _GD0( _TImage* image ) { - /* TODO - typedef itk::BinaryErodeParaImageFilter< _TImage > _TFilter; - - auto filter = this->_CreateITK< _TFilter >( ); - filter->SetInput( image ); - filter->SetRadius( this->m_Parameters.GetReal( "Radius" ) ); - filter->SetCircular( this->m_Parameters.GetBool( "Circular" ) ); - filter->SetUseImageSpacing( this->m_Parameters.GetBool( "UseImageSpacing" ) ); - filter->Update( ); - this->GetOutput( "Output" )->SetITK( filter->GetOutput( ) ); - */ + typedef itk::BinaryErodeParaImageFilter< _TImage > _TFilter; + + auto filter = this->_CreateITK< _TFilter >( ); + filter->SetInput( image ); + filter->SetRadius( this->m_Parameters.GetReal( "Radius" ) ); + filter->SetCircular( this->m_Parameters.GetBool( "Circular" ) ); + filter->SetUseImageSpacing( this->m_Parameters.GetBool( "UseImageSpacing" ) ); + filter->Update( ); + this->GetOutput( "Output" )->SetITK( filter->GetOutput( ) ); } // eof - $RCSfile$ diff --git a/plugins/ImageParaMorphologyFilters/ImageParaMorphologyFilter.i b/plugins/ImageParaMorphologyFilters/ImageParaMorphologyFilter.i new file mode 100644 index 0000000..5c1b278 --- /dev/null +++ b/plugins/ImageParaMorphologyFilters/ImageParaMorphologyFilter.i @@ -0,0 +1,17 @@ +header #define ITK_MANUAL_INSTANTIATION + +define itk_filters=BinaryDilateParaImageFilter;BinaryErodeParaImageFilter +define in_scalar_pixels=#scalar_pixels# +define out_scalar_pixels=#scalar_pixels# +define booleans=false;true + +tinclude itkParabolicErodeDilateImageFilter:h|hxx +tinclude itk#itk_filters#:h|hxx + +cinclude itkUnaryFunctorImageFilter.hxx + +instances itk::ParabolicErodeDilateImageFilter< itk::Image< #in_scalar_pixels#, #process_dims# >, #booleans#, itk::Image< #out_scalar_pixels#, #process_dims# > > +instances itk::#itk_filters#< itk::Image< #in_scalar_pixels#, #process_dims# >, itk::Image< #out_scalar_pixels#, #process_dims# > > + + +** eof - $RCSfile$ diff --git a/plugins/ImageThresholdFilters/BinaryThresholdImageFilter.cxx b/plugins/ImageThresholdFilters/BinaryThresholdImageFilter.cxx index 1253773..0fddf92 100644 --- a/plugins/ImageThresholdFilters/BinaryThresholdImageFilter.cxx +++ b/plugins/ImageThresholdFilters/BinaryThresholdImageFilter.cxx @@ -1,5 +1,6 @@ #include #include +#include #include @@ -12,15 +13,10 @@ BinaryThresholdImageFilter( ) this->_ConfigureInput< _TImage >( "Input", true, false ); this->_ConfigureOutput< _TImage >( "Output" ); - 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.SetUint( "InsideValue", 1 ); - this->m_Parameters.SetUint( "OutsideValue", 0 ); + this->m_Parameters.ConfigureAsReal( "LowerThresholdValue", 0 ); + this->m_Parameters.ConfigureAsReal( "UpperThresholdValue", 10000 ); + this->m_Parameters.ConfigureAsUint( "InsideValue", 1 ); + this->m_Parameters.ConfigureAsUint( "OutsideValue", 0 ); } // ------------------------------------------------------------------------- @@ -33,11 +29,9 @@ cpPluginsImageThresholdFilters::BinaryThresholdImageFilter:: void cpPluginsImageThresholdFilters::BinaryThresholdImageFilter:: _GenerateData( ) { - /* TODO - auto o = this->GetInputData( "Input" ); - cpPlugins_Demangle_ImageScalars_Dims( o, _GD0 ); - else this->_Error( "Invalid input image." ); - */ + auto o = this->GetInputData( "Input" ); + cpPlugins_Demangle_Image_ScalarPixels_AllDims_1( o, _GD0 ) + this->_Error( "Invalid input image." ); } // ------------------------------------------------------------------------- @@ -45,30 +39,28 @@ template< class _TImage > void cpPluginsImageThresholdFilters::BinaryThresholdImageFilter:: _GD0( _TImage* image ) { - /* TODO - typedef unsigned char _TBin; - typedef itk::Image< unsigned char, _TImage::ImageDimension > _TBinImage; - typedef itk::BinaryThresholdImageFilter< _TImage, _TBinImage > _TFilter; - typedef typename _TImage::PixelType _TPixel; + typedef unsigned char _TBin; + typedef itk::Image< unsigned char, _TImage::ImageDimension > _TBinImage; + typedef itk::BinaryThresholdImageFilter< _TImage, _TBinImage > _TFilter; + typedef typename _TImage::PixelType _TPixel; - // Get parameters - _TPixel lt = _TPixel( this->m_Parameters.GetReal( "LowerThresholdValue" ) ); - _TPixel ut = _TPixel( this->m_Parameters.GetReal( "UpperThresholdValue" ) ); - _TBin iv = _TBin( this->m_Parameters.GetUint( "InsideValue" ) ); - _TBin ov = _TBin( this->m_Parameters.GetUint( "OutsideValue" ) ); + // Get parameters + _TPixel lt = _TPixel( this->m_Parameters.GetReal( "LowerThresholdValue" ) ); + _TPixel ut = _TPixel( this->m_Parameters.GetReal( "UpperThresholdValue" ) ); + _TBin iv = _TBin( this->m_Parameters.GetUint( "InsideValue" ) ); + _TBin ov = _TBin( this->m_Parameters.GetUint( "OutsideValue" ) ); - // Configure filter - _TFilter* filter = this->_CreateITK< _TFilter >( ); - filter->SetInput( image ); - filter->SetLowerThreshold( lt ); - filter->SetUpperThreshold( ut ); - filter->SetInsideValue( iv ); - filter->SetOutsideValue( ov ); - filter->Update( ); + // Configure filter + _TFilter* filter = this->_CreateITK< _TFilter >( ); + filter->SetInput( image ); + filter->SetLowerThreshold( lt ); + filter->SetUpperThreshold( ut ); + filter->SetInsideValue( iv ); + filter->SetOutsideValue( ov ); + filter->Update( ); - // Connect output - this->GetOutput( "Output" )->SetITK( filter->GetOutput( ) ); - */ + // Connect output + this->GetOutput( "Output" )->SetITK( filter->GetOutput( ) ); } // eof - $RCSfile$ diff --git a/plugins/ImageThresholdFilters/ImageThresholdFilters.i b/plugins/ImageThresholdFilters/ImageThresholdFilters.i index 50de8f1..b1222ae 100644 --- a/plugins/ImageThresholdFilters/ImageThresholdFilters.i +++ b/plugins/ImageThresholdFilters/ImageThresholdFilters.i @@ -1,8 +1,10 @@ header #define ITK_MANUAL_INSTANTIATION define filters=BinaryThresholdImageFilter +define other=UnaryThresholdImageFilter;ImageToBoundingBoxFromThreshold tinclude itk#filters#:h|hxx +tinclude cpExtensions/Algorithms/#other#:h|hxx cinclude itkUnaryFunctorImageFilter.hxx @@ -10,5 +12,6 @@ define in_scalar_pixels=#scalar_pixels# define out_scalar_pixels=#scalar_pixels# instances itk::#filters#< itk::Image< #in_scalar_pixels#, #process_dims# >, itk::Image< #out_scalar_pixels#, #process_dims# > > +instances cpExtensions::Algorithms::#other#< itk::Image< #scalar_pixels#, #process_dims# > > ** eof - $RCSfile$ diff --git a/plugins/ImageThresholdFilters/ImageToBoundingBoxFromThreshold.cxx b/plugins/ImageThresholdFilters/ImageToBoundingBoxFromThreshold.cxx index 52082a2..4b86d54 100644 --- a/plugins/ImageThresholdFilters/ImageToBoundingBoxFromThreshold.cxx +++ b/plugins/ImageThresholdFilters/ImageToBoundingBoxFromThreshold.cxx @@ -1,7 +1,9 @@ #include #include +#include #include +#include #include // ------------------------------------------------------------------------- @@ -15,11 +17,8 @@ ImageToBoundingBoxFromThreshold( ) this->_ConfigureInput< _TImage >( "Input", true, false ); this->_ConfigureOutput< _TBBox >( "Output" ); - this->m_Parameters.ConfigureAsReal( "LowerThreshold" ); - this->m_Parameters.ConfigureAsReal( "UpperThreshold" ); - - this->m_Parameters.SetReal( "LowerThreshold", 0 ); - this->m_Parameters.SetReal( "LowerThreshold", 0 ); + this->m_Parameters.ConfigureAsReal( "LowerThreshold", 0 ); + this->m_Parameters.ConfigureAsReal( "UpperThreshold", 0 ); } // ------------------------------------------------------------------------- @@ -32,11 +31,9 @@ cpPluginsImageThresholdFilters::ImageToBoundingBoxFromThreshold:: void cpPluginsImageThresholdFilters::ImageToBoundingBoxFromThreshold:: _GenerateData( ) { - /* TODO - auto o = this->GetInputData( "Input" ); - cpPlugins_Demangle_ImageScalars_Dims( o, _GD0 ); - else this->_Error( "Invalid input image." ); - */ + auto o = this->GetInputData( "Input" ); + cpPlugins_Demangle_Image_ScalarPixels_AllDims_1( o, _GD0 ) + this->_Error( "Invalid input image." ); } // ------------------------------------------------------------------------- @@ -44,27 +41,25 @@ template< class _TImage > void cpPluginsImageThresholdFilters::ImageToBoundingBoxFromThreshold:: _GD0( _TImage* image ) { - /* TODO - typedef - cpExtensions::Algorithms::ImageToBoundingBoxFromThreshold< _TImage > - _TFilter; + typedef + cpExtensions::Algorithms::ImageToBoundingBoxFromThreshold< _TImage > + _TFilter; - // Configure filter - _TFilter* filter = this->_CreateITK< _TFilter >( ); - filter->SetImage( image ); - filter->SetLowerThreshold( this->m_Parameters.GetReal( "LowerThreshold" ) ); - filter->SetUpperThreshold( this->m_Parameters.GetReal( "UpperThreshold" ) ); - filter->Compute( ); + // Configure filter + _TFilter* filter = this->_CreateITK< _TFilter >( ); + filter->SetImage( image ); + filter->SetLowerThreshold( this->m_Parameters.GetReal( "LowerThreshold" ) ); + filter->SetUpperThreshold( this->m_Parameters.GetReal( "UpperThreshold" ) ); + filter->Compute( ); - // Create output - auto reg = filter->GetRegion( ); - auto bb = this->GetOutput< cpPlugins::DataObjects::BoundingBox >( "Output" ); - typename _TImage::PointType p0, p1; - image->TransformIndexToPhysicalPoint( reg.GetIndex( ), p0 ); - image->TransformIndexToPhysicalPoint( reg.GetIndex( ) + reg.GetSize( ), p1 ); - bb->SetMinimum( p0 ); - bb->SetMaximum( p1 ); - */ + // Create output + auto reg = filter->GetRegion( ); + auto bb = this->GetOutput< cpPlugins::DataObjects::BoundingBox >( "Output" ); + typename _TImage::PointType p0, p1; + image->TransformIndexToPhysicalPoint( reg.GetIndex( ), p0 ); + image->TransformIndexToPhysicalPoint( reg.GetIndex( ) + reg.GetSize( ), p1 ); + bb->SetMinimum( p0 ); + bb->SetMaximum( p1 ); } // eof - $RCSfile$ diff --git a/plugins/ImageThresholdFilters/UnaryThresholdImageFilter.cxx b/plugins/ImageThresholdFilters/UnaryThresholdImageFilter.cxx index cd16ed3..84aded1 100644 --- a/plugins/ImageThresholdFilters/UnaryThresholdImageFilter.cxx +++ b/plugins/ImageThresholdFilters/UnaryThresholdImageFilter.cxx @@ -1,5 +1,6 @@ #include #include +#include #include @@ -12,15 +13,10 @@ UnaryThresholdImageFilter( ) this->_ConfigureInput< _TImage >( "Input", true, false ); this->_ConfigureOutput< _TImage >( "Output" ); - this->m_Parameters.ConfigureAsReal( "Threshold" ); - this->m_Parameters.ConfigureAsReal( "InsideValue" ); - this->m_Parameters.ConfigureAsReal( "OutsideValue" ); - this->m_Parameters.ConfigureAsBool( "Strict" ); - - this->m_Parameters.SetReal( "Threshold", 0 ); - this->m_Parameters.SetReal( "InsideValue", 1 ); - this->m_Parameters.SetReal( "OutsideValue", 0 ); - this->m_Parameters.SetBool( "Strict", false ); + this->m_Parameters.ConfigureAsReal( "Threshold", 0 ); + this->m_Parameters.ConfigureAsReal( "InsideValue", 1 ); + this->m_Parameters.ConfigureAsReal( "OutsideValue", 0 ); + this->m_Parameters.ConfigureAsBool( "Strict", false ); } // ------------------------------------------------------------------------- @@ -33,11 +29,9 @@ cpPluginsImageThresholdFilters::UnaryThresholdImageFilter:: void cpPluginsImageThresholdFilters::UnaryThresholdImageFilter:: _GenerateData( ) { - /* TODO - auto o = this->GetInputData( "Input" ); - cpPlugins_Demangle_ImageScalars_Dims( o, _GD0 ); - else this->_Error( "Invalid input image." ); - */ + auto o = this->GetInputData( "Input" ); + cpPlugins_Demangle_Image_ScalarPixels_AllDims_1( o, _GD0 ) + this->_Error( "Invalid input image." ); } // ------------------------------------------------------------------------- @@ -45,23 +39,21 @@ template< class _TImage > void cpPluginsImageThresholdFilters::UnaryThresholdImageFilter:: _GD0( _TImage* image ) { - /* TODO - typedef - cpExtensions::Algorithms::UnaryThresholdImageFilter< _TImage > - _TFilter; - - // Configure filter - _TFilter* filter = this->_CreateITK< _TFilter >( ); - filter->SetInput( image ); - filter->SetThreshold( this->m_Parameters.GetReal( "Threshold" ) ); - filter->SetInsideValue( this->m_Parameters.GetReal( "InsideValue" ) ); - filter->SetOutsideValue( this->m_Parameters.GetReal( "OutsideValue" ) ); - filter->SetStrict( this->m_Parameters.GetBool( "Strict" ) ); - filter->Update( ); - - // Connect output - this->GetOutput( "Output" )->SetITK( filter->GetOutput( ) ); - */ + typedef + cpExtensions::Algorithms::UnaryThresholdImageFilter< _TImage > + _TFilter; + + // Configure filter + _TFilter* filter = this->_CreateITK< _TFilter >( ); + filter->SetInput( image ); + filter->SetThreshold( this->m_Parameters.GetReal( "Threshold" ) ); + filter->SetInsideValue( this->m_Parameters.GetReal( "InsideValue" ) ); + filter->SetOutsideValue( this->m_Parameters.GetReal( "OutsideValue" ) ); + filter->SetStrict( this->m_Parameters.GetBool( "Strict" ) ); + filter->Update( ); + + // Connect output + this->GetOutput( "Output" )->SetITK( filter->GetOutput( ) ); } // eof - $RCSfile$ diff --git a/plugins/MeshSources/CylinderSource.cxx b/plugins/MeshSources/CylinderSource.cxx index 5a11d78..a89e1a4 100644 --- a/plugins/MeshSources/CylinderSource.cxx +++ b/plugins/MeshSources/CylinderSource.cxx @@ -9,12 +9,9 @@ CylinderSource( ) : Superclass( ) { this->_ConfigureOutput< cpPlugins::DataObjects::Mesh >( "Output" ); - this->m_Parameters.ConfigureAsReal( "Height" ); - this->m_Parameters.ConfigureAsReal( "Radius" ); - this->m_Parameters.ConfigureAsUint( "Resolution" ); - this->m_Parameters.SetReal( "Height", 1 ); - this->m_Parameters.SetReal( "Radius", 1 ); - this->m_Parameters.SetUint( "Resolution", 8 ); + this->m_Parameters.ConfigureAsReal( "Height", 1 ); + this->m_Parameters.ConfigureAsReal( "Radius", 1 ); + this->m_Parameters.ConfigureAsUint( "Resolution", 8 ); } // ------------------------------------------------------------------------- diff --git a/plugins/MeshSources/SphereSource.cxx b/plugins/MeshSources/SphereSource.cxx index 8d52ce3..fba068a 100644 --- a/plugins/MeshSources/SphereSource.cxx +++ b/plugins/MeshSources/SphereSource.cxx @@ -9,12 +9,9 @@ SphereSource( ) : Superclass( ) { this->_ConfigureOutput< cpPlugins::DataObjects::Mesh >( "Output" ); - this->m_Parameters.ConfigureAsReal( "Radius" ); - this->m_Parameters.ConfigureAsUint( "PhiResolution" ); - this->m_Parameters.ConfigureAsUint( "ThetaResolution" ); - this->m_Parameters.SetReal( "Radius", 1 ); - this->m_Parameters.SetUint( "PhiResolution", 8 ); - this->m_Parameters.SetUint( "ThetaResolution", 8 ); + this->m_Parameters.ConfigureAsReal( "Radius", 1 ); + this->m_Parameters.ConfigureAsUint( "PhiResolution", 8 ); + this->m_Parameters.ConfigureAsUint( "ThetaResolution", 8 ); } // ------------------------------------------------------------------------- diff --git a/plugins/Widgets/SplineWidget.cxx b/plugins/Widgets/SplineWidget.cxx index 258c0bd..256ae8f 100644 --- a/plugins/Widgets/SplineWidget.cxx +++ b/plugins/Widgets/SplineWidget.cxx @@ -63,8 +63,7 @@ SplineWidget( ) this->m_Contour->SetStrips( vtkSmartPointer< vtkCellArray >::New( ) ); this->GetOutput( "Output" )->SetVTK( this->m_Contour ); - this->m_Parameters.ConfigureAsBool( "Extend" ); - this->m_Parameters.SetBool( "Extend", false ); + this->m_Parameters.ConfigureAsBool( "Extend", false ); } // ------------------------------------------------------------------------- -- 2.45.0