<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi!<br>
<br>
I am new to vtk.<br>
<br>
I am using the vtkImageImport class to view a non vtk object:<br>
<br>
importer->SetImportVoidPointer(&myAdapter->m_ImageISIS->voxel<short>(0,0,0,0));<br>
importer->SetWholeExtent(0,dimensions[0]-1,0,dimensions[1]-1,0,dimensions[2]-1);<br>
importer->SetDataExtentToWholeExtent();<br>
importer->SetDataScalarTypeToShort();<br>
importer->Update();<br>
viewer->SetInputConnection(importer->GetOutputPort());<br>
viewer->SetZSlice(100);<br>
viewer->Render();<br>
sleep(5);<br>
<br>
This works fine. The second thing i want to do is safe the data as a
vtk image and open it with paraview:<br>
<br>
vtkImageWriter* writer = vtkImageWriter::New();<br>
writer->SetFileDimensionality(3);<br>
writer->SetInputConnection(importer->GetOutputPort());<br>
writer->SetFileName("test.vtk");<br>
writer->UpdateWholeExtent();<br>
writer->Write();<br>
<br>
The file is safed, but i can not open it with paraview. There is always
a message: "a reader for ... could not be found. please choose one". <br>
And when i choose vtk image reader the message:<br>
"
<p style="margin: 0px; text-indent: 0px;"><span
style="font-family: 'Courier'; font-size: 8pt; color: rgb(128, 0, 0);">index
0: not well-formed (invalid token)</span></p>
<p
style="margin: 0px; text-indent: 0px; font-family: 'Courier'; font-size: 8pt; color: rgb(128, 0, 0);"></p>
<p
style="margin: 0px; text-indent: 0px; font-family: 'Courier'; font-size: 8pt; color: rgb(128, 0, 0);"></p>
<p style="margin: 0px; text-indent: 0px;"><span
style="font-family: 'Courier'; font-size: 8pt; color: rgb(128, 0, 0);">ERROR:
In /build/buildd/paraview-3.4.0/VTK/IO/vtkXMLReader.cxx, line 360</span></p>
<p style="margin: 0px; text-indent: 0px;"><span
style="font-family: 'Courier'; font-size: 8pt; color: rgb(128, 0, 0);">vtkXMLImageDataReader
(0x24b7720): Error parsing input file. ReadXMLInformation aborting.</span></p>
<p
style="margin: 0px; text-indent: 0px; font-family: 'Courier'; font-size: 8pt; color: rgb(128, 0, 0);"></p>
<p
style="margin: 0px; text-indent: 0px; font-family: 'Courier'; font-size: 8pt; color: rgb(128, 0, 0);"></p>
<p style="margin: 0px; text-indent: 0px;"><span
style="font-family: 'Courier'; font-size: 8pt; color: rgb(128, 0, 0);">ERROR:
In /build/buildd/paraview-3.4.0/VTK/Filtering/vtkExecutive.cxx, line 757</span></p>
<p style="margin: 0px; text-indent: 0px;"><span
style="font-family: 'Courier'; font-size: 8pt; color: rgb(128, 0, 0);">vtkCompositeDataPipeline
(0x24c2030): Algorithm vtkXMLImageDataReader(0x24b7720) returned
failure for request: vtkInformation (0x24dc890)</span></p>
<p style="margin: 0px; text-indent: 0px;"><span
style="font-family: 'Courier'; font-size: 8pt; color: rgb(128, 0, 0);">
Debug: Off</span></p>
<p style="margin: 0px; text-indent: 0px;"><span
style="font-family: 'Courier'; font-size: 8pt; color: rgb(128, 0, 0);">
Modified Time: 79214</span></p>
<p style="margin: 0px; text-indent: 0px;"><span
style="font-family: 'Courier'; font-size: 8pt; color: rgb(128, 0, 0);">
Reference Count: 1</span></p>
<p style="margin: 0px; text-indent: 0px;"><span
style="font-family: 'Courier'; font-size: 8pt; color: rgb(128, 0, 0);">
Registered Events: (none)</span></p>
<p style="margin: 0px; text-indent: 0px;"><span
style="font-family: 'Courier'; font-size: 8pt; color: rgb(128, 0, 0);">
Request: REQUEST_INFORMATION</span></p>
<p style="margin: 0px; text-indent: 0px;"><span
style="font-family: 'Courier'; font-size: 8pt; color: rgb(128, 0, 0);">
ALGORITHM_AFTER_FORWARD: 1</span></p>
<p style="margin: 0px; text-indent: 0px;"><span
style="font-family: 'Courier'; font-size: 8pt; color: rgb(128, 0, 0);">
FORWARD_DIRECTION: 0"<br>
</span></p>
<p style="margin: 0px; text-indent: 0px;"><br>
<span
style="font-family: 'Courier'; font-size: 8pt; color: rgb(128, 0, 0);"></span></p>
<p style="margin: 0px; text-indent: 0px;"><span
style="font-family: 'Courier'; font-size: 8pt; color: rgb(128, 0, 0);"><br>
</span></p>
appears.<br>
<br>
The third thing i want to do is store the data to a vtkImageData object.<br>
Is there any possibility to directly forward the vtkImageImport (or
pointer of the first element of the data array) to the vtkImageData, so
i do not have to do it voxel by voxel? Because this needs a lot of time
for big data.<br>
<br>
Thanks for your help!<br>
<br>
cheers<br>
<p style="margin: 0px; text-indent: 0px;"><span
style="font-family: 'Courier'; font-size: 8pt; color: rgb(128, 0, 0);"></span><span
style="font-family: 'Courier'; font-size: 8pt; color: rgb(128, 0, 0);"></span></p>
<p
style="margin: 0px; text-indent: 0px; font-family: 'Courier'; font-size: 8pt; color: rgb(128, 0, 0);"><!--EndFragment--></p>
</body>
</html>