X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=segmentation%2FclitkExtractBonesFilter.h;h=e803e5a64fb6ce47f51613bd5d661fcf1c74dc41;hb=76fd7b0cf57d90c2cd410ea0f6fb788429e66369;hp=70daa482868c30f5725c1533cab5c9b5dba66bfe;hpb=6e16222234a90c6079a8f4696c92de7349a496bb;p=clitk.git diff --git a/segmentation/clitkExtractBonesFilter.h b/segmentation/clitkExtractBonesFilter.h index 70daa48..e803e5a 100644 --- a/segmentation/clitkExtractBonesFilter.h +++ b/segmentation/clitkExtractBonesFilter.h @@ -24,6 +24,7 @@ #include "clitkDecomposeAndReconstructImageFilter.h" #include "clitkExplosionControlledThresholdConnectedImageFilter.h" #include "clitkSegmentationUtils.h" +#include "clitkFilterWithAnatomicalFeatureDatabaseManagement.h" // itk #include "itkStatisticsImageFilter.h" @@ -36,18 +37,21 @@ namespace clitk { */ //-------------------------------------------------------------------- - template + template class ITK_EXPORT ExtractBonesFilter: - public clitk::FilterBase, - public itk::ImageToImageFilter + public virtual clitk::FilterBase, + public clitk::FilterWithAnatomicalFeatureDatabaseManagement, + public itk::ImageToImageFilter > { public: /** Standard class typedefs. */ - typedef ExtractBonesFilter Self; - typedef itk::ImageToImageFilter Superclass; - typedef itk::SmartPointer Pointer; - typedef itk::SmartPointer ConstPointer; + typedef itk::Image MaskImageType; + typedef ExtractBonesFilter Self; + typedef itk::ImageToImageFilter Superclass; + typedef itk::SmartPointer Pointer; + typedef itk::SmartPointer ConstPointer; /** Method for creation through the object factory. */ itkNewMacro(Self); @@ -65,13 +69,12 @@ namespace clitk { typedef typename InputImageType::SizeType InputImageSizeType; typedef typename InputImageType::IndexType InputImageIndexType; - typedef TOutputImageType OutputImageType; - typedef typename OutputImageType::ConstPointer OutputImageConstPointer; - typedef typename OutputImageType::Pointer OutputImagePointer; - typedef typename OutputImageType::RegionType OutputImageRegionType; - typedef typename OutputImageType::PixelType OutputImagePixelType; - typedef typename OutputImageType::SizeType OutputImageSizeType; - typedef typename OutputImageType::IndexType OutputImageIndexType; + typedef typename MaskImageType::ConstPointer MaskImageConstPointer; + typedef typename MaskImageType::Pointer MaskImagePointer; + typedef typename MaskImageType::RegionType MaskImageRegionType; + typedef typename MaskImageType::PixelType MaskImagePixelType; + typedef typename MaskImageType::SizeType MaskImageSizeType; + typedef typename MaskImageType::IndexType MaskImageIndexType; itkStaticConstMacro(ImageDimension, unsigned int, InputImageType::ImageDimension); typedef int InternalPixelType; @@ -88,12 +91,17 @@ namespace clitk { void SetArgsInfo(ArgsInfoType arg); // Background / Foreground - itkGetConstMacro(BackgroundValue, OutputImagePixelType); - itkGetConstMacro(ForegroundValue, OutputImagePixelType); + itkGetConstMacro(BackgroundValue, MaskImagePixelType); + itkGetConstMacro(ForegroundValue, MaskImagePixelType); itkSetMacro(MinimalComponentSize, int); itkGetConstMacro(MinimalComponentSize, int); GGO_DefineOption(minSize, SetMinimalComponentSize, int); + + // Output filename (for AFBD) + itkSetMacro(OutputBonesFilename, std::string); + itkGetMacro(OutputBonesFilename, std::string); + GGO_DefineOption(output, SetOutputBonesFilename, std::string); // Step 0 itkBooleanMacro(InitialSmoothing); @@ -153,17 +161,17 @@ namespace clitk { itkSetMacro(AutoCrop, bool); itkGetConstMacro(AutoCrop, bool); itkBooleanMacro(AutoCrop); - GGO_DefineOption_Flag(autoCrop, SetAutoCrop); + GGO_DefineOption_Flag(noAutoCrop, SetAutoCrop); protected: ExtractBonesFilter(); virtual ~ExtractBonesFilter() {} // Global options - itkSetMacro(BackgroundValue, OutputImagePixelType); - itkSetMacro(ForegroundValue, OutputImagePixelType); - OutputImagePixelType m_BackgroundValue; - OutputImagePixelType m_ForegroundValue; + itkSetMacro(BackgroundValue, MaskImagePixelType); + itkSetMacro(ForegroundValue, MaskImagePixelType); + MaskImagePixelType m_BackgroundValue; + MaskImagePixelType m_ForegroundValue; bool m_AutoCrop; // Step 0 : Initial Filtering @@ -194,9 +202,10 @@ namespace clitk { void ExtractBones(); void RemoveTrachea(); void BonesSeparation(); + std::string m_OutputBonesFilename; InputImageConstPointer input; InputImagePointer filtered_input; - OutputImageConstPointer patient; + MaskImageConstPointer patient; InputImagePointer working_input; typename InternalImageType::Pointer working_image; typename InternalImageType::Pointer trachea;