[Insight-users] about pipeline

Yixun Liu yxliu at fudan.edu.cn
Wed May 3 23:34:53 EDT 2006


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 






-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20060504/1c6e22e6/attachment-0001.html


More information about the Insight-users mailing list