3 #include <itkImageToImageFilter.h> 4 #include <itkImageRegionIterator.h> 5 #include <itkImageRegionConstIterator.h> 6 #include <itkLabelImageToLabelMapFilter.h> 7 #include <itkLabelMapToLabelImageFilter.h> 8 #include <itkLabelContourImageFilter.h> 9 #include <itkConnectedComponentImageFilter.h> 11 #include <itkMultiThreaderBase.h> 21 template<
typename TInput,
typename TMask,
typename TOutput>
23 public itk::ImageToImageFilter< TInput , TOutput >
28 typedef itk::ImageToImageFilter< TInput , TOutput >
Superclass;
62 typedef typename LabelImageToLabelMapFilterType::OutputImageType
TOutputMap;
79 void SetMask(
const TMask* mask);
88 this->SetCoordinateTolerance(tol);
89 this->SetDirectionTolerance(tol);
96 itkSetMacro(NoContour,
bool)
97 itkGetMacro(NoContour,
bool)
99 itkSetMacro(LabeledImage,
bool)
100 itkGetMacro(LabeledImage,
bool)
102 itkSetMacro(Verbose,
bool)
103 itkGetMacro(Verbose,
bool)
108 this->SetNumberOfRequiredOutputs(2);
109 this->SetNumberOfRequiredInputs(2);
114 m_LabeledImage=
false;
118 this->SetNumberOfWorkUnits(itk::MultiThreaderBase::GetGlobalDefaultNumberOfThreads());
126 itk::DataObject::Pointer
MakeOutput(
unsigned int idx);
129 typename TMask::ConstPointer
GetMask();
141 std::string m_OutputNonTouchingBorderFilename;
142 std::string m_OutputTouchingBorderFilename;
144 std::vector<int> m_labelsToRemove;
itk::LabelContourImageFilter< ImageTypeInt, ImageTypeInt > LabelContourImageFilterType
RemoveTouchingBorderFilter()
void SetInputImageSeg(const TInput *image)
itk::SmartPointer< Self > Pointer
Class selecting the connected components touching a given mask border. In MRI, external CSF may conta...
void SetOutputTouchingBorderFilename(std::string fn)
itk::ImageRegionIterator< OutputImageType > OutputIteratorType
TOutput * GetOutputNonTouchingBorder()
TInput::ConstPointer GetInputImageSeg()
void SetTol(const double tol)
TMask::ConstPointer GetMask()
Superclass::OutputImageRegionType OutputImageRegionType
virtual void GenerateData() ITK_OVERRIDE
itk::ImageRegionIterator< MaskImageType > MaskIteratorType
itk::ImageRegionConstIterator< InputImageType > InputConstIteratorType
itk::ImageToImageFilter< TInput, TOutput > Superclass
itk::ImageRegionIterator< ImageTypeInt > ImageIteratorTypeInt
TOutput * GetOutputTouchingBorder()
void SetOutputNonTouchingBorderFilename(std::string fn)
itk::ConnectedComponentImageFilter< TMask, ImageTypeInt > ConnectedComponentImageFilterType2
LabelImageToLabelMapFilterType::OutputImageType TOutputMap
itk::LabelImageToLabelMapFilter< TInput, TOutputMap > LabelImageToLabelMapFilterType2
itk::LabelMapToLabelImageFilter< TOutputMap, ImageTypeInt > LabelMapToLabelImageFilterType
RemoveTouchingBorderFilter Self
itk::ImageRegionIterator< InputImageType > InputIteratorType
itk::Image< PixelTypeInt, 3 > ImageTypeInt
OutputImageType::Pointer OutputImagePointer
itk::DataObject::Pointer MakeOutput(unsigned int idx)
itk::SmartPointer< const Self > ConstPointer
itk::ImageRegionConstIterator< MaskImageType > MaskConstIteratorType
InputImageType::Pointer InputImagePointer
void SetMask(const TMask *mask)
itk::ConnectedComponentImageFilter< InputImageType, ImageTypeInt > ConnectedComponentImageFilterType
MaskImageType::Pointer MaskImagePointer
unsigned int PixelTypeInt
virtual ~RemoveTouchingBorderFilter()
itk::LabelImageToLabelMapFilter< ImageTypeInt > LabelImageToLabelMapFilterType