label_outside=2
random_walker_output_image="$base_name"_rw.mhd
-random_walker_alpha=0
random_walker_beta=20
$mori_seg \
$random_walker \
$input_image $labels_output_image $random_walker_output_image \
$label_inside \
- $random_walker_alpha \
$random_walker_beta
## eof - $RCSfile$
int main( int argc, char* argv[] )
{
// Get arguments
- if( argc < 7 )
+ if( argc < 6 )
{
std::cerr
<< "Usage: " << argv[ 0 ] << std::endl
<< " input_image label_image output_image" << std::endl
- << " label alpha(0) beta(100)"
+ << " label beta(100)"
<< std::endl;
return( 1 );
std::string label_image_filename = argv[ 2 ];
std::string output_image_filename = argv[ 3 ];
TLabel label = TLabel( std::atoi( argv[ 4 ] ) );
- double alpha = std::atof( argv[ 5 ] );
- double beta = std::atof( argv[ 6 ] );
+ double beta = std::atof( argv[ 5 ] );
// Read images
itk::ImageFileReader< TInputImage >::Pointer input_image_reader =
// Prepare weight
TWeight::Pointer weight = TWeight::New( );
- weight->SetAlpha( alpha );
weight->SetBeta( beta );
// Prepare filter
## == Find needed packages and dependencies ==
## ===========================================
-set(ITK_DIR @ITK_DIR@)
-
-find_package(ITK CONFIG REQUIRED)
-include(${ITK_USE_FILE})
+find_package(ivq CONFIG REQUIRED)
## eof - $RCSfile$
namespace Dijkstra
{
/**
+ * w_{i,j}=\left(\exp\left(\left(\frac{w_{i}-w_{j}}{\beta}\right)^{2}\right)-1\right)^{\alpha}
*/
template< class _TInputImage, class _TOutputValue >
class Gaussian
fpa::Image::Functors::Dijkstra::Function
);
- public:
- double GetAlpha( ) const
- {
- return( double( 1 ) - this->m_Alpha );
- }
- double GetBeta( ) const
- {
- return( std::sqrt( this->m_Beta ) );
- }
- void SetAlpha( const double& v )
- {
- this->m_Alpha = double( 1 ) - v;
- this->Modified( );
- }
- void SetBeta( const double& v )
- {
- this->m_Beta = v * v;
- this->Modified( );
- }
+ itkGetConstMacro( Alpha, double );
+ itkSetMacro( Alpha, double );
+ itkGetConstMacro( Beta, double );
+ itkSetMacro( Beta, double );
+
+ public:
virtual _TOutputValue Evaluate(
const TVertex& v, const TVertex& p
) const override
{
double d = double( this->m_Image->GetPixel( v ) );
d -= double( this->m_Image->GetPixel( p ) );
- d = ( d * d ) / this->m_Beta;
- return(
- _TOutputValue( double( 1 ) - ( this->m_Alpha * std::exp( -d ) ) )
- );
+ d /= this->m_Beta;
+ d = std::exp( d * d ) - double( 1 );
+ return( _TOutputValue( std::pow( d, this->m_Alpha ) ) );
}
protected:
#include <fpa/Base/MinimumSpanningTree.h>
#include <itkImage.h>
+#include <fpa/Image/PolyLineParametricPath.h>
namespace fpa
{
typedef typename Superclass::TCollisions TCollisions;
typedef typename Superclass::TVertices TVertices;
+ typedef fpa::Image::PolyLineParametricPath< _VDim > TPolyLineParametricPath;
+
public:
itkNewMacro( Self );
itkTypeMacro(
this->SetPixel( v, p - v );
}
+ void GetPath(
+ typename TPolyLineParametricPath::Pointer& path,
+ const TVertex& a
+ ) const;
+ void GetPath(
+ typename TPolyLineParametricPath::Pointer& path,
+ const TVertex& a, const TVertex& b
+ ) const;
+
protected:
MinimumSpanningTree( )
: Superclass( )
} // ecapseman
+#ifndef ITK_MANUAL_INSTANTIATION
+# include <fpa/Image/MinimumSpanningTree.hxx>
+#endif // ITK_MANUAL_INSTANTIATION
+
#endif // __fpa__Image__MinimumSpanningTree__h__
// eof - $RCSfile$
#include <fpa/Image/Functors/Dijkstra/Gaussian.h>
// -------------------------------------------------------------------------
-const unsigned int Dim = 2;
-typedef unsigned char TPixel;
-typedef float TScalar;
+const unsigned int Dim = 3;
+typedef short TPixel;
+typedef float TScalar;
typedef itk::Image< TPixel, Dim > TInputImage;
typedef itk::Image< TScalar, Dim > TScalarImage;
filter->SetStopAtOneFront( stop_at_one_front );
// Get all seeds
- for( int i = 7; i < argc; i += 2 )
+ for( int i = 7; i < argc; i += 3 )
{
if( i + 1 < argc )
{
TInputImage::IndexType seed;
seed[ 0 ] = std::atoi( argv[ i ] );
seed[ 1 ] = std::atoi( argv[ i + 1 ] );
+ seed[ 2 ] = std::atoi( argv[ i + 2 ] );
filter->AddSeed( seed );
} // fi
int main( int argc, char* argv[] )
{
// Get arguments
- if( argc < 7 )
+ if( argc < 6 )
{
std::cerr
<< "Usage: " << argv[ 0 ]
<< " input_image labels_image output_image output_costs"
- << " alpha beta"
+ << " beta"
<< std::endl;
return( 1 );
std::string labels_image_filename = argv[ 2 ];
std::string output_image_filename = argv[ 3 ];
std::string output_costs_filename = argv[ 4 ];
- double alpha = std::atof( argv[ 5 ] );
- double beta = std::atof( argv[ 6 ] );
+ double beta = std::atof( argv[ 5 ] );
// Read image
TInputImage::Pointer image;
// Prepare weight
TWeight::Pointer weight = TWeight::New( );
- weight->SetAlpha( alpha );
weight->SetBeta( beta );
// Prepare filter