*/
//--------------------------------------------------------------------
-
- //--------------------------------------------------------------------
-template<class IndexType, class PixelType>
-class Bifurcation
-{
-public:
- Bifurcation(IndexType _index, PixelType _l, PixelType _l1, PixelType _l2) {
- index = _index;
- _l = l;
- _l1 = l1;
- _l2 = l2;
- }
- IndexType index;
- PixelType l;
- PixelType l1;
- PixelType l2;
-};
- //--------------------------------------------------------------------
-
-
//--------------------------------------------------------------------
template <class TImageType, class TMaskImageType>
class ITK_EXPORT ExtractLungFilter:
- public clitk::FilterBase,
+ public virtual clitk::FilterBase,
public itk::ImageToImageFilter<TImageType, TMaskImageType>
{
typedef typename ImageType::PixelType InputImagePixelType;
typedef typename ImageType::SizeType InputImageSizeType;
typedef typename ImageType::IndexType InputImageIndexType;
+ typedef typename ImageType::PointType InputImagePointType;
typedef TMaskImageType MaskImageType;
typedef typename MaskImageType::ConstPointer MaskImageConstPointer;
typedef typename MaskImageType::PixelType MaskImagePixelType;
typedef typename MaskImageType::SizeType MaskImageSizeType;
typedef typename MaskImageType::IndexType MaskImageIndexType;
+ typedef typename MaskImageType::PointType MaskImagePointType;
itkStaticConstMacro(ImageDimension, unsigned int, ImageType::ImageDimension);
typedef int InternalPixelType;
itkGetConstMacro(UpperThreshold, InputImagePixelType);
GGO_DefineOption(upper, SetUpperThreshold, InputImagePixelType);
+ itkSetMacro(NumberOfSlicesToSkipBeforeSearchingSeed, int);
+ itkGetConstMacro(NumberOfSlicesToSkipBeforeSearchingSeed, int);
+ GGO_DefineOption(skipslices, SetNumberOfSlicesToSkipBeforeSearchingSeed, int);
+
itkSetMacro(LowerThreshold, InputImagePixelType);
itkGetConstMacro(LowerThreshold, InputImagePixelType);
itkSetMacro(UseLowerThreshold, bool);
itkGetConstMacro(LabelizeParameters3, LabelParamType*);
GGO_DefineOption_LabelParam(3, SetLabelizeParameters3, LabelParamType);
- // Step 5 options LungSeparation
- // itkSetMacro(FinalOpenClose, bool);
- // itkGetConstMacro(FinalOpenClose, bool);
- // itkBooleanMacro(FinalOpenClose);
+ // Step 5 final openclose
+ itkSetMacro(FinalOpenClose, bool);
+ itkGetConstMacro(FinalOpenClose, bool);
+ itkBooleanMacro(FinalOpenClose);
+ GGO_DefineOption_Flag(openclose, SetFinalOpenClose);
- // Bronchial bifurcations
- itkSetMacro(FindBronchialBifurcations, bool);
- itkGetConstMacro(FindBronchialBifurcations, bool);
- itkBooleanMacro(FindBronchialBifurcations);
+ itkSetMacro(FinalOpenCloseRadius, int);
+ itkGetConstMacro(FinalOpenCloseRadius, int);
+ GGO_DefineOption(opencloseRadius, SetFinalOpenCloseRadius, int);
protected:
ExtractLungFilter();
InputImagePixelType m_ThresholdStepSizeForTrachea;
double m_MultiplierForTrachea;
std::vector<InternalIndexType> m_Seeds;
+ int m_NumberOfSlicesToSkipBeforeSearchingSeed;
// Step 3
int m_NumberOfHistogramBins;
LabelParamType* m_LabelizeParameters3;
// Step 5
- // bool m_FinalOpenClose;
-
- bool m_FindBronchialBifurcations;
-
+ bool m_FinalOpenClose;
+ int m_FinalOpenCloseRadius;
+
+ // Main functions
virtual void GenerateOutputInformation();
virtual void GenerateData();
+
+ // Functions for trachea extraction
+ bool SearchForTracheaSeed(int skip);
+ void SearchForTrachea();
+ void TracheaRegionGrowing();
+ double ComputeTracheaVolume();
- typedef Bifurcation<MaskImageIndexType,MaskImagePixelType> BifurcationType;
- void TrackFromThisIndex(std::vector<BifurcationType> & listOfBifurcations,
- MaskImagePointer skeleton,
- MaskImageIndexType index,
- MaskImagePixelType label);
-
private:
ExtractLungFilter(const Self&); //purposely not implemented
void operator=(const Self&); //purposely not implemented