[vtkusers] About a Stack of *.BMP Slices Rendering!

Koning, P.J.H. de (LKEB) P.J.H.de_Koning at lumc.nl
Mon Oct 7 09:23:24 EDT 2002

07-10-02 14:54:58, "#YAN RI AN#" <PS7278514B at ntu.edu.sg> wrote:

I Would suggest using the vtkBMPReader. Furthermore I don't think the imagevalues will go to 1150 in 8-bit BMP images. Try a value between 0 and 255.

>Dear VTK-Users:
>There was no problem when I Read in & 3D Render & Write out  *.stl Format the Headsq files which provided by Kitware Co..
>But I met the problem when I read a stack of 512x512x256 *.BMP head slice files.
>The XY boundary size of the files is 220.2mm X 220.2mm. 
>I renamed it into *.01,*.02...... already, It could read but could not rendering.
>I did not know how to pre-process,process & post process the stack of *.BMP format slices.
>Could anyone share some experience about it?
>Here is my program:
>  vtkImageReader *reader=vtkImageReader::New();
>  reader->SetFilePrefix("g:/00head/h");
>  reader->SetDataByteOrderToLittleEndian();
>  reader->SetDataExtent(0,220,0,220,1,33);
>   reader->SetDataSpacing(1,1,3);
>  reader->SetDataMask(0x7ff);
>   vtkMarchingContourFilter *iso=vtkMarchingContourFilter::New();
>    iso->SetInput(reader->GetOutput());
>    iso->SetValue(0,1150);
>  vtkPolyDataMapper *isoMapper=vtkPolyDataMapper::New();
>  isoMapper->SetInput(iso->GetOutput());
>  isoMapper->ScalarVisibilityOff();
>   vtkActor *isoActor=vtkActor::New();
>    isoActor->SetMapper(isoMapper);
>	isoActor->GetProperty()->SetColor(1,1,1);
>    vtkRenderer *ren1 = vtkRenderer::New();
>	ren1->AddActor(isoActor);
>	ren1->SetBackground(0.2,0.3,0.5);
>* Best Regards
>* Yan Rian (Research Student) 
>* Email : ps7278514b at ntu.edu.sg
>* Lab : AMRC Research Centre 
>* Nanyang Technological University 
>* Singapore 
>This is the private VTK discussion list. 
>Please keep messages on-topic. Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
>Follow this link to subscribe/unsubscribe:

More information about the vtkusers mailing list