[vtkusers] how to use vtkImageAccumulate to draw histogram of images

diaoxianfen diaoxianfen at asisz.com
Mon Jun 14 21:13:04 EDT 2004


hello every one:
     now I want to use vtkImageAccumulate to display the histogram of images ,but the result is wrong.The program as follows,
DicomReader->SetDirectoryName("E:/cochlea/DICOM/PA1/ST1/se7");
 //DicomReader->SetDataSpacing(0.412109,0.412109,1.25);
 DicomReader->SetDataExtent(0,511,0,511,0,4);

 vtkImageAccumulate*accumulate=vtkImageAccumulate::New();
 accumulate->SetInput(DicomReader->GetOutput());
 accumulate->SetComponentExtent(0,654,0,0,0,0);
 accumulate->SetComponentSpacing(100,0,0);
 //accumulate->SetComponentOrigin(0,0,0);
 accumulate->Update();
 viewer->SetInput(accumulate->GetOutput());
// viewer->SetColorWindow(6);
 //viewer->SetColorLevel(3);
 viewer->Render();
 Sleep(5000);
 accumulate->Delete();

In the file path of"E:/cochlea/DICOM/PA1/ST1/se7",
there are five images of 512*512,each pixel is 16bits.The image type is DICOM.
Is there something wrong about the parameters in the program?
The result is only a black rectangle area.Any help will be appreciated.Thanks a lot.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20040615/2b22b684/attachment.htm>


More information about the vtkusers mailing list