<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6000.16481" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff><FONT face=Arial size=2>
<DIV>Hi all,</DIV>
<DIV>&nbsp;</DIV>
<DIV>I have connection problem using vtkImageData.<BR>First I will present you 
what I want to do. I work on a projet which constructs a 4-D volume from a MRI 
sequence. One of my goals is to substract 2 volumes. As I don't find an 
implemented function to do that in VTK, I try to access to the voxels of a 
volume. So I find that the vtkImageData class allows to access the data.<BR>So I 
just tried to write this line "imageData = imageCast-&gt;GetOutput();" in my 
code and I have this error while executing the program :<BR>"ERROR: In 
.\vtkDemandDrivenPipeline.cxx, line 799<BR>vtkStreamingDemandDrivenPipeline 
(04FE70A8): Input for connection index 0 on input port index 0 for algorithm 
vtkVolumeRayCastMapper(04FD14B8) is NULL, but a vtkImageData is required."</DIV>
<DIV>&nbsp;</DIV>
<DIV><BR>Here an abstract of the code :</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;vtkImageData * imageData = vtkImageData::New(); // with or without 
"New" the problem appears</DIV>
<DIV>&nbsp;</DIV>
<DIV>...</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;/// read a vtkVolume file 
///<BR>&nbsp;structuredPointReader-&gt;ReleaseDataFlagOn();<BR>&nbsp;structuredPointReader-&gt;SetReleaseDataFlag( 
true );<BR>&nbsp;structuredPointReader-&gt;SetFileName( fileName 
);<BR>&nbsp;structuredPointReader-&gt;Update();</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;imageCast-&gt;SetNumberOfThreads( 4 
);<BR>&nbsp;imageCast-&gt;SetInputConnection( 
structuredPointReader-&gt;GetOutputPort() 
);<BR>&nbsp;imageCast-&gt;SetOutputScalarTypeToUnsignedChar();</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;imageData = 
imageCast-&gt;GetOutput();<BR>&nbsp;/////////////////////////////</DIV>
<DIV>&nbsp;</DIV>
<DIV>...</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;/// MIP raycast 
///<BR>&nbsp;volumeRayCastMapper-&gt;SetVolumeRayCastFunction( MIPfunction 
);<BR>&nbsp;volumeRayCastMapper-&gt;ReleaseDataFlagOn();</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;volumeRayCastMapper-&gt;SetInput( this-&gt;imageCast-&gt;GetOutput() 
);<BR>&nbsp;//volumeRayCastMapper-&gt;SetInput( this-&gt;imageData ); // this 
line is commented in order to find the error when using imageData</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;m_lastVolumeCreated-&gt;SetMapper( volumeRayCastMapper 
);<BR>&nbsp;m_lastVolumeCreated-&gt;SetProperty( this-&gt;volumeProperty 
);<BR>&nbsp;/////////////////////////////<BR>...</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>So finally I have two questions :</DIV>
<DIV>- Why is there a connection problem in this code ?</DIV>
<DIV>- Is it the goo way to substract 2 volumes ?</DIV>
<DIV>&nbsp;</DIV>
<DIV><BR>Does somebody has any idea ?</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>Thank's in advance. ;-)</DIV>
<DIV>&nbsp;</DIV>
<DIV><BR>Gourbish.</FONT></DIV></BODY></HTML>