From: Simon Rit Date: Sat, 18 Jun 2011 16:07:14 +0000 (+0200) Subject: Fix for bug #274: move ExtractSlices definition in .h X-Git-Tag: v1.3.0~318^2~2 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=9516d5226b4dba29c89091ede113533ac19bced9;p=clitk.git Fix for bug #274: move ExtractSlices definition in .h --- diff --git a/itk/clitkSegmentationUtils.h b/itk/clitkSegmentationUtils.h index 7ae1c77..bbc1f62 100644 --- a/itk/clitkSegmentationUtils.h +++ b/itk/clitkSegmentationUtils.h @@ -225,9 +225,19 @@ namespace clitk { //-------------------------------------------------------------------- template void - ExtractSlices(const ImageType * image, int dim, - std::vector< typename itk::Image::Pointer > & slices); + ExtractSlices(const ImageType * image, int direction, + std::vector::Pointer > & slices) + { + typedef ExtractSliceFilter ExtractSliceFilterType; + typedef typename ExtractSliceFilterType::SliceType SliceType; + typename ExtractSliceFilterType::Pointer + extractSliceFilter = ExtractSliceFilterType::New(); + extractSliceFilter->SetInput(image); + extractSliceFilter->SetDirection(direction); + extractSliceFilter->Update(); + extractSliceFilter->GetOutputSlices(slices); + } //-------------------------------------------------------------------- diff --git a/itk/clitkSegmentationUtils.txx b/itk/clitkSegmentationUtils.txx index 4990b24..b432188 100644 --- a/itk/clitkSegmentationUtils.txx +++ b/itk/clitkSegmentationUtils.txx @@ -466,7 +466,7 @@ namespace clitk { p[dim] = max; typename ImageType::IndexType end; image->TransformPhysicalPointToIndex(p, end); - size[dim] = fabs(end[dim]-start[dim]); + size[dim] = abs(end[dim]-start[dim]); region.SetIndex(start); region.SetSize(size); @@ -585,25 +585,6 @@ namespace clitk { //-------------------------------------------------------------------- - //-------------------------------------------------------------------- - template - void - ExtractSlices(const ImageType * image, int direction, - std::vector::Pointer > & slices) - { - typedef ExtractSliceFilter ExtractSliceFilterType; - typedef typename ExtractSliceFilterType::SliceType SliceType; - typename ExtractSliceFilterType::Pointer - extractSliceFilter = ExtractSliceFilterType::New(); - extractSliceFilter->SetInput(image); - extractSliceFilter->SetDirection(direction); - extractSliceFilter->Update(); - extractSliceFilter->GetOutputSlices(slices); - } - //-------------------------------------------------------------------- - - //-------------------------------------------------------------------- template void