<div class="gmail_quote">On Wed, Aug 1, 2012 at 11:10 PM, 龍龍 <span dir="ltr">&lt;<a href="mailto:anjingdelonglong@gmail.com" target="_blank">anjingdelonglong@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
HI ALL <br><br>i&#39;m doing my project using ITK. but i got a problem about the extract of 3D image. <br><br>i&#39;m using vtkRegionofInterestImageFilter. follow the example: <br><br>  ImageType::IndexType start; <br>  start[0] = … <br>

  start[1] = … <br>  start[2] = … <br>  <br>  ImageType::SizeType size; <br>  size[0] = … <br>  size[1] = … <br>  size[2] = … <br><br>  ImageType::RegionType desiredRegion; <br>  desiredRegion.SetSize(size); <br>  desiredRegion.SetIndex(start); <br>

<br>BUT, i hope that the start point that i gave can be the center point of the cube. not the cornor. <br><br>what should i do . thank u.<br clear="all"><br>--<br>Ryuu<br></blockquote><div><br></div><span style="font-size:13px;color:rgb(34,34,34);font-family:arial,sans-serif;background-color:rgb(255,255,255)">You just have to subtract half of the &#39;size&#39; from the &#39;center&#39; you want so you can pass &#39;start&#39; as the corner:</span></div>
<div class="gmail_quote"><font color="#222222" face="arial, sans-serif"><br></font></div><div class="gmail_quote"><font color="#222222" face="arial, sans-serif">itk::Index&lt;2&gt; corner = center - size/2; (I think you&#39;ll have to do this element-wise)<br clear="all">
</font>ImageType::RegionType desiredRegion(corner, size); </div><div class="gmail_quote"><br><div>David </div></div>