]> Creatis software - FrontAlgorithms.git/commitdiff
...
authorLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Wed, 22 Nov 2017 06:59:13 +0000 (01:59 -0500)
committerLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Wed, 22 Nov 2017 06:59:13 +0000 (01:59 -0500)
appli/CTBronchi/AndSegmentations.cxx [new file with mode: 0644]
appli/CTBronchi/CMakeLists.txt
appli/CTBronchi/Process.sh

diff --git a/appli/CTBronchi/AndSegmentations.cxx b/appli/CTBronchi/AndSegmentations.cxx
new file mode 100644 (file)
index 0000000..4bd76a7
--- /dev/null
@@ -0,0 +1,81 @@
+// =========================================================================
+// @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$
index d2ffd716cd327198955e1ef26ce7a62fb38ade8b..5f10a8ed58718c72f11c32b167c756aeafe2d205 100644 (file)
@@ -12,6 +12,7 @@ if(fpa_BUILD_CTBronchi)
     MoriLabelling
     FastRandomWalker
     SliceBySliceRandomWalker
+    AndSegmentations
     )
   foreach(_e ${_examples})
     BuildApplication(
@@ -28,7 +29,10 @@ if(fpa_BUILD_CTBronchi)
     ${PROJECT_BINARY_DIR}/${_pfx}Process.sh
     COPYONLY
     )
-
+  install(
+    FILES ${PROJECT_BINARY_DIR}/${_pfx}Process.sh
+    DESTINATION bin
+    )
 endif(fpa_BUILD_CTBronchi)
 
 ## eof - $RCSfile$
index 009829ff50919388a015dd030f4b4c9bc8f09e7e..a6cb49bab4e08026992a7d52083813e61fc83977 100755 (executable)
@@ -67,8 +67,12 @@ while [[ "$#" -gt 0 ]]; do
         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
         ;;
         -slice_by_slice_vesselness_thr)
@@ -146,7 +150,7 @@ if [ ! -f $labels ] || [ -n "$force" ] ; then
         -l $mori \
         -v $vesselness \
         -o $labels \
-        -a $labels_vesselness_thr \
+        -a $fast_vesselness_thr \
         -u $labels_upper_thr
 fi