Actually, the problem is probably that the pipeline is updating. You are modifying the image<br>from the reader, however, the reader is still in the pipeline. So any call to Update() may <br>overwrite your changes (the reader could read the data again).
<br><br>You can try disconnecting the imag from the reader.<br><br>this->itkImage3D = dicomReader->GetOutput();<br>this->itkImage3D->DisconnectPipeline();<br><br>this->connectorMRI->SetInput( this->itkImage3D );
<br><br><br><div><span class="gmail_quote">On 5/3/06, <b class="gmail_sendername">Yixun Liu</b> <<a href="mailto:yxliu@fudan.edu.cn">yxliu@fudan.edu.cn</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div style="direction: ltr;">
<div><font face="Bookman Old Style">Hi,</font></div>
<div><font face="Bookman Old Style"></font> </div>
<div><font face="Bookman Old Style">I build a pipeline as below,</font></div>
<div><font face="Bookman Old Style"></font> </div>
<div><font face="Bookman Old Style">//read dicom series</font></div>
<div><font face="Bookman Old Style"> this->dicomReader->SetImageIO(
itk::GDCMImageIO::New() );</font></div>
<div><font face="Bookman Old Style"> this->dicomReader->SetFileNames(
fileNames ); <br> this->dicomReader->Update();</font></div>
<div><font face="Bookman Old Style"></font> </div>
<div><font face="Bookman Old Style"> this->itkImage3D =
dicomReader->GetOutput();<br> </font></div>
<div> </div>
<div><font face="Bookman Old Style"> //convert itk image with short
type to vtk image<br> this->connectorMRI =
ConnectorType::New();<br> this->connectorMRI->SetInput(this->dicomReader->GetOutput());<br> try<br> {
<br> this->connectorMRI->Update();<br> }<br> catch(
itk::ExceptionObject & excp )<br> {<br> std::cerr <<
"Error reading the series " << std::endl;<br> std::cerr
<< excp << std::endl;<br> }<br> </font></div>
<div> </div>
<div><font face="Bookman Old Style"> //shift the image from short to
unsigned short for visualization using vtk<br> vtkImageShiftScale
*shift =
vtkImageShiftScale::New();<br> shift->SetInput(this->connectorMRI->GetOutput());<br> shift->SetScale(1);</font></div>
<div><font face="Bookman Old Style"> shift->SetOutputScalarTypeToUnsignedShort();</font></div>
<div><font face="Bookman Old Style"></font> </div>
<div><font face="Bookman Old Style">//generate a volume actor</font></div>
<div><font face="Bookman Old Style"> this->volume =
this->GenerateVolumeRenActor(shift->GetOutput());</font></div>
<div><font face="Bookman Old Style"></font> </div>
<div><font face="Bookman Old Style"></font> </div>
<div><font face="Bookman Old Style"></font> </div>
<div><font face="Bookman Old Style">Using above pipeline I can render the dicom
series correctly. However, when I change the itkImage3D, for
example,</font></div>
<div><font face="Bookman Old Style"></font> </div>
<div><font face="Bookman Old Style">short *image =
this->itkImage3D->GetBufferPointer();</font></div>
<div><font face="Bookman Old Style">ImageType_Short::RegionType region =
this->itkImage3D->GetBufferedRegion();<br>const unsigned int numberOfPixel
= region.GetNumberOfPixels();</font></div>
<div><font face="Bookman Old Style">for(int i = 0; i < numberOfPixel ;
i++)</font></div>
<div><font face="Bookman Old Style">
image[i] = i;</font></div>
<div><font face="Bookman Old Style">this->itkImage3D->Modified();</font></div>
<div><font face="Bookman Old Style"></font> </div>
<div><font face="Bookman Old Style">The pipeline can not update and the volume
is sama as the old one.</font></div>
<div><font face="Bookman Old Style">Only when I change
the vtkImage, namely the output of the shift, the volume change. I
guess the pipelien can not update although the itk filter modified.</font></div>
<div><font face="Bookman Old Style"></font> </div>
<div><font face="Bookman Old Style">Regards,</font></div></div><div style="direction: ltr;"><span class="sg">
<div> </div>
<div><font face="Bookman Old Style">Yixun Liu</font> </div>
<div><font face="Bookman Old Style"></font> </div>
<div><font face="Bookman Old Style"> </font></div>
<div><br></div>
<div><br></div>
<div><font face="Bookman Old Style"></font> </div>
</span></div><br>_______________________________________________<br>Insight-users mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:Insight-users@itk.org">Insight-users@itk.org</a><br>
<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br><br><br></blockquote></div><br>