]> Creatis software - clitk.git/commitdiff
Fix for bug #274: move ExtractSlices definition in .h
authorSimon Rit <simon.rit@creatis.insa-lyon.fr>
Sat, 18 Jun 2011 16:07:14 +0000 (18:07 +0200)
committerSimon Rit <simon.rit@creatis.insa-lyon.fr>
Sat, 18 Jun 2011 16:07:14 +0000 (18:07 +0200)
itk/clitkSegmentationUtils.h
itk/clitkSegmentationUtils.txx

index 7ae1c77515679e5d976982268a7cab7acb2d4369..bbc1f62f32e4d9604af1d902d01f76e22061ff06 100644 (file)
@@ -225,9 +225,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);
+  }
   //--------------------------------------------------------------------
 
 
index 4990b247c2b85dac1e342b77dc64901c80c553f6..b432188aec93aa8e34a21f1047ea3d22991a2c25 100644 (file)
@@ -466,7 +466,7 @@ namespace clitk {
     p[dim] = max;
     typename ImageType::IndexType end;
     image->TransformPhysicalPointToIndex(p, end);
-    size[dim] = fabs(end[dim]-start[dim]);
+    size[dim] = abs(end[dim]-start[dim]);
     region.SetIndex(start);
     region.SetSize(size);
   
@@ -585,25 +585,6 @@ namespace clitk {
   //--------------------------------------------------------------------
 
 
-  //--------------------------------------------------------------------
-  template<class ImageType>
-  void
-  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);
-  }
-  //--------------------------------------------------------------------
-
-
   //--------------------------------------------------------------------
   template<class ImageType>
   void