X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=itk%2FclitkSegmentationUtils.h;h=5ac8c4c51e86c2d7b5345fcefda25ea8ba8b3ec0;hb=ad4ece7dc0107e7ed2dfff895321a02f5051bce9;hp=cd1612aa8f513ba371ced207fbd270d6f9f38b92;hpb=f68e31d5cd757b71d9c0740f8699d7a3a5586403;p=clitk.git diff --git a/itk/clitkSegmentationUtils.h b/itk/clitkSegmentationUtils.h index cd1612a..5ac8c4c 100644 --- a/itk/clitkSegmentationUtils.h +++ b/itk/clitkSegmentationUtils.h @@ -28,6 +28,7 @@ // itk #include #include +#include /* According to @@ -84,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(); } @@ -130,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 @@ -324,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); //-------------------------------------------------------------------- @@ -474,7 +498,12 @@ namespace clitk { typename ImageType::PixelType & BG); //-------------------------------------------------------------------- - + //-------------------------------------------------------------------- + template + typename ImageType::Pointer + RemoveNegativeIndexFromRegion(ImageType * input); + //-------------------------------------------------------------------- + } // end clitk namespace