<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->SetSpacing(reader->GetOutput()->GetSpacing());<br>image_slice->SetOrigin(reader->GetOutput()->GetOrigin());<br>image_slice->SetDimensions(512,512,1);<br>image_slice->SetScalarTypeToShort(); <br>
image_slice->SetNumberOfScalarComponents(reader->GetNumberOfComponents());<br>image_slice->SetWholeExtent(reader->GetOutput()->GetWholeExtent());<br>image_slice->AllocateScalars();<br>image_slice->CopyAndCastFrom(reader->GetOutput(), 0,511,0,511,35,35);<br clear="all">
<br><br>Thank you in advance,<br><br>Talita<br><br></div>