]> Creatis software - clitk.git/blobdiff - itk/clitkSegmentationUtils.h
Add "Or" function
[clitk.git] / itk / clitkSegmentationUtils.h
index 7ae1c77515679e5d976982268a7cab7acb2d4369..f58b7c432a95339c5427d05c62f250801c6554f1 100644 (file)
@@ -23,6 +23,7 @@
 #include "clitkCommon.h"
 #include "clitkAutoCropFilter.h"
 #include "clitkLabelizeParameters.h"
+#include "clitkExtractSliceFilter.h"
 
 // itk
 #include <itkBoundingBox.h>
@@ -225,9 +226,19 @@ namespace clitk {
   //--------------------------------------------------------------------
   template<class ImageType>
   void
-  ExtractSlices(const ImageType * image, int dim, 
-               std::vector< typename itk::Image<typename ImageType::PixelType, 
-                                                 ImageType::ImageDimension-1>::Pointer > & slices);
+  ExtractSlices(const ImageType * image, int direction,
+                std::vector<typename itk::Image<typename ImageType::PixelType,
+                                                ImageType::ImageDimension-1>::Pointer > & slices)
+  {
+    typedef ExtractSliceFilter<ImageType> ExtractSliceFilterType;
+    typedef typename ExtractSliceFilterType::SliceType SliceType;
+    typename ExtractSliceFilterType::Pointer
+      extractSliceFilter = ExtractSliceFilterType::New();
+    extractSliceFilter->SetInput(image);
+    extractSliceFilter->SetDirection(direction);
+    extractSliceFilter->Update();
+    extractSliceFilter->GetOutputSlices(slices);
+  }
   //--------------------------------------------------------------------
 
 
@@ -348,6 +359,14 @@ namespace clitk {
   void AndNot(ImageType * input, 
               const ImageType * object, 
               typename ImageType::PixelType BG=0);
+  template<class ImageType>
+  void And(ImageType * input, 
+           const ImageType * object, 
+           typename ImageType::PixelType BG=0);
+  template<class ImageType>
+  void Or(ImageType * input, 
+          const ImageType * object, 
+          typename ImageType::PixelType BG=0);
   //--------------------------------------------------------------------
  
 
@@ -419,6 +438,44 @@ namespace clitk {
   //--------------------------------------------------------------------
   
 
+  //--------------------------------------------------------------------
+  template<class ImageType>
+  typename ImageType::Pointer
+  SliceBySliceSetBackgroundFromSingleLine(const ImageType * input, 
+                                          typename ImageType::PixelType BG, 
+                                          typename ImageType::PointType & A, 
+                                          typename ImageType::PointType & B, 
+                                          int dim1, int dim2, bool removeLowerPartFlag);
+  //--------------------------------------------------------------------
+  
+
+  //--------------------------------------------------------------------
+  template<class ImageType>
+  typename ImageType::Pointer
+  SliceBySliceSetBackgroundFromPoints(const ImageType * input, 
+                                      typename ImageType::PixelType BG, 
+                                      int sliceDim,
+                                      std::vector<typename ImageType::PointType> & A, 
+                                      bool removeGreaterThanXFlag,
+                                      bool removeGreaterThanYFlag);
+  //--------------------------------------------------------------------
+
+
+  //--------------------------------------------------------------------
+  template<class ImageType>
+  void
+  FillRegionWithValue(ImageType * input, typename ImageType::PixelType value, 
+                      typename ImageType::RegionType & region);
+  //--------------------------------------------------------------------
+
+
+  //--------------------------------------------------------------------
+  template<class ImageType>
+  void
+  GetMinMaxBoundary(ImageType * input, typename ImageType::PointType & min, 
+                    typename ImageType::PointType & max);
+  //--------------------------------------------------------------------
+
 }
 
 #include "clitkSegmentationUtils.txx"