NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
MorphologicalSegmentorPipeline.h
Go to the documentation of this file.
1 /*=============================================================================
2 
3  NifTK: A software platform for medical image computing.
4 
5  Copyright (c) University College London (UCL). All rights reserved.
6 
7  This software is distributed WITHOUT ANY WARRANTY; without even
8  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
9  PURPOSE.
10 
11  See LICENSE.txt in the top level directory for details.
12 
13 =============================================================================*/
14 
15 #ifndef MorphologicalSegmentorPipeline_h
16 #define MorphologicalSegmentorPipeline_h
17 
20 
21 #include <itkImage.h>
22 #include <itkBinaryThresholdImageFilter.h>
28 
35 template<typename TPixel, unsigned int VImageDimension>
37 {
38 public:
39 
40  typedef itk::Image<TPixel, VImageDimension> GreyScaleImageType;
41  typedef itk::Image<unsigned char, VImageDimension> SegmentationImageType;
42  typedef itk::BinaryThresholdImageFilter<GreyScaleImageType, SegmentationImageType> ThresholdingFilterType;
48 
51 
54 
56  void SetInputs(const GreyScaleImageType* referenceImage,
57  const SegmentationImageType* erosionsAdditionsImage,
58  const SegmentationImageType* erosionsSubtractionsImage,
59  const SegmentationImageType* dilationsAdditionsImage,
60  const SegmentationImageType* dilationsSubtractionsImage);
61 
63  void SetErosionSubtractionsInput(const SegmentationImageType* erosionsSubtractionsImage);
64 
66  void SetDilationSubtractionsInput(const SegmentationImageType* dilationsSubtractionsImage);
67 
70 
72  void SetForegroundValue(unsigned char foregroundValue);
73 
75  void SetBackgroundValue(unsigned char backgroundValue);
76 
82  void Update(const std::vector<bool>& editingFlags, const std::vector<int>& editingRegion);
83 
85  typename SegmentationImageType::Pointer GetOutput();
86 
91  typename SegmentationImageType::Pointer GetOutput(int stage);
92 
93 
94  typename ThresholdingFilterType::Pointer m_ThresholdingFilter;
104 
105 private:
106 
108  void UpdateForegroundValues();
109 
111  void UpdateBackgroundValues();
112 
114  unsigned char m_ForegroundValue;
115 
117  unsigned char m_BackgroundValue;
118 
120  int m_Stage;
121 
122 };
123 
124 #ifndef ITK_MANUAL_INSTANTIATION
125 #include "MorphologicalSegmentorPipeline.txx"
126 #endif
127 
128 #endif
LargestConnectedComponentFilterType::Pointer m_DilationConnectedComponentFilter
Definition: MorphologicalSegmentorPipeline.h:102
MorphologicalSegmentorPipeline()
Default constructor, creating all pipeline elements, where filters are held with smart pointers for a...
MaskByRegionFilterType::Pointer m_DilationMaskFilter
Definition: MorphologicalSegmentorPipeline.h:101
void SetDilationSubtractionsInput(const SegmentationImageType *dilationsSubtractionsImage)
Set dilation subtractions input image.
RethresholdingFilterType::Pointer m_RethresholdingFilter
Definition: MorphologicalSegmentorPipeline.h:103
LargestConnectedComponentFilterType::Pointer m_ThresholdingConnectedComponentFilter
Definition: MorphologicalSegmentorPipeline.h:96
SegmentationImageType::Pointer GetOutput()
Gets the output image from the pipeline, used to copy back into MITK world.
SmartPointer< Self > Pointer
Definition: itkMIDASMorphologicalSegmentorLargestConnectedComponentImageFilter.h:45
Largest connected component filter.
Definition: itkMIDASMorphologicalSegmentorLargestConnectedComponentImageFilter.h:34
const GLfloat * params
Definition: glew.h:1515
Abstract interface to plug ITK pipeline into MITK framework to represent the MIDAS Morphological Segm...
Definition: MorphologicalSegmentorPipelineInterface.h:26
MaskByRegionFilterType::Pointer m_ThresholdingMaskFilter
Definition: MorphologicalSegmentorPipeline.h:95
ThresholdingFilterType::Pointer m_ThresholdingFilter
Definition: MorphologicalSegmentorPipeline.h:94
itk::Image< unsigned char, VImageDimension > SegmentationImageType
Definition: MorphologicalSegmentorPipeline.h:41
itk::Image< TPixel, VImageDimension > GreyScaleImageType
Definition: MorphologicalSegmentorPipeline.h:40
void Update(const std::vector< bool > &editingFlags, const std::vector< int > &editingRegion)
Update the pipeline.
void SetParams(const MorphologicalSegmentorPipelineParams &params)
Set parameters on pipeline, where parameters come directly from GUI controls.
itk::MIDASRethresholdingFilter< GreyScaleImageType, SegmentationImageType, SegmentationImageType > RethresholdingFilterType
Definition: MorphologicalSegmentorPipeline.h:47
SmartPointer< Self > Pointer
Definition: itkMIDASRethresholdingFilter.h:53
SmartPointer< Self > Pointer
Definition: itkMIDASConditionalDilationFilter.h:45
LargestConnectedComponentFilterType::Pointer m_ErosionConnectedComponentFilter
Definition: MorphologicalSegmentorPipeline.h:99
itk::MIDASMorphologicalSegmentorLargestConnectedComponentImageFilter< SegmentationImageType, SegmentationImageType > LargestConnectedComponentFilterType
Definition: MorphologicalSegmentorPipeline.h:44
virtual ~MorphologicalSegmentorPipeline()
No-op destructor, as all objects will be destroyed by smart pointers.
Performs the re-thresholding, described in step 5 of "Interactive Algorithms for the segmentation and...
Definition: itkMIDASRethresholdingFilter.h:47
SmartPointer< Self > Pointer
Definition: itkMIDASMaskByRegionImageFilter.h:56
MaskByRegionFilterType::Pointer m_ErosionMaskFilter
Definition: MorphologicalSegmentorPipeline.h:98
itk::MIDASConditionalDilationFilter< SegmentationImageType, GreyScaleImageType, SegmentationImageType > DilationFilterType
Definition: MorphologicalSegmentorPipeline.h:46
itk::BinaryThresholdImageFilter< GreyScaleImageType, SegmentationImageType > ThresholdingFilterType
Definition: MorphologicalSegmentorPipeline.h:42
Class, developed for MIDAS migration, that outputs an image the same size as the input, but you can specify a region, and that region is kept, and anything outside that region, set to a single background value. Used for axial cut-off.
Definition: itkMIDASMaskByRegionImageFilter.h:48
Implementation of MorphologicalSegmentorPipelineInterface using ITK filters.
Definition: MorphologicalSegmentorPipeline.h:36
The parameters for the MorphologicalSegmentorPipeline, which closely resemble the GUI controls...
Definition: MorphologicalSegmentorPipelineParams.h:25
ErosionFilterType::Pointer m_ErosionFilter
Definition: MorphologicalSegmentorPipeline.h:97
void SetBackgroundValue(unsigned char backgroundValue)
Sets the value to use throughout the binary pipeline for background (defaults to 0).
Performs the conditional erosion, described in step 3 of "Interactive Algorithms for the segmentation...
Definition: itkMIDASConditionalErosionFilter.h:37
SmartPointer< Self > Pointer
Definition: itkMIDASConditionalErosionFilter.h:43
itk::MIDASConditionalErosionFilter< SegmentationImageType, GreyScaleImageType, SegmentationImageType > ErosionFilterType
Definition: MorphologicalSegmentorPipeline.h:45
void SetInputs(const GreyScaleImageType *referenceImage, const SegmentationImageType *erosionsAdditionsImage, const SegmentationImageType *erosionsSubtractionsImage, const SegmentationImageType *dilationsAdditionsImage, const SegmentationImageType *dilationsSubtractionsImage)
Set parameters on pipeline, where parameters come directly from GUI controls.
void SetForegroundValue(unsigned char foregroundValue)
Sets the value to use throughout the binary pipeline for foreground (defaults to 1).
DilationFilterType::Pointer m_DilationFilter
Definition: MorphologicalSegmentorPipeline.h:100
Performs the conditional dilation, described in step 4 of "Interactive Algorithms for the segmentatio...
Definition: itkMIDASConditionalDilationFilter.h:39
void SetErosionSubtractionsInput(const SegmentationImageType *erosionsSubtractionsImage)
Set erosion subtractions input image.
itk::MIDASMaskByRegionImageFilter< SegmentationImageType, SegmentationImageType > MaskByRegionFilterType
Definition: MorphologicalSegmentorPipeline.h:43