--- /dev/null
+// =========================================================================
+// @author Leonardo Florez Valencia
+// @email florez-l@javeriana.edu.co
+// =========================================================================
+
+#include <string>
+#include <tclap/CmdLine.h>
+#include <itkImage.h>
+#include <itkAndImageFilter.h>
+#include "Functions.h"
+
+// -------------------------------------------------------------------------
+const unsigned int Dim = 3;
+typedef unsigned char TPixel;
+typedef itk::Image< TPixel, Dim > TImage;
+
+// -------------------------------------------------------------------------
+int main( int argc, char* argv[] )
+{
+ typedef TCLAP::ValueArg< std::string > _TStringArg;
+
+ // Parse input line
+ _TStringArg in1( "i", "input1", "Input image 1", true, "", "file" );
+ _TStringArg in2( "j", "input2", "Input image 2", true, "", "file" );
+ _TStringArg out( "o", "output", "Output image", true, "", "file" );
+ try
+ {
+ TCLAP::CmdLine cmd( "FastRandomWalker", ' ', "1.0.0" );
+ cmd.add( out );
+ cmd.add( in2 );
+ cmd.add( in1 );
+ cmd.parse( argc, argv );
+ }
+ catch( TCLAP::ArgException& err )
+ {
+ std::cerr
+ << "===============================" << std::endl
+ << "Error caught: " << std::endl
+ << err.error( ) << " " << err.argId( ) << std::endl
+ << "===============================" << std::endl
+ << std::endl;
+ return( 1 );
+
+ } // yrt
+
+ try
+ {
+ // Read input image 1
+ TImage::Pointer input_image1;
+ CTBronchi::ReadImage( input_image1, in1.getValue( ) );
+
+ // Read input image 2
+ TImage::Pointer input_image2;
+ CTBronchi::ReadImage( input_image2, in2.getValue( ) );
+
+ // And images
+ typedef itk::AndImageFilter< TImage, TImage, TImage > TFilter;
+ TFilter::Pointer filter = TFilter::New( );
+ filter->SetInput1( input_image1 );
+ filter->SetInput2( input_image2 );
+ double t = CTBronchi::MeasureTime( filter );
+ std::cout << "And filter executed in " << t << " s" << std::endl;
+
+ // Write result
+ CTBronchi::WriteImage( filter->GetOutput( ), out.getValue( ) );
+ }
+ catch( std::exception& err )
+ {
+ std::cerr
+ << "===============================" << std::endl
+ << "Error caught: " << std::endl
+ << err.what( ) << std::endl
+ << "===============================" << std::endl
+ << std::endl;
+ return( 1 );
+
+ } // yrt
+ return( 0 );
+}
+
+// eof - $RCSfile$
#!/bin/bash
## -- Command line options
+exec_dir=`dirname $0`
vesselness_sigma="0.5"
vesselness_alpha1="0.5"
vesselness_alpha2="2"
mori_lower="-1024"
mori_upper="0"
mori_delta="1"
-labels_vesselness_thr="5"
+slicebyslice_vesselness_thr="5"
+fast_vesselness_thr="95"
labels_upper_thr="-400"
beta="2.5"
epsilon="1e-5"
mori_delta="$2"
shift
;;
- -labels_vesselness_thr)
- labels_vesselness_thr="$2"
+ -slicebyslice_vesselness_thr)
+ slicebyslice_vesselness_thr="$2"
+ shift
+ ;;
+ -fast_vesselness_thr)
+ fast_vesselness_thr="$2"
shift
;;
-labels_upper_thr)
(>&2 echo "Processing $input... ")
echo "Processing $input..."
if [ ! -f $vesselness ] || [ -n "$force" ] ; then
- ./fpa_CTBronchi_Vesselness \
+ $exec_dir/fpa_CTBronchi_Vesselness \
-i $input -o $vesselness \
-s $vesselness_sigma -a $vesselness_alpha1 -b $vesselness_alpha2
fi
if [ ! -f $mori ] || [ -n "$force" ] ; then
- ./fpa_CTBronchi_MoriSegmentation \
+ $exec_dir/fpa_CTBronchi_MoriSegmentation \
-i $input \
-o $mori \
-s $mori_signal \
fi
if [ ! -f $labels ] || [ -n "$force" ] ; then
- ./fpa_CTBronchi_MoriLabelling \
+ $exec_dir/fpa_CTBronchi_MoriLabelling \
-i $input \
-l $mori \
-v $vesselness \
-o $labels \
- -a $labels_vesselness_thr \
+ -a $fast_vesselness_thr \
-u $labels_upper_thr
fi
if [ ! -f $fastrw ] || [ -n "$force" ] ; then
- ./fpa_CTBronchi_FastRandomWalker \
+ $exec_dir/fpa_CTBronchi_FastRandomWalker \
-i $input \
-l $labels \
-o $fastrw \
fi
if [ ! -f $slicerw ] || [ -n "$force" ] ; then
- ./fpa_CTBronchi_SliceBySliceRandomWalker \
+ $exec_dir/fpa_CTBronchi_SliceBySliceRandomWalker \
-i $input \
-l $mori \
-v $vesselness \
-o $slicerw \
- -t $labels_vesselness_thr \
+ -t $slicebyslice_vesselness_thr \
-b $beta \
-e $epsilon
fi