[Insight-users] about pipeline

Jim Miller millerjv at gmail.com
Fri May 5 16:43:30 EDT 2006


Actually, the problem is probably that the pipeline is updating.  You are
modifying the  image
from the reader, however, the reader is still in the pipeline.  So any call
to Update() may
overwrite your changes (the reader could read the data again).

You can try disconnecting the imag from the reader.

this->itkImage3D  = dicomReader->GetOutput();
this->itkImage3D->DisconnectPipeline();

this->connectorMRI->SetInput( this->itkImage3D );


On 5/3/06, Yixun Liu <yxliu at fudan.edu.cn> wrote:
>
> Hi,
>
> I build a pipeline as below,
>
> //read dicom series
>  this->dicomReader->SetImageIO( itk::GDCMImageIO::New() );
>  this->dicomReader->SetFileNames( fileNames );
>  this->dicomReader->Update();
>
>  this->itkImage3D = dicomReader->GetOutput();
>
>
>  //convert itk image with short type to vtk image
>  this->connectorMRI = ConnectorType::New();
>  this->connectorMRI->SetInput(this->dicomReader->GetOutput());
>  try
>  {
>   this->connectorMRI->Update();
>  }
>  catch( itk::ExceptionObject & excp )
>  {
>   std::cerr << "Error reading the series " << std::endl;
>   std::cerr << excp << std::endl;
>  }
>
>
>  //shift the image from short to unsigned short for visualization using
> vtk
>  vtkImageShiftScale *shift = vtkImageShiftScale::New();
>  shift->SetInput(this->connectorMRI->GetOutput());
>  shift->SetScale(1);
>  shift->SetOutputScalarTypeToUnsignedShort();
>
> //generate a volume actor
>  this->volume = this->GenerateVolumeRenActor(shift->GetOutput());
>
>
>
> Using above pipeline I can render the dicom series correctly. However,
> when I change the itkImage3D, for example,
>
> short *image = this->itkImage3D->GetBufferPointer();
> ImageType_Short::RegionType region =
> this->itkImage3D->GetBufferedRegion();
> const unsigned int numberOfPixel = region.GetNumberOfPixels();
> for(int i = 0; i < numberOfPixel ; i++)
>         image[i] = i;
> this->itkImage3D->Modified();
>
> The pipeline can not update and the volume is sama as the old one.
> 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.
>
> Regards,
>
> Yixun Liu
>
>
>
>
>
>
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20060505/fd98ea62/attachment.html


More information about the Insight-users mailing list