]> Creatis software - clitk.git/blobdiff - itk/clitkSegmentationUtils.h
Merge branch 'master' of /home/dsarrut/clitk3.server
[clitk.git] / itk / clitkSegmentationUtils.h
index fcc7f2840ac88d2fd8d29742b94c63e29807e65e..7ae1c77515679e5d976982268a7cab7acb2d4369 100644 (file)
@@ -3,7 +3,7 @@
 
   Authors belong to: 
   - University of LYON              http://www.universite-lyon.fr/
-  - Léon Bérard cancer center       http://www.centreleonberard.fr
+  - Léon Bérard cancer center       http://oncora1.lyon.fnclcc.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
@@ -192,23 +192,33 @@ namespace clitk {
                         typename ImageType::PixelType BG=0);
   template<class ImageType>
   typename ImageType::Pointer
-  CropImageAbove(const ImageType * image, 
-                 int dim, double min, bool autoCrop = false,
-                 typename ImageType::PixelType BG=0);
+  CropImageRemoveGreaterThan(const ImageType * image, 
+                             int dim, double min, bool autoCrop = false,
+                             typename ImageType::PixelType BG=0);
   template<class ImageType>
   typename ImageType::Pointer
-  CropImageBelow(const ImageType * image, 
-                 int dim, double max,bool autoCrop = false,
-                 typename ImageType::PixelType BG=0);
+  CropImageRemoveLowerThan(const ImageType * image, 
+                           int dim, double max,bool autoCrop = false,
+                           typename ImageType::PixelType BG=0);
   //--------------------------------------------------------------------
 
 
   //--------------------------------------------------------------------
+  template<class ImageType, class LabelType>
+  typename itk::LabelMap< itk::ShapeLabelObject<LabelType, ImageType::ImageDimension> >::Pointer
+  ComputeLabelMap(const ImageType * image, 
+                  typename ImageType::PixelType BG,                   
+                  bool computePerimeterFlag=false);
   template<class ImageType>
   void
   ComputeCentroids(const ImageType * image, 
                    typename ImageType::PixelType BG, 
                    std::vector<typename ImageType::PointType> & centroids);
+  template<class ImageType>
+  void
+  ComputeCentroids2(const ImageType * image, 
+                   typename ImageType::PixelType BG, 
+                   std::vector<typename ImageType::PointType> & centroids);
   //--------------------------------------------------------------------
 
 
@@ -258,14 +268,20 @@ namespace clitk {
     
     typedef std::map<int, PointType2D> MapPoint2DType;
     typedef std::vector<PointType3D> VectorPoint3DType;
+    typedef std::vector<PointType2D> VectorPoint2DType;
+
   public:
     static void Convert2DTo3D(const PointType2D & p2D, 
                               const ImageType * image, 
                               const int slice, 
                               PointType3D & p3D);
-    static void Convert2DTo3DList(const MapPoint2DType & map, 
+    static void Convert2DMapTo3DList(const MapPoint2DType & map, 
                                   const ImageType * image, 
                                   VectorPoint3DType & list);
+    static void Convert2DListTo3DList(const VectorPoint2DType & p, 
+                                      int slice,
+                                      const ImageType * image, 
+                                      VectorPoint3DType & list);
   };
 
   //--------------------------------------------------------------------
@@ -297,6 +313,15 @@ namespace clitk {
          bool extendSupport);
   //--------------------------------------------------------------------
 
+
+  //--------------------------------------------------------------------
+  template<class ImageType>
+  typename ImageType::Pointer 
+  Opening(const ImageType * image, typename ImageType::SizeType radius,
+          typename ImageType::PixelType BG, typename ImageType::PixelType FG);
+  //--------------------------------------------------------------------
+
+
   //--------------------------------------------------------------------
   template<class ValueType, class VectorType>
   void ConvertOption(std::string optionName, uint given, 
@@ -378,6 +403,22 @@ namespace clitk {
   //--------------------------------------------------------------------
 
 
+  //--------------------------------------------------------------------
+  template<class ImageType>
+  typename ImageType::Pointer
+  SliceBySliceKeepMainCCL(const ImageType * input, 
+                          typename ImageType::PixelType BG,
+                          typename ImageType::PixelType FG);
+  //--------------------------------------------------------------------
+  
+
+  //--------------------------------------------------------------------
+  template<class ImageType>
+  typename ImageType::Pointer
+  Clone(const ImageType * input);
+  //--------------------------------------------------------------------
+  
+
 }
 
 #include "clitkSegmentationUtils.txx"