<!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> </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->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> </DIV>
<DIV><BR>Here an abstract of the code :</DIV>
<DIV> </DIV>
<DIV> vtkImageData * imageData = vtkImageData::New(); // with or without
"New" the problem appears</DIV>
<DIV> </DIV>
<DIV>...</DIV>
<DIV> </DIV>
<DIV> /// read a vtkVolume file
///<BR> structuredPointReader->ReleaseDataFlagOn();<BR> structuredPointReader->SetReleaseDataFlag(
true );<BR> structuredPointReader->SetFileName( fileName
);<BR> structuredPointReader->Update();</DIV>
<DIV> </DIV>
<DIV> imageCast->SetNumberOfThreads( 4
);<BR> imageCast->SetInputConnection(
structuredPointReader->GetOutputPort()
);<BR> imageCast->SetOutputScalarTypeToUnsignedChar();</DIV>
<DIV> </DIV>
<DIV> imageData =
imageCast->GetOutput();<BR> /////////////////////////////</DIV>
<DIV> </DIV>
<DIV>...</DIV>
<DIV> </DIV>
<DIV> /// MIP raycast
///<BR> volumeRayCastMapper->SetVolumeRayCastFunction( MIPfunction
);<BR> volumeRayCastMapper->ReleaseDataFlagOn();</DIV>
<DIV> </DIV>
<DIV> volumeRayCastMapper->SetInput( this->imageCast->GetOutput()
);<BR> //volumeRayCastMapper->SetInput( this->imageData ); // this
line is commented in order to find the error when using imageData</DIV>
<DIV> </DIV>
<DIV> m_lastVolumeCreated->SetMapper( volumeRayCastMapper
);<BR> m_lastVolumeCreated->SetProperty( this->volumeProperty
);<BR> /////////////////////////////<BR>...</DIV>
<DIV> </DIV>
<DIV> </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> </DIV>
<DIV><BR>Does somebody has any idea ?</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>Thank's in advance. ;-)</DIV>
<DIV> </DIV>
<DIV><BR>Gourbish.</FONT></DIV></BODY></HTML>