]> Creatis software - clitk.git/blobdiff - itk/clitkSegmentationUtils.h
changes in license header
[clitk.git] / itk / clitkSegmentationUtils.h
index 6fa67aa4ebed30d25a02b5f7faf3156948eb7eac..fcc7f2840ac88d2fd8d29742b94c63e29807e65e 100644 (file)
@@ -3,7 +3,7 @@
 
   Authors belong to: 
   - University of LYON              http://www.universite-lyon.fr/
-  - Léon Bérard cancer center       http://oncora1.lyon.fnclcc.fr
+  - Léon Bérard cancer center       http://www.centreleonberard.fr
   - CREATIS CNRS laboratory         http://www.creatis.insa-lyon.fr
 
   This software is distributed WITHOUT ANY WARRANTY; without even
@@ -14,7 +14,7 @@
 
   - BSD        See included LICENSE.txt file
   - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
-  ======================================================================-====*/
+  ===========================================================================**/
 
 #ifndef CLITKSEGMENTATIONUTILS_H
 #define CLITKSEGMENTATIONUTILS_H
@@ -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"