[Insight-users] Why MultiResolutionPyramidImageFilter does not produce right image?
Lydia Ng
lng at insightful.com
Thu, 5 Feb 2004 11:22:22 -0800
This is a multi-part message in MIME format.
------_=_NextPart_001_01C3EC1D.61781D0D
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi Sean:
You can set the schedule directly on the pyramid objects themselves (see
attached example code).
---------------
For example, you can set the starting shrink factors:
unsigned int sf[ImageDimension];=20
sf[0] =3D 8; sf[1] =3D 8;
registrator->GetFixedImagePyramid()->SetStartingShrinkFactors(sf);
---------------
Or set the whole schedule:
=20
// You must first set the number of levels of the pyramid to match
// that of the registrator
registrator->GetMovingImagePyramid()->SetNumberOfLevels(
registrator->GetNumberOfLevels() );
// Get a copy of the default schedule for modification
ScheduleType schedule =3D =
registrator->GetMovingImagePyramid()->GetSchedule();
// Modify the schedule
schedule.Fill( 2 );
// Set the schedule
registrator->GetMovingImagePyramid()->SetSchedule( schedule );
BTW: The SetFixedImagePyramid and SetMovingImagePyramid are implemented.
- Lydia
-----Original Message-----
From: Zhiyong Xie [mailto:zyxie98 at yahoo.com]=20
Sent: Thursday, February 05, 2004 8:51 AM
To: Lydia Ng
Cc: insight-users at itk.org
Subject: RE: [Insight-users] Why MultiResolutionPyramidImageFilter does =
not
produce right image?
Lydia:
=A0
In MultiResolutionPDEDeformableRegistration, it seems we cannot set the
schedule
of image pyramid (which is provide by SetSchedule method in
MultiResolutionPyramidImageFilter ).=A0=A0It will be convenient if we =
can set
different shrink
factor for=A0each dimensions and for each image (fixed and moving) =
through
MultiResolutionPDEDeformableRegistration. I am not sure whether
we can do it in current implmentation. otherwise, it will be nice if the =
code
can be
modified=A0by implementing=A0method SetFixedImagePyramid and
SetMovingImagePyramid,
as well as a little change in GenerateData, where moving and fixed =
images can
be=20
retrived from image pyramid instead of creating pyramid form image, if =
the
pyramid=20
have already been set.
=A0
Thanks
=A0
Sean
=A0
Lydia Ng <lng at insightful.com> wrote:
Hi Fucang,
I think the filter requires the output pixel type to be floating point. =
Could
you try it out as an experiment?
- Lydia
> -----Original Message-----
> From: Fucang Jia [mailto:jiafucang at hotmail.com]
> Sent: Wednesday, November 19, 2003 1:17 AM
> To: insight-users at itk.org
> Subject: [Insight-users] Why MultiResolutionPyramidImageFilter does =
not
> produce right image?
>=20
> Hi, everyone,
>=20
> I am using ITK 1.4 and want to do some experiments based on
> MultiResolutionPyramid. But the following program does not give =
correct
> images. It does produce 8 images, but the first level image is all =
zeros.
> So
> the error spreads to the next level images. Is there some error in =
this
> program?
>=20
> Thanks a lot!
>=20
> Fucang
>=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
> int main(int argc, char *argv[] )
> {
>=20
>=20
> if(argc<2)
> {
> std::cerr<<ARGV[0]<<" Input2DImage?<<std::endl;
> return -1;
> }
>=20
> typedef unsigned short PixelType;
> const unsigned short Dimension =3D 2;
>=20
> typedef itk::Image InputImageType;
> typedef itk::Image OutputImageType;
> typedef itk::ImageFileReader ReaderType;
> typedef itk::ImageFileWriter WriterType;
> typedef
> itk::MultiResolutionPyramidImageFilter
> PyramidType;
> ReaderType::Pointer reader =3D ReaderType::New();
> WriterType::Pointer writer =3D WriterType::New();
> PyramidType::Pointer pyramid =3D PyramidType::New();
>=20
>=20
> reader->SetFileName(argv[1]);
> reader->Update();
>=20
> pyramid->SetInput( reader->GetOutput() );
>=20
> unsigned int numLevels;
> itk::Vector factors;
>=20
> numLevels =3D 8;
> factors[0] =3D 256; factors[1] =3D 256;
>=20
> pyramid->SetNumberOfLevels( numLevels );
> pyramid->SetStartingShrinkFactors( 256 );
> pyramid->Print( std::cout );
>=20
> pyramid->Update();
>=20
> for (int i=3D0;i<NUMLEVELS;I++)
> {
> char str[4096];
> sprintf(str,"test_%d.png",i);
> writer->SetFileName(str);
> writer->SetInput(pyramid->GetOutput(i));
> writer->Update();
> }
>=20
> return 0;
> }
>=20
> _________________________________________________________________
> The new MSN 8: advanced junk mail protection and 2 months FREE*
> http://join.msn.com/?page=FEatures/junkmail
>=20
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
_______________________________________________
Insight-users mailing list
Insight-users at itk.org
http://www.itk.org/mailman/listinfo/insight-users
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online
------_=_NextPart_001_01C3EC1D.61781D0D
Content-Type: application/octet-stream;
name="itkMultiResolutionPDEDeformableRegistrationTest.cxx"
Content-Transfer-Encoding: base64
Content-Description: itkMultiResolutionPDEDeformableRegistrationTest.cxx
Content-Disposition: attachment;
filename="itkMultiResolutionPDEDeformableRegistrationTest.cxx"
Lyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09DQoNCiAgUHJvZ3JhbTogICBJbnNpZ2h0IFNlZ21lbnRhdGlvbiAm
IFJlZ2lzdHJhdGlvbiBUb29sa2l0DQogIE1vZHVsZTogICAgJFJDU2ZpbGU6IGl0a011bHRpUmVz
b2x1dGlvblBERURlZm9ybWFibGVSZWdpc3RyYXRpb25UZXN0LmN4eCx2ICQNCiAgTGFuZ3VhZ2U6
ICBDKysNCiAgRGF0ZTogICAgICAkRGF0ZTogMjAwNC8wMS8xMSAwODozNTo1OCAkDQogIFZlcnNp
b246ICAgJFJldmlzaW9uOiAxLjE5ICQNCg0KICBDb3B5cmlnaHQgKGMpIEluc2lnaHQgU29mdHdh
cmUgQ29uc29ydGl1bS4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCiAgU2VlIElUS0NvcHlyaWdodC50
eHQgb3IgaHR0cDovL3d3dy5pdGsub3JnL0hUTUwvQ29weXJpZ2h0Lmh0bSBmb3IgZGV0YWlscy4N
Cg0KICAgICBUaGlzIHNvZnR3YXJlIGlzIGRpc3RyaWJ1dGVkIFdJVEhPVVQgQU5ZIFdBUl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