5 #include <itkImageToImageFilter.h> 6 #include <itkImageRegionIterator.h> 7 #include <itkImageRegionConstIterator.h> 8 #include <itkVariableSizeMatrix.h> 9 #include <itkBinaryBallStructuringElement.h> 10 #include <itkGrayscaleDilateImageFilter.h> 11 #include <itkResampleImageFilter.h> 12 #include <itkIdentityTransform.h> 13 #include <itkBSplineInterpolateImageFunction.h> 14 #include <itkMaskImageFilter.h> 22 template <
typename TInput,
typename TOutput>
24 public itk::ImageToImageFilter< TInput , TOutput >
29 typedef itk::ImageToImageFilter< TInput , TOutput>
Superclass;
57 typedef itk::Image <PixelTypeUC,3>
TMask;
77 void SetMask(const TMask* mask);
90 TMask::Pointer
Upsample(
const TMask* input, TMask::SizeType upSize, TMask::DirectionType outputDirection, TMask::PointType outputOrigin);
98 this->SetCoordinateTolerance(tol);
99 this->SetDirectionTolerance(tol);
103 itkSetMacro(Sigma,
double)
104 itkGetMacro(Sigma,
double)
106 itkSetMacro(UseSpectralGradient,
bool)
107 itkGetMacro(UseSpectralGradient,
bool)
109 itkSetMacro(Verbose,
bool)
110 itkGetMacro(Verbose,
bool)
132 m_UseSpectralGradient=
true;
136 m_IndexImage1=m_NbMaxImages,m_IndexImage2=m_NbMaxImages,m_IndexImage3=m_NbMaxImages, m_IndexImage4=m_NbMaxImages,m_IndexImage5=m_NbMaxImages, m_IndexImage6=m_NbMaxImages;
142 this->SetNumberOfRequiredOutputs(2);
143 this->SetNumberOfRequiredInputs(4);
151 itk::DataObject::Pointer
MakeOutput(
unsigned int idx);
179 bool m_UseSpectralGradient;
191 std::string m_MatFilename;
196 unsigned int m_NbInputs;
197 unsigned int m_IndexImage1, m_IndexImage2, m_IndexImage3, m_IndexImage4,m_IndexImage5, m_IndexImage6, m_NbMaxImages;
201 double m_DownsamplingFactor;
204 TMask::Pointer m_CurrentMask;
205 typename TInput::SizeType m_InputSize;
206 typename TInput::DirectionType m_OutputDirection;
207 typename TInput::PointType m_OutputOrigin;
void FindDownsampleFactor()
TSeedProba::ConstPointer GetInputSeedProbaSinks()
Class creating a 3D graph in a graph cut framework.
ResampleImageFilterType::Pointer m_Resample3
TSeedProba::Pointer ImagePointerProba
ResampleImageFilterdoubleType::Pointer m_ResampleSinks
itk::ResampleImageFilter< TMask, TMask > ResampleImageFilterMaskType
itk::ImageRegionConstIterator< TInput > InRegionConstIteratorType
itk::ImageRegionIterator< TOutput > OutputIteratorType
NLinksFilterType::Pointer m_NLinksFilterDecim
NLinksFilterType::Pointer m_NLinksFilter
std::string GetMatFilename(void)
unsigned char PixelTypeUC
TSeedProba::ConstPointer GetInputSeedProbaSources()
void SetInputSeedProbaSources(const TSeedProba *mask)
TOutput::PixelType OutputPixelType
ResampleImageFilterType::Pointer m_Resample2
Class allowing the decimation of the images if necessary (if 3D graph size causes memory problems)...
itk::VariableSizeMatrix< NumericType > doubleVariableSizeMatrixType
doubleVariableSizeMatrixType GetMatrix(void)
void SetTol(const double tol)
TInput::ConstPointer InputImageConstPointer
TMask::Pointer TMaskPointer
OutputImagePointer GetOutputBackground()
ResampleImageFilterType::Pointer m_Resample1
NLinksFilter< TInput, TMask > NLinksFilterType
itk::Image< PixelTypeUC, 3 > TMask
void SetMask(const TMask *mask)
void SetInputSeedProbaSinks(const TSeedProba *mask)
itk::ResampleImageFilter< TInput, TInput > ResampleImageFilterType
itk::ResampleImageFilter< TSeedProba, TSeedProba > ResampleImageFilterdoubleType
TInput::PixelType InputPixelType
itk::IdentityTransform< double, 3 > TransformType
void InitResampleFilters()
TMask::Pointer Dilate(const TMask *input, const TMask *mask)
TInput::Pointer InputImagePointer
TMask::ConstPointer GetMask()
itk::ImageRegionIterator< TInput > InRegionIteratorType
void SetMatFilename(std::string mat)
itk::ImageRegionConstIterator< TMask > MaskRegionConstIteratorType
TInput::ConstPointer GetInputImage4()
void ProcessDownsampledGraphCut(int current_count)
ResampleImageFilterdoubleType::Pointer m_ResampleSources
void GenerateData() ITK_OVERRIDE
Superclass::OutputImageRegionType OutputImageRegionType
TInput::ConstPointer GetInputImage2()
itk::DataObject::Pointer MakeOutput(unsigned int idx)
ResampleImageFilterType::Pointer m_Resample5
void SetMatrix(doubleVariableSizeMatrixType mat)
TInput::ConstPointer GetInputImage3()
TMask::Pointer Upsample(const TMask *input, TMask::SizeType upSize, TMask::DirectionType outputDirection, TMask::PointType outputOrigin)
itk::ImageToImageFilter< TInput, TOutput > Superclass
itk::ImageRegionIterator< TSeedProba > ImageIteratorTypeProba
TOutput::Pointer OutputImagePointer
ResampleImageFilterType::Pointer m_Resample4
itk::SmartPointer< Self > Pointer
itk::SmartPointer< const Self > ConstPointer
void SetInputImage(unsigned int i, const TInput *image)
itk::Image< PixelTypeD, 3 > TSeedProba
ResampleImageFilterMaskType::Pointer m_ResampleMask
TInput::ConstPointer GetInputImage1()
TInput::ConstPointer GetInputImage5()
TSeedProba::PixelType SeedProbaPixelType
itk::SmartPointer< Self > Pointer
itk::ImageRegionIterator< TMask > MaskRegionIteratorType
OutputImagePointer GetOutput()