<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content="MSHTML 6.00.2900.2912" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face="Bookman Old Style">Hi,</FONT></DIV>
<DIV><FONT face="Bookman Old Style"></FONT> </DIV>
<DIV>
<DIV><FONT face="Bookman Old Style">The fixedImage and movingImage both are 256
x 256 x 48. I use the grid with size 256 x 256 x 1 and start index
(0,0,24) as the resample grid. I do as below,</FONT></DIV>
<DIV><FONT face="Bookman Old Style"></FONT> </DIV>
<DIV><FONT face="Bookman Old Style">typedef itk::Image<short, 3>
ImageType;</FONT></DIV>
<DIV><FONT face="Bookman Old Style">typedef
itk::ResampleImageFilter<ImageType, ImageType>
ResampleFilterType;</FONT></DIV>
<DIV><FONT face="Bookman Old Style">ResampleFilterType::Pointer resampler =
ResampleFilterType::New();</FONT></DIV>
<DIV><FONT face="Bookman Old Style"></FONT> </DIV>
<DIV><FONT face="Bookman Old Style"> resampler->SetTransform( transform
);<BR>// resampler->SetInterpolator(this->interpolator);<BR> resampler->SetInput( movingImage
);<BR> size =
fixedImage->GetLargestPossibleRegion().GetSize();<BR> size[2] =
1;<BR> index[2] = 24;<BR> index[0] = index[1] =
0;<BR> this->resampler->SetSize(size);<BR> this->resampler->SetOutputStartIndex(index);<BR> this->resampler->SetOutputOrigin(
fixedImage->GetOrigin() );<BR> this->resampler->SetOutputSpacing(
fixedImage->GetSpacing()
);<BR> this->resampler->SetDefaultPixelValue( 100
);<BR> this->resampler->Update();</FONT></DIV>
<DIV><FONT face="Bookman Old Style"></FONT> </DIV>
<DIV><FONT face="Bookman Old Style">After resampled I change the index from
(0,0,24) to (0,0,16). However itk exception throwed. I debug into ITK and found
the possiblelargestregion change from (0,0,24) to (0,0,16), but the
requestregion still is (0,0,24). The requestregion is not in the range of the
possiblelargestregion, so the exception throw. Why not ITK automatically change
the requestregion when the largestpossibleregion change? </FONT></DIV>
<DIV><FONT face="Bookman Old Style"></FONT> </DIV>
<DIV><FONT face="Bookman Old Style"></FONT> </DIV>
<DIV><FONT face="Bookman Old Style"></FONT> </DIV>
<DIV><FONT face="Bookman Old Style">Regards,</FONT></DIV>
<DIV><FONT face="Bookman Old Style"></FONT> </DIV>
<DIV><FONT face="Bookman Old Style">Yixun Liu</DIV>
<DIV><BR></DIV></FONT>
<DIV><FONT face="Bookman Old Style"></FONT> </DIV></DIV></BODY></HTML>