<div dir="ltr">Hi,<br><br>I want to get a slice (35 as in the example bellow) from a DICOM volume using CopyAndCastFrom(). In this example the extent of the original volume is (0,511,0,511,0,81). What am I doing wrong here?<br>
<br>image_slice-&gt;SetSpacing(reader-&gt;GetOutput()-&gt;GetSpacing());<br>image_slice-&gt;SetOrigin(reader-&gt;GetOutput()-&gt;GetOrigin());<br>image_slice-&gt;SetDimensions(512,512,1);<br>image_slice-&gt;SetScalarTypeToShort();&nbsp;&nbsp;&nbsp; <br>
image_slice-&gt;SetNumberOfScalarComponents(reader-&gt;GetNumberOfComponents());<br>image_slice-&gt;SetWholeExtent(reader-&gt;GetOutput()-&gt;GetWholeExtent());<br>image_slice-&gt;AllocateScalars();<br>image_slice-&gt;CopyAndCastFrom(reader-&gt;GetOutput(), 0,511,0,511,35,35);<br clear="all">
<br><br>Thank you in advance,<br><br>Talita<br><br></div>