[Insight-users] Reporting bugs
Sayan Pathak
spathak@insightful.com
Fri, 8 Nov 2002 13:46:32 -0800
Paul,
The way we post the bugs is to send it to the bug czar and let the czar =
can route it to the right spot. I happen to be playing the role of the =
czar for the moment. So, send it over to me.
Thanks,
Sayan
> -----Original Message-----
> From: Paul Yushkevich [mailto:pauly@cognitica.com]
> Sent: Friday, November 08, 2002 1:19 PM
> To: insight-users@public.kitware.com
> Subject: [Insight-users] A bug (?) in ImageSliceConstIteratorWithIndex
> class
>=20
>=20
> Hi everyone,
>=20
> I found what I think may be a bug in ImageSliceConstIteratorWithIndex=20
> class. =20
>=20
> The following code is intended to copy the contents of a=20
> slice 'slice'=20
> to the 2D array 'sliceArray'.
>=20
> SomeClass::SomeClass(...) {
> // Create a slice iterator and choose a slice
> slicer =3D=20
> ImageSliceConstIteratorWithIndex<ImageType>(imagePtr,imagePtr-
> >getLargestPossibleRegion());
> slicer.setFirstDimension(0);
> slicer.setFirstDimension(1);
> }
>=20
> void SomeClass::setSlice(int slice) {
>=20
> // Skip to the right slice
> slicer.GoToBegin();
> for(int i=3D0;i<slice;i++) {
> slicer.NextSlice();
> }
>=20
> // BUG-SOLVING-LINE: slicer.SetIndex(slicer.GetIndex());
>=20
> // Fill out the 2D image
> int sliceIdx =3D 0;
> while ( !slicer.IsAtEndOfSlice() ) {
> while ( !slicer.IsAtEndOfLine() ) {
> sliceArray[sliceIdx++] =3D (unsigned char) floor(255 *=20
> slicer.Value());
> ++slicer;
> } =20
> slicer.NextLine();
> }
> }
>=20
> No matter which slice number I pass on to this piece of code,=20
> it places=20
> the first slice of the 3D image into the 2D array.
>=20
> However, if I uncomment the line labeled BUG-SOLVING-LINE,=20
> things start=20
> working again. Seems like the iterator is keeping a pair
> of internal references to the currently selected pixel, and they are=20
> getting out of sync.
>=20
> BTW, can someone tell me how to get a userid and password for=20
> posting a=20
> bug using the online system?
>=20
> Thanks!
>=20
> Paul Yushkevich
> Cognitica Corporation
> pauly@cognitica.com
>=20
>=20
>=20
> _______________________________________________
> Insight-users mailing list
> Insight-users@public.kitware.com
> http://public.kitware.com/mailman/listinfo/insight-users
>=20
>=20