]> Creatis software - clitk.git/commitdiff
Fix for bug #274: move JoinSlices definition in .h
authorsrit <srit>
Mon, 28 Mar 2011 07:37:25 +0000 (07:37 +0000)
committersrit <srit>
Mon, 28 Mar 2011 07:37:25 +0000 (07:37 +0000)
itk/clitkSegmentationUtils.h
itk/clitkSegmentationUtils.txx
segmentation/clitkExtractPatientFilter.txx

index 6f4deb4c01726349b756449770023d7d29f2e825..468f9d891a6bc0a919a5d95a8de8a249f2c3c85f 100644 (file)
@@ -26,6 +26,7 @@
 
 // itk
 #include <itkBoundingBox.h>
+#include <itkJoinSeriesImageFilter.h>
 
 /*
   According to 
@@ -221,11 +222,23 @@ namespace clitk {
 
 
   //--------------------------------------------------------------------
-  //template<class ImageType>
-  //typename ImageType::Pointer
-  //JoinSlices(std::vector<typename itk::Image<typename ImageType::PixelType, 
-  //                                           ImageType::ImageDimension-1>::Pointer > & slices, 
-        //    const ImageType * input, int dim);
+  template<class ImageType>
+  typename ImageType::Pointer
+  JoinSlices(std::vector<typename itk::Image<typename ImageType::PixelType, 
+                                             ImageType::ImageDimension-1>::Pointer > & slices, 
+             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();
+  }
   //--------------------------------------------------------------------
 
 
index 3da1802b601169925717ace6c3c1528cc48a802b..2b5f6853229a75b05d1e3fbdf23050079cd7dd72 100644 (file)
@@ -535,27 +535,6 @@ namespace clitk {
   //--------------------------------------------------------------------
 
 
-  //--------------------------------------------------------------------
-  template<class ImageType>
-  typename ImageType::Pointer
-  JoinSlices(std::vector<typename itk::Image<typename ImageType::PixelType, 
-                                             ImageType::ImageDimension-1>::Pointer > & slices, 
-             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();
-  }
-  //--------------------------------------------------------------------
-
-
   //--------------------------------------------------------------------
   template<class ImageType>
   void
index 61de51df11fa7740aaab13951f05c15e8cc4d40f..54d741f18f5dcdd0c5fd5e891938eb1750f90b01 100644 (file)
@@ -25,6 +25,7 @@
 #include "clitkDecomposeAndReconstructImageFilter.h"
 #include "clitkAutoCropFilter.h"
 #include "clitkMemoryUsage.h"
+#include "clitkSegmentationUtils.h"
 
 // itk
 #include "itkBinaryThresholdImageFilter.h"