]> Creatis software - clitk.git/blobdiff - itk/clitkSegmentationUtils.h
itkv4 migration:
[clitk.git] / itk / clitkSegmentationUtils.h
index 6fa67aa4ebed30d25a02b5f7faf3156948eb7eac..6eecad0702cc6f104f05af4b448cb3ab280b30be 100644 (file)
@@ -26,6 +26,7 @@
 
 // itk
 #include <itkBoundingBox.h>
+#include <itkJoinSeriesImageFilter.h>
 
 /*
   According to 
@@ -152,7 +153,8 @@ namespace clitk {
                               std::string orientation, 
                                bool uniqueConnectedComponent=false, 
                                double spacing=-1, 
-                              bool notflag=false);
+                               bool autocropflag=true, 
+                               bool singleObjectCCL=true);
 
   //--------------------------------------------------------------------
   // In a binary image, search for the point belonging to the FG that
@@ -224,7 +226,19 @@ namespace clitk {
   typename ImageType::Pointer
   JoinSlices(std::vector<typename itk::Image<typename ImageType::PixelType, 
                                              ImageType::ImageDimension-1>::Pointer > & slices, 
-            const ImageType * input, int dim);
+             const ImageType * input, 
+             int direction) {
+    typedef typename itk::Image<typename ImageType::PixelType, ImageType::ImageDimension-1> SliceType;
+    typedef itk::JoinSeriesImageFilter<SliceType, ImageType> JoinSeriesFilterType;
+    typename JoinSeriesFilterType::Pointer joinFilter = JoinSeriesFilterType::New();
+    joinFilter->SetOrigin(input->GetOrigin()[direction]);
+    joinFilter->SetSpacing(input->GetSpacing()[direction]);
+    for(unsigned int i=0; i<slices.size(); i++) {
+      joinFilter->PushBackInput(slices[i]);
+    }
+    joinFilter->Update();
+    return joinFilter->GetOutput();
+  }
   //--------------------------------------------------------------------
 
 
@@ -348,6 +362,22 @@ namespace clitk {
   IsOnTheSameLineSide(PointType C, PointType A, PointType B, PointType like);
   //--------------------------------------------------------------------
 
+
+  //--------------------------------------------------------------------
+  template<class ImageType>
+  void 
+  SliceBySliceBuildLineSegmentAccordingToExtremaPosition(const ImageType * input, 
+                                                         typename ImageType::PixelType BG, 
+                                                         int sliceDimension, 
+                                                         int extremaDirection, 
+                                                         bool extremaOppositeFlag, 
+                                                         int lineDirection,
+                                                         double margin,
+                                                         std::vector<typename ImageType::PointType> & A, 
+                                                         std::vector<typename ImageType::PointType> & B);  
+  //--------------------------------------------------------------------
+
+
 }
 
 #include "clitkSegmentationUtils.txx"