Vous avez reçu un message "Your GitLab account has been locked ..." ? Pas d'inquiétude : lisez cet article https://docs.gricad-pages.univ-grenoble-alpes.fr/help/unlock/

Commit de1c43ec authored by seryc's avatar seryc
Browse files

UPDATE: Try to resolve some memory leak.

There are still problems (but less) on Standard Gaussian Filter. I try to solve it later

git-svn-id: svn+ssh://scm.forge.imag.fr/var/lib/gforge/chroot/scmrepos/svn/camitk/trunk/camitk@2120 ec899d31-69d1-42ba-9299-647d76f65fb3
parent 356a66e9
......@@ -119,16 +119,17 @@ void GaussianFilter::process(ImageComponent * comp) {
// ITK filter implementation
template <class InputPixelType, class OutputPixelType, const int dim>
vtkSmartPointer<vtkImageData> GaussianFilter::itkProcess(vtkSmartPointer<vtkImageData> img) {
vtkSmartPointer<vtkImageData> outputImage = vtkSmartPointer<vtkImageData>::New();
vtkSmartPointer<vtkImageData> outputImage = NULL;
switch (this->getType()) {
case GaussianFilter::STANDARD:
outputImage = itkProcessStandardGaussian<InputPixelType, OutputPixelType, dim>(img);
case GaussianFilter::RECURSIVE_IIR:
outputImage = itkProcessIIRGaussian<InputPixelType, OutputPixelType, dim>(img);
return outputImage;
......@@ -202,7 +203,6 @@ vtkSmartPointer<vtkImageData> GaussianFilter::itkProcessStandardGaussian(vtkSmar
// --------------------- Create and return a copy (the filters will be deleted)--
vtkSmartPointer<vtkImageData> resultImage = itkToVtkFilter->GetOutput();
vtkSmartPointer<vtkImageData> result = vtkSmartPointer<vtkImageData>::New();
result = vtkImageData::New();
int extent[6];
......@@ -213,6 +213,10 @@ vtkSmartPointer<vtkImageData> GaussianFilter::itkProcessStandardGaussian(vtkSmar
observerBlur = NULL;
observerCast = NULL;
observerRescale = NULL;
return result;
......@@ -223,7 +227,7 @@ vtkSmartPointer<vtkImageData> GaussianFilter::itkProcessIIRGaussian(vtkSmartPoin
typedef itk::Image< InputPixelType, dim > InputImageType;
typedef itk::Image< OutputPixelType, dim > OutputImageType;
// Convert the VTK image given by UMP to an ITK image
// Convert the VTK image given by IMP to an ITK image
typedef itk::VTKImageToImageFilter<InputImageType> vtkToItkFilterType;
typename vtkToItkFilterType::Pointer vtkToItkFilter = vtkToItkFilterType::New();
......@@ -314,6 +318,11 @@ vtkSmartPointer<vtkImageData> GaussianFilter::itkProcessIIRGaussian(vtkSmartPoin
// Set CamiTK progress bar back to zero (the processing filter is over)
observerX = NULL;
observerY = NULL;
observerZ = NULL;
return imageCopy;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment