<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.E-mailStijl17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="NL" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">Dear all, <o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span lang="EN-US">I would need some help to resample so that it has isotropic voxels in the end.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">For this, I wanted to use the Nearest Neighbor Interpolator and the ResampleFilterType.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">My code is running, but the output of the filter has always the dimensions [0 0 0], so is not existent.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">What am I doing wrong? (see code below)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Thanks in advance!<br>
<br>
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Elli<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue">typedef</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black"> itk::</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2B91AF">NearestNeighborInterpolateImageFunction</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black"><</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2B91AF">ImageType</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">,
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2B91AF">T</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">>
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2B91AF">NearestNeighborInterpolatorType</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue">typedef</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black"> itk::</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2B91AF">ResampleImageFilter</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black"><</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2B91AF">ImageType</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">,
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2B91AF">ImageType</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">>
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2B91AF">ResampleFilterType</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue">typedef</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black"> itk::</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2B91AF">AffineTransform</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">
<</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue">double</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">, 3>
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2B91AF">TransformType</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:green">//use nearest neighbor interpolation</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue">typename</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2B91AF">NearestNeighborInterpolatorType</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">::</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2B91AF">Pointer</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">
nearestNeighborInterpolator = </span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2B91AF">NearestNeighborInterpolatorType</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">::New();<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue">typename</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2B91AF">ImageType</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">::</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2B91AF">DirectionType</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">
direction;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue">typename</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2B91AF">TransformType</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">::</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2B91AF">Pointer</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">
transform = </span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2B91AF">TransformType</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">::New();<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:green">//transform->SetIdentity();</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue">typedef</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black"> itk::</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2B91AF">NearestNeighborInterpolateImageFunction</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black"><</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2B91AF">ImageType</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">,
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue">double</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">>
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2B91AF">InterpolatorType</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:green">//typedef itk::LinearInterpolateImageFunction<ImageType, double > InterpolatorType;</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue">typename</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2B91AF">InterpolatorType</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">::</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2B91AF">Pointer</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">
interpolator = </span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2B91AF">InterpolatorType</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">::New();<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue">typename</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2B91AF">ResampleFilterType</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">::</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2B91AF">Pointer</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">
resizeFilter2 = </span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2B91AF">ResampleFilterType</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">::New();<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">resizeFilter2->SetTransform(transform);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">resizeFilter2->SetInterpolator( interpolator );<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">resizeFilter2->SetDefaultPixelValue(0);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:green">//resizeFilter2->SetInterpolator();</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black"></span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue">const</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue">typename</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2B91AF">ImageType</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">::</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2B91AF">SpacingType</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">&
inputSpacing = image->GetSpacing();<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black"></span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:green">//sampling</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black"></span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue">double</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">
outputSpacing[3];<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black"> </span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:green">// Fetch original image size</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black"> </span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue">const</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue">typename</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2B91AF">ImageType</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">::</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2B91AF">RegionType</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">&
inputRegion = image->GetLargestPossibleRegion();<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black"> </span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue">const</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue">typename</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2B91AF">ImageType</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">::</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2B91AF">SizeType</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">&
inputSize = inputRegion.GetSize();<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue">unsigned</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue">int</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black"> oldWidth = inputSize[0];<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue">unsigned</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue">int</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black"> oldHeight = inputSize[1];<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue">unsigned</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue">int</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black"> oldDepth = inputSize[2];<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue">unsigned</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue">int</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black"> newWidth;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue">unsigned</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue">int</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black"> newHeight;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue">unsigned</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue">int</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black"> newDepth;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black"> //get the new height etc of image<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue">double</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black"> minimum = inputSpacing[0];<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black"> i</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue">f</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">
(inputSpacing[1]<minimum){<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black"> minimum = inputSpacing[1];<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black"> }<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue">if</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black"> (inputSpacing[2] < minimum){<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black"> minimum = inputSpacing[2];<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black"> }<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black"> outputSpacing[0] = minimum;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black"> outputSpacing[1] = minimum;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black"> outputSpacing[2] = minimum;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black"> newWidth = (</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue">double</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">)
oldWidth * inputSpacing[0]/minimum;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black"> ewHeight = (</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue">double</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">)
oldHeight * inputSpacing[1]/minimum;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black"> newDepth = (</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue">double</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">)
oldDepth * inputSpacing[2]/minimum;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:green">// Set the output spacing as specified on the command line</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black"> resizeFilter2->SetOutputSpacing(outputSpacing);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:green">// Set the computed size</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black"> itk::</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2B91AF">Size</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black"><3>
outputSize = { {newWidth, newHeight, newDepth} };<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black"> resizeFilter2->SetSize(outputSize);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:green">// Specify the input for the resamplers</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black"> resizeFilter2->SetInput(image);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2B91AF">ImageType</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">::Pointer imageNew = resizeFilter2->GetOutput();<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue"> const</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue">typename</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2B91AF">ImageType</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">::</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2B91AF">RegionType</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">&
outputRegion = imageNew->GetLargestPossibleRegion();<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue">const</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue">typename</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2B91AF">ImageType</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">::</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2B91AF">SizeType</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">&
outputSize2 = outputRegion.GetSize();<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
<hr>
De inhoud van dit bericht is vertrouwelijk en alleen bestemd voor de geadresseerde(n). Anderen dan de geadresseerde(n) mogen geen gebruik maken van dit bericht, het niet openbaar maken of op enige wijze verspreiden of vermenigvuldigen. Het UMCG kan niet aansprakelijk
gesteld worden voor een incomplete aankomst of vertraging van dit verzonden bericht.
<br>
<br>
The contents of this message are confidential and only intended for the eyes of the addressee(s). Others than the addressee(s) are not allowed to use this message, to make it public or to distribute or multiply this message in any way. The UMCG cannot be held
responsible for incomplete reception or delay of this transferred message.
</body>
</html>