[Insight-users] Question about setRegions
Yili Pan
pyl0420 at gmail.com
Mon Nov 9 13:49:06 EST 2009
Hi everyone:
I'm trying to get a specific slice of the volume:
index[0]=sliceNum;
ImageType::RegionType regionImg;
ImageType::IndexType start;
start[0]=0;
start[1]=0;
ImageType::SizeType sizeImg;
sizeImg[0]=size[1];
sizeImg[1]=size[2];
regionImg.SetIndex(start);
regionImg.SetSize(sizeImg););
image->SetRegions(regionImg);
image->Allocate();
Then I use getPixel and setPixel to read the pixel value of volume and set
the value of corresponding position.
This method worked, but when I tried to write it as a function, the problem
came.
The program broke at image->SetRegions(regionImg)
Could you help me with this problem? If I write it in the main function, the
whole program would be very long
Thanks a lot!!
Best,
Yili
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20091109/e6538f75/attachment.htm>
More information about the Insight-users
mailing list