<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>Hello,<div><br></div><div><div>I am reading a single image slice belonging to an DICOM CT series.</div><div>The component type is short and number of dimension is 3.</div><div>Now I want to modify the voxel spacing.</div><div>To do that I tried this:</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>double newSpacing[3];</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>newSpacing[0] = x_spacing;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>newSpacing[1] = y_spacing;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>newSpacing[2] = z_spacing;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>reader->GetOutput()->SetSpacing(newSpacing);</div><div>but this will modify only x- and y-spacing while z remains the same (=1mm)</div><div>Also writing z_spacing to the header entry 0018,0050 (Slice Thickness) won`t change the fact, </div><div>that calling GetSliceSpacing() at the resulting image will return the values of x-and y-spacing but still 1 instead of z-spacing.</div><div><br></div><div>How can the 3rd spacing component be modified?</div><div>Is this even possible for the givien image?</div><div>Because Im assuming that ITK is calculating the spacing by using ImagePositionPatient(0020,0032) and ImageOrientationPatient(0020,0037), </div><div>but sets it by default to 1 when it cant find more than one slice. (Just a guess)</div><div><br></div><div>Any help is apreciated.</div></div><div><br></div><div>Kind Regads,</div><div>Omar</div>                                            </div></body>
</html>