3 #include <itkImageToImageFilter.h> 4 #include <itkImageRegionIterator.h> 5 #include <itkImageRegionConstIterator.h> 6 #include <itkChiSquareDistribution.h> 7 #include <itkMahalanobisDistanceThresholdImageFunction.h> 8 #include <itkGaussianMembershipFunction.h> 9 #include <itkRescaleIntensityImageFilter.h> 18 template <
typename TInputImage,
typename TMaskImage,
typename TOutput = TInputImage>
20 public itk::ImageToImageFilter< TInputImage, TOutput >
25 typedef itk::ImageToImageFilter< TInputImage, TOutput >
Superclass;
59 typedef typename itk::RescaleIntensityImageFilter<TInputImage,ImageTypeUC>
RescaleFilterType;
71 void SetMask(const TMaskImage* mask);
86 void SetGaussianModel(std::vector<GaussianFunctionType::Pointer> solution) {m_GaussianModel=solution;}
87 std::vector<GaussianFunctionType::Pointer>
GetSolutionGM() {
return m_GaussianModel;}
98 this->SetCoordinateTolerance(tol);
99 this->SetDirectionTolerance(tol);
104 static void eventCallback (itk::Object* caller,
const itk::EventObject& event,
void* clientData)
106 itk::ProcessObject * processObject = (itk::ProcessObject*) caller;
107 std::cout<<
"\033[K\rProgression: "<<(int)(processObject->GetProgress() * 100)<<
"%"<<std::flush;
110 itkSetMacro(Verbose,
bool)
111 itkGetMacro(Verbose,
bool)
116 this->SetNumberOfRequiredOutputs(5);
117 this->SetNumberOfRequiredInputs(4);
132 this->SetNumberOfWorkUnits(itk::MultiThreaderBase::GetGlobalDefaultNumberOfThreads());
144 typename TMaskImage::ConstPointer
GetMask();
147 itk::DataObject::Pointer
MakeOutput(
unsigned int idx);
155 std::string m_SolutionReadFilename;
157 unsigned int m_NbTissus;
158 unsigned int m_NbModalities;
160 std::vector<double> m_Alphas;
161 std::vector<GaussianFunctionType::Pointer> m_GaussianModel;
166 std::string m_OutputMahaCSFFilename;
167 std::string m_OutputMahaGMFilename;
168 std::string m_OutputMahaWMFilename;
170 std::string m_OutputMahaMinimumFilename;
171 std::string m_OutputMahaMaximumFilename;
virtual ~ComputeMahalanobisImagesFilter()
void SetTol(const double tol)
OutputImagePointer GetOutputMahaGM()
OutputImageType::Pointer OutputImagePointer
void SetMask(const TMaskImage *mask)
TInputImage InputImageType
void SetSolutionReadFilename(std::string filename)
itk::RescaleIntensityImageFilter< TInputImage, ImageTypeUC > RescaleFilterType
static void eventCallback(itk::Object *caller, const itk::EventObject &event, void *clientData)
InputImageType::ConstPointer GetInputImage3()
void SetGaussianModel(std::vector< GaussianFunctionType::Pointer > solution)
itk::ImageRegionIterator< OutputImageType > OutputIteratorType
void DynamicThreadedGenerateData(const OutputImageRegionType &outputRegionForThread) ITK_OVERRIDE
itk::Statistics::GaussianMembershipFunction< MeasurementVectorType > GaussianFunctionType
ComputeMahalanobisImagesFilter()
TMaskImage::ConstPointer GetMask()
std::vector< GaussianFunctionType::Pointer > GetSolutionGM()
Compute the mahalanobis images from the NABT model.
itk::VariableLengthVector< double > MeasurementVectorType
OutputImagePointer GetOutputMahaMaximum()
void SetInputImage1(const InputImageType *image)
OutputImagePointer GetOutputMahaMinimum()
itk::Image< PixelTypeUC, 3 > ImageTypeUC
unsigned char PixelTypeUC
itk::ImageToImageFilter< TInputImage, TOutput > Superclass
OutputImagePointer GetOutputMahaCSF()
InputImageType::ConstPointer GetInputImage2()
itk::ImageRegionConstIterator< MaskImageType > MaskConstIteratorType
itk::ImageRegionConstIterator< InputImageType > InputConstIteratorType
OutputImageType::PixelType OutputPixelType
void SetOutputMahaCSFFilename(std::string filename)
itk::ImageRegionConstIterator< ImageTypeUC > ImageConstIteratorTypeUC
void SetOutputMahaWMFilename(std::string filename)
void BeforeThreadedGenerateData() ITK_OVERRIDE
itk::SmartPointer< Self > Pointer
void SetOutputMahaMinimumFilename(std::string filename)
void SetOutputMahaGMFilename(std::string filename)
itk::DataObject::Pointer MakeOutput(unsigned int idx)
itk::SmartPointer< const Self > ConstPointer
InputImageType::ConstPointer GetInputImage1()
void SetOutputMahaMaximumFilename(std::string filename)
Superclass::OutputImageRegionType OutputImageRegionType
OutputImagePointer GetOutputMahaWM()
InputImageType::ConstPointer InputImageConstPointer
void SetInputImage3(const InputImageType *image)
ComputeMahalanobisImagesFilter Self
ImageTypeUC::Pointer ImagePointerUC
void SetInputImage2(const InputImageType *image)