X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=itk%2FclitkSliceBySliceRelativePositionFilter.h;h=35b3b8d88afefefa7edba6a1b96eeea29637ffc4;hb=70138676c09cc565c9909cb617e900cc11a53269;hp=01f9cd9c833578d802af33e96ba39d0c6cfa43f7;hpb=f34fdef46fa656a1eb32271c0b9bf7d81bc7fc35;p=clitk.git diff --git a/itk/clitkSliceBySliceRelativePositionFilter.h b/itk/clitkSliceBySliceRelativePositionFilter.h index 01f9cd9..35b3b8d 100644 --- a/itk/clitkSliceBySliceRelativePositionFilter.h +++ b/itk/clitkSliceBySliceRelativePositionFilter.h @@ -3,7 +3,7 @@ Authors belong to: - University of LYON http://www.universite-lyon.fr/ - - Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr + - Léon Bérard cancer center http://www.centreleonberard.fr - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr This software is distributed WITHOUT ANY WARRANTY; without even @@ -14,13 +14,14 @@ - BSD See included LICENSE.txt file - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html - ======================================================================-====*/ + ===========================================================================**/ #ifndef CLITKSLICEBYSLICERELATIVEPOSITIONFILTER_H #define CLITKSLICEBYSLICERELATIVEPOSITIONFILTER_H // clitk #include "clitkFilterBase.h" +#include "clitkAddRelativePositionConstraintToLabelImageFilter.h" namespace clitk { @@ -32,13 +33,12 @@ namespace clitk { template class ITK_EXPORT SliceBySliceRelativePositionFilter: - public clitk::FilterBase, - public itk::ImageToImageFilter + public AddRelativePositionConstraintToLabelImageFilter { public: /** Standard class typedefs. */ - typedef itk::ImageToImageFilter Superclass; + typedef AddRelativePositionConstraintToLabelImageFilter Superclass; typedef SliceBySliceRelativePositionFilter Self; typedef itk::SmartPointer Pointer; typedef itk::SmartPointer ConstPointer; @@ -50,6 +50,10 @@ namespace clitk { itkTypeMacro(SliceBySliceRelativePositionFilter, ImageToImageFilter); FILTERBASE_INIT; + /** ImageDimension constants */ + itkStaticConstMacro(ImageDimension, unsigned int, ImageType::ImageDimension); + typedef itk::Image FloatImageType; + /** Some convenient typedefs. */ typedef typename ImageType::ConstPointer ImageConstPointer; typedef typename ImageType::Pointer ImagePointer; @@ -57,28 +61,35 @@ namespace clitk { typedef typename ImageType::PixelType PixelType; typedef typename ImageType::SpacingType SpacingType; typedef typename ImageType::SizeType SizeType; + typedef itk::Image SliceType; + typedef clitk::AddRelativePositionConstraintToLabelImageFilter RelPosFilterType; + typedef typename RelPosFilterType::OrientationTypeEnumeration OrientationTypeEnumeration; - /** ImageDimension constants */ - itkStaticConstMacro(ImageDimension, unsigned int, ImageType::ImageDimension); - typedef itk::Image FloatImageType; - /** Input : initial image and object */ void SetInput(const ImageType * image); void SetInputObject(const ImageType * image); - + // Options + void PrintOptions(); itkGetConstMacro(Direction, int); itkSetMacro(Direction, int); - itkGetConstMacro(ObjectBackgroundValue, PixelType); - itkSetMacro(ObjectBackgroundValue, PixelType); + + itkGetConstMacro(UniqueConnectedComponentBySlice, bool); + itkSetMacro(UniqueConnectedComponentBySlice, bool); + itkBooleanMacro(UniqueConnectedComponentBySlice); + + itkGetConstMacro(IgnoreEmptySliceObjectFlag, bool); + itkSetMacro(IgnoreEmptySliceObjectFlag, bool); + itkBooleanMacro(IgnoreEmptySliceObjectFlag); + + itkGetConstMacro(UseASingleObjectConnectedComponentBySliceFlag, bool); + itkSetMacro(UseASingleObjectConnectedComponentBySliceFlag, bool); + itkBooleanMacro(UseASingleObjectConnectedComponentBySliceFlag); protected: SliceBySliceRelativePositionFilter(); virtual ~SliceBySliceRelativePositionFilter() {} - int m_Direction; - PixelType m_ObjectBackgroundValue; - virtual void GenerateOutputInformation(); virtual void GenerateInputRequestedRegion(); virtual void GenerateData(); @@ -87,6 +98,10 @@ namespace clitk { ImagePointer object; ImagePointer m_working_input; ImagePointer m_working_object; + bool m_UniqueConnectedComponentBySlice; + int m_Direction; + bool m_IgnoreEmptySliceObjectFlag; + bool m_UseASingleObjectConnectedComponentBySliceFlag; private: SliceBySliceRelativePositionFilter(const Self&); //purposely not implemented