From: srit Date: Wed, 8 Sep 2010 17:48:56 +0000 (+0000) Subject: Implemented like option, only the origin is missing X-Git-Tag: v1.2.0~398 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=57d229014618ee838d035e1e4d24ba16db794e53;p=clitk.git Implemented like option, only the origin is missing --- 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) {