[Insight-users] Help with "Requested region is outside largest possible region"

Parag Chandra Parag_Chandra at med . unc . edu
Tue, 10 Jun 2003 15:24:23 -0400


Just tried the CVS version and I still get the same error. The only
workaround I've found so far is to actually create a new filter:

        reader->SetFileName("beam6.fm");
        filter->SetInput(reader->GetOutput());
        writer->SetInput(filter->GetOutput());
        writer->SetFileName("image1.fm");
        writer->Write();

        reader->SetFileName("beam8.fm");
        filter =3D FilterType::New();
        filter->SetInput(reader->GetOutput());
        writer->SetInput(filter->GetOutput());
        writer->SetFileName("image2.fm");
        writer->Write();

Now my question is if I do this, have I completely disconnected the old
filter so that there will be no more references to it and the object =
will be
destroyed?

-----Original Message-----
From: Stephen R. Aylward [mailto:aylward at unc . edu]=20
Sent: Tuesday, June 10, 2003 11:16 AM
To: Parag Chandra
Cc: insight-users at public . kitware . com
Subject: Re: [Insight-users] Help with "Requested region is outside =
largest
possible region"

Hi,

I think Julien fixed this in the CVS version.   Are you using a checkout =

from within the past week?

Stephen

Parag Chandra wrote:
> Hi,
>=20
> =20
>=20
> I am getting the error above every time I try to reuse a filter with =
an=20
> image that is smaller than the image I previously processed with that=20
> filter. For example,
>=20
> =20
>=20
> typedef itk::Image<double, 2>  ImageType;
>=20
> typedef itk::ImageFileReader<ImageType>  ImageReaderType;
>=20
> typedef itk::ImageFileWriter<ImageType>  ImageWriterType;
>=20
> typedef itk::NormalizeImageFilter<ImageType, ImageType>  FilterType;
>=20
> ImageReaderType::Pointer reader =3D ImageReaderType::New();
>=20
> ImageWriterType::Pointer writer =3D ImageWriterType::New();
>=20
> FilterType::Pointer filter =3D FilterType::New();
>=20
> =20
>=20
> // Block 1
>=20
> reader->SetFileName("beam6.mha");
>=20
> filter->SetInput(reader->GetOutput());
>=20
> writer->SetInput(filter->GetOutput());
>=20
> writer->SetFileName("image1.mha");
>=20
> writer->Write();
>=20
> =20
>=20
> // Block 2
>=20
> reader->SetFileName("beam8.mha");
>=20
> writer->SetFileName("image2.mha");
>=20
> writer->Write();
>=20
> =20
>=20
> The first block executes with no problem. beam6.mha is 53x63 in size,=20
> while beam8.mha is 50x63. The second block triggers an exception in=20
> DataObject::PropagateRequestedRegion because=20
> ImageBase::VerifyRequestedRegion returns false. For some reason, the=20
> 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=20
> 50x63. Does anyone know what is going on? I am using ITK release 1.2, =
so=20
> if this has been fixed in CVS, please let me know what the workaround=20
> is. Thanks.
>=20
> =20
>=20
> Best regards,
>=20
> Parag Chandra
>=20


--=20
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D
Dr. Stephen R. Aylward
Associate Professor of Radiology
Adjunct Associate Professor of Computer Science and Surgery
http://caddlab . rad . unc . edu
aylward at unc . edu
(919) 966-9695