From 57d229014618ee838d035e1e4d24ba16db794e53 Mon Sep 17 00:00:00 2001 From: srit Date: Wed, 8 Sep 2010 17:48:56 +0000 Subject: [PATCH] Implemented like option, only the origin is missing --- tools/clitkResampleImageGenericFilter.txx | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/tools/clitkResampleImageGenericFilter.txx b/tools/clitkResampleImageGenericFilter.txx index e1c2d43..e05770e 100644 --- a/tools/clitkResampleImageGenericFilter.txx +++ b/tools/clitkResampleImageGenericFilter.txx @@ -51,8 +51,19 @@ clitk::ResampleImageGenericFilter::UpdateWithInputImageType() typename OutputImageType::SizeType size; if (mArgsInfo.like_given) { - DD("like"); - + itk::ImageIOBase::Pointer header = clitk::readImageHeader(mArgsInfo.like_arg); + if (header) { + for(unsigned int i=0; iGetSpacing(i); + size[i] = header->GetDimensions(i); + } + filter->SetOutputSpacing(spacing); + filter->SetOutputSize(size); + } + else { + std::cerr << "*** Warning : I could not read '" << mArgsInfo.like_arg << "' ***" << std::endl; + exit(0); + } } else { if (mArgsInfo.spacing_given == 1) { -- 2.47.1