X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=itk%2FclitkSegmentationUtils.h;h=5ac8c4c51e86c2d7b5345fcefda25ea8ba8b3ec0;hb=5f801bf0b07486889123e941d6913d4369dfc86f;hp=f58b7c432a95339c5427d05c62f250801c6554f1;hpb=32539f6a33f6a97a8493a1fa11360d09be843a4c;p=clitk.git diff --git a/itk/clitkSegmentationUtils.h b/itk/clitkSegmentationUtils.h index f58b7c4..5ac8c4c 100644 --- a/itk/clitkSegmentationUtils.h +++ b/itk/clitkSegmentationUtils.h @@ -28,6 +28,7 @@ // itk #include #include +#include /* According to @@ -38,25 +39,6 @@ namespace clitk { //-------------------------------------------------------------------- - template - void ComputeBBFromImageRegion(const ImageType * image, - typename ImageType::RegionType region, - typename itk::BoundingBox::Pointer bb); - - //-------------------------------------------------------------------- - template - void ComputeBBIntersection(typename itk::BoundingBox::Pointer bbo, - typename itk::BoundingBox::Pointer bbi1, - typename itk::BoundingBox::Pointer bbi2); - - //-------------------------------------------------------------------- - template - void ComputeRegionFromBB(const ImageType * image, - const typename itk::BoundingBox::Pointer bb, - typename ImageType::RegionType & region); - //-------------------------------------------------------------------- template typename TInternalImageType::Pointer SetBackground(const TInternalImageType * input, @@ -103,11 +85,13 @@ namespace clitk { template typename ImageType::Pointer AutoCrop(const ImageType * input, - typename ImageType::PixelType BG) { + typename ImageType::PixelType BG, + const bool useBorderFlag=false) { typedef clitk::AutoCropFilter AutoCropFilterType; typename AutoCropFilterType::Pointer autoCropFilter = AutoCropFilterType::New(); autoCropFilter->SetInput(input); autoCropFilter->SetBackgroundValue(BG); + autoCropFilter->SetUseBorder(useBorderFlag); autoCropFilter->Update(); return autoCropFilter->GetOutput(); } @@ -136,13 +120,6 @@ namespace clitk { int minimalComponentSize, LabelizeParameters * param); - //-------------------------------------------------------------------- - template - typename ImageType::Pointer - ResizeImageLike(const ImageType * input, - const itk::ImageBase * like, - typename ImageType::PixelType BG); - //-------------------------------------------------------------------- template @@ -156,6 +133,18 @@ namespace clitk { double spacing=-1, bool autocropflag=true, bool singleObjectCCL=true); + template + typename MaskImageType::Pointer + SliceBySliceRelativePosition(const MaskImageType * input, + const MaskImageType * object, + int direction, + double threshold, + double angle, + bool inverseflag, + bool uniqueConnectedComponent=false, + double spacing=-1, + bool autocropflag=true, + bool singleObjectCCL=true); //-------------------------------------------------------------------- // In a binary image, search for the point belonging to the FG that @@ -247,7 +236,7 @@ namespace clitk { typename ImageType::Pointer JoinSlices(std::vector::Pointer > & slices, - const ImageType * input, + const itk::ImageBase * input, //const ImageType * input, int direction) { typedef typename itk::Image SliceType; typedef itk::JoinSeriesImageFilter JoinSeriesFilterType; @@ -350,7 +339,16 @@ namespace clitk { std::vector & lB, typename ImageType::PixelType BG, int mainDirection, - double offsetToKeep); + double offsetToKeep, + bool keepIfEqual=false); + template + void + SliceBySliceSetBackgroundFromLineSeparation_pt(ImageType * input, + std::vector & lA, + std::vector & lB, + typename ImageType::PixelType BG, + typename ImageType::PointType offsetToKeep, + bool keepIfEqual=false); //-------------------------------------------------------------------- @@ -419,6 +417,14 @@ namespace clitk { double margin, std::vector & A, std::vector & B); + template + void + SliceBySliceBuildLineSegmentAccordingToMinimalDistanceBetweenStructures(const ImageType * S1, + const ImageType * S2, + typename ImageType::PixelType BG, + int sliceDimension, + std::vector & A, + std::vector & B); //-------------------------------------------------------------------- @@ -476,7 +482,30 @@ namespace clitk { typename ImageType::PointType & max); //-------------------------------------------------------------------- -} + + //-------------------------------------------------------------------- + template + typename itk::Image::Pointer//void + DistanceMap(const ImageType * input, typename ImageType::PixelType BG);//, + //-------------------------------------------------------------------- + + + //-------------------------------------------------------------------- + template + typename ImageType::PointType + ComputeClosestPoint(const ImageType * input, + const itk::Image * dmap, + typename ImageType::PixelType & BG); + //-------------------------------------------------------------------- + + //-------------------------------------------------------------------- + template + typename ImageType::Pointer + RemoveNegativeIndexFromRegion(ImageType * input); + //-------------------------------------------------------------------- + + +} // end clitk namespace #include "clitkSegmentationUtils.txx"