[prev in list] [next in list] [prev in thread] [next in thread]
List: vtkusers
Subject: [vtkusers] Problem on vtkImageData->CopyAndCastFrom(vtkImageData
From: "Jin Bei" <hijinbei () hotmail ! com>
Date: 2005-03-31 18:27:44
Message-ID: BAY15-F18BF0F3FC8AAD8B4A85E17CD470 () phx ! gbl
[Download RAW message or body]
Hi,
I try to get imagedata from a file, then from the whole imagedata, get a
subimage data from it. Even the whole imagedata have printed out right
extent, when I use copyandcastfrom, the error come out as
ERROR: In /home/bellet/rpm/BUILD/VTK/Common/vtkImageData.cxx, line 1576
vtkImageData (0x805b478): GetScalarPointer: Pixel (0, 0, 0) not in memory.
Current extent= (0, -1, 0, -1, 0, -1)
Generic Warning: In /home/bellet/rpm/BUILD/VTK/Common/vtkImageData.cxx,
line 1776
Scalars not allocated.
My simple source code is as below:
vtkPNGReader* reader = vtkPNGReader::New();
vtkImageData* imagedata = vtkImageData::New();
reader->SetFileName(filename);
reader->Update();
reader->GetDataExtent(sizeimag);
printf("size%d,%d,%d,%d\n", sizeimag[0],
sizeimag[1],sizeimag[2],sizeimag[3],sizeimag[4],sizeimag[5]); -->get
result 0,512,0,512,0,0
imagedata->CopyAndCastFrom(reader->GetOutput(), 0, 255, 0, 255, 0, 0);
Thank you very much!
Bei Jin
_________________________________________________________________
使用 MSN Messenger,與朋友在線上聊天: http://messenger.microsoft.com/tc
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic