X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=tools%2FclitkImageStatisticsGenericFilter.txx;h=f5c82356dff35c50bd2a3c841d9dc07ae820bdea;hb=0c56fa9705f9abdc98db8e0da1933ad3e5a3e192;hp=7b9c78b1cb233a394cef58753e6f8a4d21374313;hpb=b3eefccefcc9a81814c52e249fe805df7dc2cbf7;p=clitk.git diff --git a/tools/clitkImageStatisticsGenericFilter.txx b/tools/clitkImageStatisticsGenericFilter.txx index 7b9c78b..f5c8235 100644 --- a/tools/clitkImageStatisticsGenericFilter.txx +++ b/tools/clitkImageStatisticsGenericFilter.txx @@ -50,15 +50,7 @@ namespace clitk if (m_Verbose) std::cout << "Launching filter in "<< Dimension <<"D and unsigned_char..." << std::endl; UpdateWithDimAndPixelType(); } - -// else if (PixelType == "unsigned_int"){ -// if (m_Verbose) std::cout << "Launching filter in "<< Dimension <<"D and unsigned_int..." << std::endl; -// UpdateWithDimAndPixelType(); -// } - // else if (PixelType == "char"){ - // if (m_Verbose) std::cout << "Launching filter in "<< Dimension <<"D and signed_char..." << std::endl; - // UpdateWithDimAndPixelType(); - // } + else if(PixelType == "double"){ if (m_Verbose) std::cout << "Launching filter in "<< Dimension <<"D and double..." << std::endl; UpdateWithDimAndPixelType(); @@ -148,12 +140,19 @@ namespace clitk typename ResamplerType::Pointer resampler = ResamplerType::New(); resampler->SetInput(labelImage); resampler->SetOutputSpacing(input->GetSpacing()); + resampler->SetGaussianFilteringEnabled(false); resampler->Update(); labelImage = resampler->GetOutput(); + //writeImage(labelImage, "test1.mha"); + + typedef clitk::CropLikeImageFilter FilterType; + typename FilterType::Pointer crop = FilterType::New(); + crop->SetInput(labelImage); + crop->SetCropLikeImage(input); + crop->Update(); + labelImage = crop->GetOutput(); + //writeImage(labelImage, "test2.mha"); - typename itk::ImageBase::RegionType reg - = input->GetLargestPossibleRegion(); - labelImage = ResizeImageLike(labelImage, ®, 0); } else { std::cerr << "Mask image has a different size/spacing than input. Abort" << std::endl;