[Insight-users] PasteImage Filter
Kannan U V
kannanuv at cshl.edu
Thu Sep 20 18:08:46 EDT 2012
Hi All,
I am trying to use PasteImageFilter on a grid of image tiles. (These
are tiles with overlap) I know the position of the tiles and I want to
paste them on to the montage. I am using pasteImage filter. When I use
the following routine and I get only the last written time in the
mosaic image and all other regions are set to zero.
Moreover if I don't do a set regions on the mosaicImage I get a write
error on image writer. I need help figuring out how it has to be run.
for (int iY = 1; iY < 2; iY++) {
for (int iX = 1; iX < 3; iX++) {
cout << "Processing tile : (" << iX << "," << iY << ")" << endl;
CreateConstantImage (tileImage, (iX + iY));
pasteFilter->SetSourceImage(tileImage);
pasteFilter->SetDestinationImage (mosaicImage);
pasteFilter->SetSourceRegion(tileImage->GetLargestPossibleRegion());
mosaicIndex1[0] = iX * 812;
mosaicIndex1[1] = iY * 812;
pasteFilter->SetDestinationIndex(mosaicIndex1);
mosaicImage = pasteFilter->GetOutput();
mosaicImage->SetRegions(region);
}
--
Thanks,
Kannan
More information about the Insight-users
mailing list