]> Creatis software - clitk.git/commitdiff
Remove ResizeImageLike (put in CropLikeImageFilter) and BoundingBox (put in clitkBoun...
authorDavid Sarrut <david.sarrut@gmail.com>
Wed, 19 Oct 2011 13:12:12 +0000 (15:12 +0200)
committerDavid Sarrut <david.sarrut@gmail.com>
Wed, 19 Oct 2011 13:12:12 +0000 (15:12 +0200)
itk/clitkSegmentationUtils.h
itk/clitkSegmentationUtils.txx

index 70388fe6cdb7380511bbda45373abd7f71a1200a..cd1612aa8f513ba371ced207fbd270d6f9f38b92 100644 (file)
 namespace clitk {
 
   //--------------------------------------------------------------------
-  template<class ImageType>
-  void ComputeBBFromImageRegion(const ImageType * image, 
-                                typename ImageType::RegionType region,
-                                typename itk::BoundingBox<unsigned long, 
-                                                          ImageType::ImageDimension>::Pointer bb);
-  
-  //--------------------------------------------------------------------
-  template<int Dimension>
-  void ComputeBBIntersection(typename itk::BoundingBox<unsigned long, Dimension>::Pointer bbo, 
-                             typename itk::BoundingBox<unsigned long, Dimension>::Pointer bbi1, 
-                             typename itk::BoundingBox<unsigned long, Dimension>::Pointer bbi2);
-
-  //--------------------------------------------------------------------
-  template<class ImageType>
-  void ComputeRegionFromBB(const ImageType * image, 
-                           const typename itk::BoundingBox<unsigned long, 
-                                                           ImageType::ImageDimension>::Pointer bb, 
-                           typename ImageType::RegionType & region);
-  //--------------------------------------------------------------------
   template<class TInternalImageType, class TMaskInternalImageType>
   typename TInternalImageType::Pointer
   SetBackground(const TInternalImageType * input,
@@ -136,13 +117,6 @@ namespace clitk {
                           int minimalComponentSize,
                           LabelizeParameters<typename TImageType::PixelType> * param);
 
-  //--------------------------------------------------------------------
-  template<class ImageType>
-  typename ImageType::Pointer
-  ResizeImageLike(const ImageType * input,
-                  const itk::ImageBase<ImageType::ImageDimension> * like, 
-                  typename ImageType::PixelType BG);
-
 
   //--------------------------------------------------------------------
   template<class MaskImageType>
index 2f0d935a7cbbc88d038000768d6bed04bfd2451f..3022ad25f7a9844f07102dd06bfb59e5916659b0 100644 (file)
 
 namespace clitk {
 
-  //--------------------------------------------------------------------
-  template<class ImageType>
-  void ComputeBBFromImageRegion(const ImageType * image, 
-                                typename ImageType::RegionType region,
-                                typename itk::BoundingBox<unsigned long, 
-                                ImageType::ImageDimension>::Pointer bb) {
-    typedef typename ImageType::IndexType IndexType;
-    IndexType firstIndex;
-    IndexType lastIndex;
-    for(unsigned int i=0; i<image->GetImageDimension(); i++) {
-      firstIndex[i] = region.GetIndex()[i];
-      lastIndex[i] = firstIndex[i]+region.GetSize()[i];
-    }
-
-    typedef itk::BoundingBox<unsigned long, 
-                             ImageType::ImageDimension> BBType;
-    typedef typename BBType::PointType PointType;
-    PointType lastPoint;
-    PointType firstPoint;
-    image->TransformIndexToPhysicalPoint(firstIndex, firstPoint);
-    image->TransformIndexToPhysicalPoint(lastIndex, lastPoint);
-
-    bb->SetMaximum(lastPoint);
-    bb->SetMinimum(firstPoint);
-  }
-  //--------------------------------------------------------------------
-
-
-  //--------------------------------------------------------------------
-  template<int Dimension>
-  void ComputeBBIntersection(typename itk::BoundingBox<unsigned long, Dimension>::Pointer bbo, 
-                             typename itk::BoundingBox<unsigned long, Dimension>::Pointer bbi1, 
-                             typename itk::BoundingBox<unsigned long, Dimension>::Pointer bbi2) {
-
-    typedef itk::BoundingBox<unsigned long, Dimension> BBType;
-    typedef typename BBType::PointType PointType;
-    PointType lastPoint;
-    PointType firstPoint;
-
-    for(unsigned int i=0; i<Dimension; i++) {
-      firstPoint[i] = std::max(bbi1->GetMinimum()[i], 
-                               bbi2->GetMinimum()[i]);
-      lastPoint[i] = std::min(bbi1->GetMaximum()[i], 
-                              bbi2->GetMaximum()[i]);
-    }
-
-    bbo->SetMaximum(lastPoint);
-    bbo->SetMinimum(firstPoint);
-  }
-  //--------------------------------------------------------------------
-
-
-  //--------------------------------------------------------------------
-  template<class ImageType>
-  void ComputeRegionFromBB(const ImageType * image, 
-                           const typename itk::BoundingBox<unsigned long, 
-                                                           ImageType::ImageDimension>::Pointer bb, 
-                           typename ImageType::RegionType & region) {
-    // Types
-    typedef typename ImageType::IndexType  IndexType;
-    typedef typename ImageType::PointType  PointType;
-    typedef typename ImageType::RegionType RegionType;
-    typedef typename ImageType::SizeType   SizeType;
-
-    // Region starting point
-    IndexType regionStart;
-    PointType start = bb->GetMinimum();
-    image->TransformPhysicalPointToIndex(start, regionStart);
-    
-    // Region size
-    SizeType regionSize;
-    PointType maxs = bb->GetMaximum();
-    PointType mins = bb->GetMinimum();
-    for(unsigned int i=0; i<ImageType::ImageDimension; i++) {
-      regionSize[i] = lrint((maxs[i] - mins[i])/image->GetSpacing()[i]);
-    }
-   
-    // Create region
-    region.SetIndex(regionStart);
-    region.SetSize(regionSize);
-  }
-  //--------------------------------------------------------------------
-
   //--------------------------------------------------------------------
   template<class ImageType, class TMaskImageType>
   typename ImageType::Pointer
@@ -312,24 +229,6 @@ namespace clitk {
   //--------------------------------------------------------------------
 
 
-  //--------------------------------------------------------------------
-  template<class ImageType>
-  typename ImageType::Pointer
-  ResizeImageLike(const ImageType * input,                       
-                  const itk::ImageBase<ImageType::ImageDimension> * like, 
-                  typename ImageType::PixelType backgroundValue) 
-  {
-    typedef CropLikeImageFilter<ImageType> CropFilterType;
-    typename CropFilterType::Pointer cropFilter = CropFilterType::New();
-    cropFilter->SetInput(input);
-    cropFilter->SetCropLikeImage(like);
-    cropFilter->SetBackgroundValue(backgroundValue);
-    cropFilter->Update();
-    return cropFilter->GetOutput();  
-  }
-  //--------------------------------------------------------------------
-
-
   //--------------------------------------------------------------------
   template<class MaskImageType>
   typename MaskImageType::Pointer
@@ -343,7 +242,7 @@ namespace clitk {
                                bool autocropFlag, 
                                bool singleObjectCCL) 
   {
-    typedef SliceBySliceRelativePositionFilter<MaskImageType> SliceRelPosFilterType;
+    typedef clitk::SliceBySliceRelativePositionFilter<MaskImageType> SliceRelPosFilterType;
     typename SliceRelPosFilterType::Pointer sliceRelPosFilter = SliceRelPosFilterType::New();
     sliceRelPosFilter->VerboseStepFlagOff();
     sliceRelPosFilter->WriteStepFlagOff();