X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=itk%2FclitkAddRelativePositionConstraintToLabelImageFilter.h;h=781775f0cc9541c488ca0ddfa4b8566b8ddc9779;hb=6986b996d66273ab7818c12f51cbf5ae049ac04e;hp=83400ef5b47db4400c726e7a2f914234de6e6b09;hpb=de2db2051ac9b17a5e3e2b7dc34f42deea3f1526;p=clitk.git diff --git a/itk/clitkAddRelativePositionConstraintToLabelImageFilter.h b/itk/clitkAddRelativePositionConstraintToLabelImageFilter.h index 83400ef..781775f 100644 --- a/itk/clitkAddRelativePositionConstraintToLabelImageFilter.h +++ b/itk/clitkAddRelativePositionConstraintToLabelImageFilter.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,16 +14,17 @@ - BSD See included LICENSE.txt file - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html - ======================================================================-====*/ + ===========================================================================**/ #ifndef CLITKADDRELATIVEPOSITIONCONSTRAINTTOLABELIMAGEFILTER_H #define CLITKADDRELATIVEPOSITIONCONSTRAINTTOLABELIMAGEFILTER_H // clitk #include "clitkFilterBase.h" +#include "clitkCropLikeImageFilter.h" // itk -#include "itkPasteImageFilter.h" +#include // itk ENST #include "RelativePositionPropImageFilter.h" @@ -43,15 +44,15 @@ namespace clitk { */ //-------------------------------------------------------------------- - template + template class ITK_EXPORT AddRelativePositionConstraintToLabelImageFilter: public clitk::FilterBase, - public itk::ImageToImageFilter + public itk::ImageToImageFilter { public: /** Standard class typedefs. */ - typedef itk::ImageToImageFilter Superclass; + typedef itk::ImageToImageFilter Superclass; typedef AddRelativePositionConstraintToLabelImageFilter Self; typedef itk::SmartPointer Pointer; typedef itk::SmartPointer ConstPointer; @@ -64,16 +65,17 @@ namespace clitk { FILTERBASE_INIT; /** Some convenient typedefs. */ - typedef TImageType ImageType; typedef typename ImageType::ConstPointer ImageConstPointer; typedef typename ImageType::Pointer ImagePointer; typedef typename ImageType::RegionType RegionType; typedef typename ImageType::PixelType PixelType; typedef typename ImageType::SpacingType SpacingType; typedef typename ImageType::SizeType SizeType; + typedef typename ImageType::IndexType IndexType; + typedef typename ImageType::PointType PointType; /** ImageDimension constants */ - itkStaticConstMacro(ImageDimension, unsigned int, TImageType::ImageDimension); + itkStaticConstMacro(ImageDimension, unsigned int, ImageType::ImageDimension); typedef itk::Image FloatImageType; /** Orientation types */ @@ -87,45 +89,103 @@ namespace clitk { void SetInputObject(const ImageType * image); // Options - void SetOrientationType(OrientationTypeEnumeration orientation); - itkGetConstMacro(OrientationType, OrientationTypeEnumeration); - void SetAngle1(double a); - void SetAngle2(double a); - itkGetConstMacro(Angle1, double); - itkGetConstMacro(Angle2, double); - itkGetConstMacro(ResampleBeforeRelativePositionFilter, bool); - itkSetMacro(ResampleBeforeRelativePositionFilter, bool); - itkBooleanMacro(ResampleBeforeRelativePositionFilter); + void AddOrientationType(OrientationTypeEnumeration orientation); + void AddOrientationTypeString(std::string s); + void ClearOrientationType(); + void AddAnglesInRad(double a, double b); + void AddAnglesInDeg(double a, double b); + double GetAngle1InRad(int i) { return m_Angle1[i]; } + double GetAngle2InRad(int i) { return m_Angle2[i]; } + int GetNumberOfAngles(); + std::string GetOrientationTypeString(int i) { return m_OrientationTypeString[i]; } + std::vector & GetOrientationTypeString() { return m_OrientationTypeString; } + + itkGetConstMacro(IntermediateSpacingFlag, bool); + itkSetMacro(IntermediateSpacingFlag, bool); + itkBooleanMacro(IntermediateSpacingFlag); + itkGetConstMacro(IntermediateSpacing, double); itkSetMacro(IntermediateSpacing, double); + itkGetConstMacro(FuzzyThreshold, double); itkSetMacro(FuzzyThreshold, double); + itkGetConstMacro(BackgroundValue, PixelType); itkSetMacro(BackgroundValue, PixelType); + itkGetConstMacro(ObjectBackgroundValue, PixelType); itkSetMacro(ObjectBackgroundValue, PixelType); + itkGetConstMacro(AutoCropFlag, bool); + itkSetMacro(AutoCropFlag, bool); + itkBooleanMacro(AutoCropFlag); + + itkGetConstMacro(InverseOrientationFlag, bool); + itkSetMacro(InverseOrientationFlag, bool); + itkBooleanMacro(InverseOrientationFlag); + + itkGetConstMacro(RemoveObjectFlag, bool); + itkSetMacro(RemoveObjectFlag, bool); + itkBooleanMacro(RemoveObjectFlag); + + itkGetConstMacro(CombineWithOrFlag, bool); + itkSetMacro(CombineWithOrFlag, bool); + itkBooleanMacro(CombineWithOrFlag); + + itkGetConstMacro(FuzzyMapOnlyFlag, bool); + itkSetMacro(FuzzyMapOnlyFlag, bool); + itkBooleanMacro(FuzzyMapOnlyFlag); + + itkGetConstMacro(FastFlag, bool); + itkSetMacro(FastFlag, bool); + itkBooleanMacro(FastFlag); + + itkGetConstMacro(Radius, double); + itkSetMacro(Radius, double); + + itkSetMacro(K1, double); + itkGetMacro(K1, double); + + typename FloatImageType::Pointer GetFuzzyMap() { return m_FuzzyMap; } + + // I dont want to verify inputs information + virtual void VerifyInputInformation() { } + + // For debug + void PrintOptions(); + protected: AddRelativePositionConstraintToLabelImageFilter(); virtual ~AddRelativePositionConstraintToLabelImageFilter() {} - OrientationTypeEnumeration m_OrientationType; + std::vector m_OrientationType; + std::vector m_OrientationTypeString; double m_IntermediateSpacing; double m_FuzzyThreshold; PixelType m_BackgroundValue; PixelType m_ObjectBackgroundValue; - double m_Angle1; - double m_Angle2; - bool m_ResampleBeforeRelativePositionFilter; + std::vector m_Angle1; + std::vector m_Angle2; + bool m_IntermediateSpacingFlag; + bool m_AutoCropFlag; + bool m_InverseOrientationFlag; + bool m_RemoveObjectFlag; + bool m_CombineWithOrFlag; + bool m_FuzzyMapOnlyFlag; + bool m_FastFlag; + double m_Radius; + double m_K1; virtual void GenerateOutputInformation(); virtual void GenerateInputRequestedRegion(); virtual void GenerateData(); - typedef itk::PasteImageFilter PadFilterType; + typedef itk::PasteImageFilter PasteFilterType; + typedef itk::PasteImageFilter PasteFloatFilterType; typename ImageType::Pointer working_image; typename ImageType::Pointer object_resampled; typename FloatImageType::Pointer relPos; + typename FloatImageType::Pointer m_FuzzyMap; ImagePointer input; ImagePointer object;