X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=itk%2FclitkSegmentationUtils.h;h=7ae1c77515679e5d976982268a7cab7acb2d4369;hb=f4836557301d6fafe12dd9f767f911796992f855;hp=fcc7f2840ac88d2fd8d29742b94c63e29807e65e;hpb=765020625fbc092d283e221e36c83e60a1844cb7;p=clitk.git diff --git a/itk/clitkSegmentationUtils.h b/itk/clitkSegmentationUtils.h index fcc7f28..7ae1c77 100644 --- a/itk/clitkSegmentationUtils.h +++ b/itk/clitkSegmentationUtils.h @@ -3,7 +3,7 @@ Authors belong to: - University of LYON http://www.universite-lyon.fr/ - - Léon Bérard cancer center http://www.centreleonberard.fr + - Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr This software is distributed WITHOUT ANY WARRANTY; without even @@ -14,7 +14,7 @@ - BSD See included LICENSE.txt file - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html - ===========================================================================**/ + ======================================================================-====*/ #ifndef CLITKSEGMENTATIONUTILS_H #define CLITKSEGMENTATIONUTILS_H @@ -192,23 +192,33 @@ namespace clitk { typename ImageType::PixelType BG=0); template typename ImageType::Pointer - CropImageAbove(const ImageType * image, - int dim, double min, bool autoCrop = false, - typename ImageType::PixelType BG=0); + CropImageRemoveGreaterThan(const ImageType * image, + int dim, double min, bool autoCrop = false, + typename ImageType::PixelType BG=0); template typename ImageType::Pointer - CropImageBelow(const ImageType * image, - int dim, double max,bool autoCrop = false, - typename ImageType::PixelType BG=0); + CropImageRemoveLowerThan(const ImageType * image, + int dim, double max,bool autoCrop = false, + typename ImageType::PixelType BG=0); //-------------------------------------------------------------------- //-------------------------------------------------------------------- + template + typename itk::LabelMap< itk::ShapeLabelObject >::Pointer + ComputeLabelMap(const ImageType * image, + typename ImageType::PixelType BG, + bool computePerimeterFlag=false); template void ComputeCentroids(const ImageType * image, typename ImageType::PixelType BG, std::vector & centroids); + template + void + ComputeCentroids2(const ImageType * image, + typename ImageType::PixelType BG, + std::vector & centroids); //-------------------------------------------------------------------- @@ -258,14 +268,20 @@ namespace clitk { typedef std::map MapPoint2DType; typedef std::vector VectorPoint3DType; + typedef std::vector VectorPoint2DType; + public: static void Convert2DTo3D(const PointType2D & p2D, const ImageType * image, const int slice, PointType3D & p3D); - static void Convert2DTo3DList(const MapPoint2DType & map, + static void Convert2DMapTo3DList(const MapPoint2DType & map, const ImageType * image, VectorPoint3DType & list); + static void Convert2DListTo3DList(const VectorPoint2DType & p, + int slice, + const ImageType * image, + VectorPoint3DType & list); }; //-------------------------------------------------------------------- @@ -297,6 +313,15 @@ namespace clitk { bool extendSupport); //-------------------------------------------------------------------- + + //-------------------------------------------------------------------- + template + typename ImageType::Pointer + Opening(const ImageType * image, typename ImageType::SizeType radius, + typename ImageType::PixelType BG, typename ImageType::PixelType FG); + //-------------------------------------------------------------------- + + //-------------------------------------------------------------------- template void ConvertOption(std::string optionName, uint given, @@ -378,6 +403,22 @@ namespace clitk { //-------------------------------------------------------------------- + //-------------------------------------------------------------------- + template + typename ImageType::Pointer + SliceBySliceKeepMainCCL(const ImageType * input, + typename ImageType::PixelType BG, + typename ImageType::PixelType FG); + //-------------------------------------------------------------------- + + + //-------------------------------------------------------------------- + template + typename ImageType::Pointer + Clone(const ImageType * input); + //-------------------------------------------------------------------- + + } #include "clitkSegmentationUtils.txx"