[Insight-users] Help with "Requested region is outside largest possible region"
Parag Chandra
pchandra at radonc . unc . edu
Tue, 10 Jun 2003 10:57:33 -0400
This is a multi-part message in MIME format.
------=_NextPart_000_0001_01C32F3F.18462080
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Hi,
=20
I am getting the error above every time I try to reuse a filter with an
image that is smaller than the image I previously processed with that
filter. For example,=20
=20
typedef itk::Image<double, 2> ImageType;=20
typedef itk::ImageFileReader<ImageType> ImageReaderType;
typedef itk::ImageFileWriter<ImageType> ImageWriterType;
typedef itk::NormalizeImageFilter<ImageType, ImageType> FilterType;
ImageReaderType::Pointer reader =3D ImageReaderType::New();
ImageWriterType::Pointer writer =3D ImageWriterType::New();
FilterType::Pointer filter =3D FilterType::New();
=20
// Block 1
reader->SetFileName("beam6.mha");
filter->SetInput(reader->GetOutput());
writer->SetInput(filter->GetOutput());
writer->SetFileName("image1.mha");
writer->Write();
=20
// Block 2
reader->SetFileName("beam8.mha");
writer->SetFileName("image2.mha");
writer->Write();
=20
The first block executes with no problem. beam6.mha is 53x63 in size, =
while
beam8.mha is 50x63. The second block triggers an exception in
DataObject::PropagateRequestedRegion because
ImageBase::VerifyRequestedRegion returns false. For some reason, the =
second
time the filter is run it uses the same requested region as the first =
time
it ran (53x63), but this time around, the image is only 50x63. Does =
anyone
know what is going on? I am using ITK release 1.2, so if this has been =
fixed
in CVS, please let me know what the workaround is. Thanks.
=20
Best regards,
Parag Chandra
------=_NextPart_000_0001_01C32F3F.18462080
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
<html>
<head>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<meta name=3DGenerator content=3D"Microsoft Word 10 (filtered)">
<style>
<!--
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;}
span.EmailStyle17
{font-family:Arial;
color:windowtext;}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
{page:Section1;}
-->
</style>
</head>
<body lang=3DEN-US link=3Dblue vlink=3Dpurple>
<div class=3DSection1>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Hi,</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>I am getting the error above every time I try to =
reuse a
filter with an image that is smaller than the image I previously =
processed with
that filter. For example, </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>typedef itk::Image<double, 2> ImageType; =
</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>typedef itk::ImageFileReader<ImageType>
ImageReaderType;</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>typedef itk::ImageFileWriter<ImageType>
ImageWriterType;</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>typedef itk::NormalizeImageFilter<ImageType,
ImageType> FilterType;</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>ImageReaderType::Pointer reader =3D =
ImageReaderType::New();</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>ImageWriterType::Pointer writer =3D =
ImageWriterType::New();</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>FilterType::Pointer filter =3D =
FilterType::New();</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>// Block 1</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>reader->SetFileName("beam6.mha");</span><=
/font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>filter->SetInput(reader->GetOutput());</span></f=
ont></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>writer->SetInput(filter->GetOutput());</span></f=
ont></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>writer->SetFileName("image1.mha");</span>=
</font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>writer->Write();</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>// Block 2</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>reader->SetFileName("beam8.mha");</span><=
/font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>writer->SetFileName("image2.mha");</span>=
</font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>writer->Write();</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>The first block executes with no problem. beam6.mha =
is 53x63
in size, while beam8.mha is 50x63. The second block triggers an =
exception in DataObject::PropagateRequestedRegion
because ImageBase::VerifyRequestedRegion returns false. For some reason, =
the
second time the filter is run it uses the same requested region as the =
first
time it ran (53x63), but this time around, the image is only 50x63. Does =
anyone
know what is going on? I am using ITK release 1.2, so if this has been =
fixed in
CVS, please let me know what the workaround is. =
Thanks.</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Best regards,</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Parag Chandra</span></font></p>
</div>
</body>
</html>
------=_NextPart_000_0001_01C32F3F.18462080--