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 )
ImageIterators
ImageNeighborhoodIterators
ImageFiltersBases
+ ImageComplexFilters
BoundingBoxes
Meshes
)
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)
--- /dev/null
+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$
#ifndef __CPEXTENSIONS__ALGORITHMS__GRADIENTIMAGEFUNCTIONBASE__H__
#define __CPEXTENSIONS__ALGORITHMS__GRADIENTIMAGEFUNCTIONBASE__H__
+#include <cpExtensions/Config.h>
+#include <itkImage.h>
#include <itkImageFunction.h>
namespace cpExtensions
// -------------------------------------------------------------------------
#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 \
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 );
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::
}
// -------------------------------------------------------------------------
-#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 )
// -------------------------------------------------------------------------
// 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;
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 );
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
Widget( )
: Superclass( )
{
- this->m_Parameters.ConfigureAsString( "Text" );
- this->m_Parameters.SetString( "Text", "" );
+ this->m_Parameters.ConfigureAsString( "Text", "" );
}
// -------------------------------------------------------------------------
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$
--- /dev/null
+#include <cpPlugins/QT/OpenFileDialog.h>
+
+#ifdef cpPlugins_QT4
+
+#include <cpPlugins/BaseObjects/Parameters.h>
+
+// -------------------------------------------------------------------------
+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$
--- /dev/null
+#ifndef __cpPlugins__QT__OpenFileDialog__h__
+#define __cpPlugins__QT__OpenFileDialog__h__
+
+#include <cpPlugins/Config.h>
+
+#ifdef cpPlugins_QT4
+
+#include <QFileDialog>
+
+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$
--- /dev/null
+#include <cpPlugins/QT/SaveFileDialog.h>
+
+#ifdef cpPlugins_QT4
+
+#include <cpPlugins/BaseObjects/Parameters.h>
+
+// -------------------------------------------------------------------------
+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$
--- /dev/null
+#ifndef __cpPlugins__QT__SaveFileDialog__h__
+#define __cpPlugins__QT__SaveFileDialog__h__
+
+#include <cpPlugins/Config.h>
+
+#ifdef cpPlugins_QT4
+
+#include <QFileDialog>
+
+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$
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" );
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 );
}
// -------------------------------------------------------------------------
cpPluginsImageDistanceMaps
cpPluginsImageThresholdFilters
)
+IF(ParabolicMorphology_LOADED)
+ TARGET_LINK_LIBRARIES(
+ cpPluginsImageParaMorphologyFilters
+ cpPluginsImageThresholdFilters
+ )
+ENDIF(ParabolicMorphology_LOADED)
## eof - $RSCfile$
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 );
}
// -------------------------------------------------------------------------
#include <IO/ImageReader.h>
-#include <IO/ImageReaderQDialog.h>
#include <cpPlugins/DataObjects/Image.h>
+#include <cpPlugins/QT/OpenFileDialog.h>
#include <itkImageFileReader.h>
#include <itkImageSeriesReader.h>
#include <itkImageIOFactory.h>
#ifdef cpPlugins_QT4
-
-#include <QApplication>
-#include <QFileInfo>
-
-// -------------------------------------------------------------------------
-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 <QApplication>
#endif // cpPlugins_QT4
// -------------------------------------------------------------------------
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 );
{
// 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(
// 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
{
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
{
+++ /dev/null
-#ifndef __cpPluginsIO__ImageReaderQDialog__h__
-#define __cpPluginsIO__ImageReaderQDialog__h__
-
-#include <cpPlugins/Config.h>
-
-#ifdef cpPlugins_QT4
-
-#include <QFileDialog>
-
-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$
#include <IO/ImageWriter.h>
-#include <IO/ImageWriterQDialog.h>
#include <cpPlugins/DataObjects/Image.h>
#include <cpPlugins/DataObjects/Image_Demanglers.h>
+#include <cpPlugins/QT/SaveFileDialog.h>
#include <cpInstances_SimpleImages.h>
#include <itkImageFileWriter.h>
#ifdef cpPlugins_QT4
-
-#include <QApplication>
-#include <QFileInfo>
-
-// -------------------------------------------------------------------------
-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 <QApplication>
#endif // cpPlugins_QT4
// -------------------------------------------------------------------------
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 );
{
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)"
+++ /dev/null
-#ifndef __cpPluginsIO__ImageWriterQDialog__h__
-#define __cpPluginsIO__ImageWriterQDialog__h__
-
-#include <cpPlugins/Config.h>
-
-#ifdef cpPlugins_QT4
-
-#include <QFileDialog>
-
-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$
#include <IO/MeshWriter.h>
#include <cpPlugins/DataObjects/Mesh.h>
+#include <cpPlugins/QT/SaveFileDialog.h>
#include <vtkPolyData.h>
#include <vtkPolyDataWriter.h>
+#ifdef cpPlugins_QT4
+# include <QApplication>
+#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( )
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)"
: public cpPlugins::BaseObjects::ProcessObject
{
cpPluginsObject( MeshWriter, cpPlugins::BaseObjects::ProcessObject, IO );
+
+ public:
+ virtual QDialog* CreateQDialog( ) cpPlugins_OVERRIDE;
};
} // ecapseman
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 );
}
// -------------------------------------------------------------------------
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 );
}
// -------------------------------------------------------------------------
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
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 );
}
// -------------------------------------------------------------------------
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 );
}
// -------------------------------------------------------------------------
#include <cpPlugins/DataObjects/Image.h>
#include <cpPlugins/DataObjects/Image_Demanglers.h>
-/* TODO
- #include <cpExtensions/Algorithms/ImageFunctionFilter.h>
- #include <cpExtensions/Algorithms/FluxMedialness.h>
-
- #include <cpExtensions/Algorithms/ImageFunctionFilter.hxx>
- #include <cpExtensions/Algorithms/FluxMedialness.hxx>
- #include <cpExtensions/Algorithms/GradientImageFunctionBase.hxx>
- #include <itkImageFunction.hxx>
-*/
+#include <cpExtensions/Algorithms/ImageFunctionFilter.h>
+#include <cpExtensions/Algorithms/FluxMedialness.h>
// -------------------------------------------------------------------------
cpPluginsImageGradientFilters::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 );
}
// -------------------------------------------------------------------------
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." );
}
// -------------------------------------------------------------------------
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$
#include <ImageGradientFilters/GulsunTekImageFilter.h>
#include <cpPlugins/DataObjects/Image.h>
#include <cpPlugins/DataObjects/Image_Demanglers.h>
-
-/* TODO
- #include <cpExtensions/Algorithms/ImageFunctionFilter.h>
- #include <cpExtensions/Algorithms/GulsunTekMedialness.h>
- #include <cpExtensions/Algorithms/ImageFunctionFilter.hxx>
- #include <cpExtensions/Algorithms/GulsunTekMedialness.hxx>
- #include <cpExtensions/Algorithms/GradientImageFunctionBase.hxx>
- #include <itkImageFunction.hxx>
-*/
+#include <cpExtensions/Algorithms/ImageFunctionFilter.h>
+#include <cpExtensions/Algorithms/GulsunTekMedialness.h>
// -------------------------------------------------------------------------
cpPluginsImageGradientFilters::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 );
}
// -------------------------------------------------------------------------
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." );
}
// -------------------------------------------------------------------------
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$
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
--- /dev/null
+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$
#include <cpPlugins/DataObjects/Image.h>
#include <cpPlugins/DataObjects/Image_Demanglers.h>
-/* TODO
- #include <cpExtensions/Algorithms/ImageFunctionFilter.h>
- #include <cpExtensions/Algorithms/MFluxMedialness.h>
-
- #include <cpExtensions/Algorithms/ImageFunctionFilter.hxx>
- #include <cpExtensions/Algorithms/MFluxMedialness.hxx>
- #include <cpExtensions/Algorithms/GradientImageFunctionBase.hxx>
- #include <itkImageFunction.hxx>
-*/
+#include <cpExtensions/Algorithms/ImageFunctionFilter.h>
+#include <cpExtensions/Algorithms/MFluxMedialness.h>
// -------------------------------------------------------------------------
cpPluginsImageGradientFilters::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 );
}
// -------------------------------------------------------------------------
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." );
}
// -------------------------------------------------------------------------
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$
#include <cpExtensions/Algorithms/MultiScaleGaussianImageFilter.h>
-/* TODO
- #include <cpExtensions/Algorithms/MultiScaleGaussianImageFilter.hxx>
- #include <itkGradientRecursiveGaussianImageFilter.hxx>
- #include <itkRecursiveGaussianImageFilter.hxx>
- #include <itkImageAdaptor.hxx>
- #include <itkUnaryFunctorImageFilter.hxx>
- #include <itkImageConstIteratorWithIndex.hxx>
- #include <itkBinaryFunctorImageFilter.hxx>
- #include <itkImageRegionIteratorWithIndex.hxx>
- #include <itkInPlaceImageFilter.hxx>
- #include <itkImageRegionConstIteratorWithIndex.hxx>
- #include <itkSimpleDataObjectDecorator.hxx>
-*/
-
// -------------------------------------------------------------------------
cpPluginsImageGradientFilters::MultiScaleGaussianImageFilter::
MultiScaleGaussianImageFilter( )
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 );
}
// -------------------------------------------------------------------------
#include <ImageParaMorphologyFilters/BinaryDilateParaImageFilter.h>
#include <cpPlugins/DataObjects/Image.h>
+#include <cpPlugins/DataObjects/Image_Demanglers.h>
-/* TODO
- #include <itkBinaryDilateParaImageFilter.h>
- #include <itkBinaryDilateParaImageFilter.hxx>
- #include <itkBinaryThresholdImageFilter.hxx>
- #include <itkUnaryFunctorImageFilter.hxx>
- #include <itkParabolicErodeDilateImageFilter.hxx>
-*/
+#include <itkBinaryDilateParaImageFilter.h>
// -------------------------------------------------------------------------
cpPluginsImageParaMorphologyFilters::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 );
}
// -------------------------------------------------------------------------
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." );
}
// -------------------------------------------------------------------------
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$
#include <ImageParaMorphologyFilters/BinaryErodeParaImageFilter.h>
#include <cpPlugins/DataObjects/Image.h>
+#include <cpPlugins/DataObjects/Image_Demanglers.h>
-/* TODO
- #include <itkBinaryErodeParaImageFilter.h>
- #include <itkBinaryErodeParaImageFilter.hxx>
- #include <itkBinaryThresholdImageFilter.hxx>
- #include <itkUnaryFunctorImageFilter.hxx>
- #include <itkParabolicErodeDilateImageFilter.hxx>
-*/
+#include <itkBinaryErodeParaImageFilter.h>
// -------------------------------------------------------------------------
cpPluginsImageParaMorphologyFilters::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 );
}
// -------------------------------------------------------------------------
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." );
}
// -------------------------------------------------------------------------
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$
--- /dev/null
+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$
#include <ImageThresholdFilters/BinaryThresholdImageFilter.h>
#include <cpPlugins/DataObjects/Image.h>
+#include <cpPlugins/DataObjects/Image_Demanglers.h>
#include <itkBinaryThresholdImageFilter.h>
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 );
}
// -------------------------------------------------------------------------
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." );
}
// -------------------------------------------------------------------------
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$
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
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$
#include <ImageThresholdFilters/ImageToBoundingBoxFromThreshold.h>
#include <cpPlugins/DataObjects/Image.h>
+#include <cpPlugins/DataObjects/Image_Demanglers.h>
#include <cpPlugins/DataObjects/BoundingBox.h>
+#include <itkImage.h>
#include <cpExtensions/Algorithms/ImageToBoundingBoxFromThreshold.h>
// -------------------------------------------------------------------------
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 );
}
// -------------------------------------------------------------------------
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." );
}
// -------------------------------------------------------------------------
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$
#include <ImageThresholdFilters/UnaryThresholdImageFilter.h>
#include <cpPlugins/DataObjects/Image.h>
+#include <cpPlugins/DataObjects/Image_Demanglers.h>
#include <cpExtensions/Algorithms/UnaryThresholdImageFilter.h>
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 );
}
// -------------------------------------------------------------------------
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." );
}
// -------------------------------------------------------------------------
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$
: 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 );
}
// -------------------------------------------------------------------------
: 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 );
}
// -------------------------------------------------------------------------
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 );
}
// -------------------------------------------------------------------------