[vtkusers] Find the volume of Raw files in vtk

stefano mininel mininel.ml at gnbts.univ.trieste.it
Fri Apr 12 03:21:16 EDT 2002


Not checked everything, but for sure SetDataSpacing(1,1,1) is wrong.

First check the attributes of the original DICOM files.
( Sante Viewer LE for example, at
http://users.forthnet.gr/ath/mkanell/applications.html#SanteViewerLE, is
a freeware Windows DICOM viewer. Or you can use again Dicom2 to convert
into readable text. )

Find tags <0028,0030> "Pixel Spacing" and <0018,0050> "Slice Thickness"
(in truth, better you check <0020,1041> "Slice Location" as well, to see
if slice thickness is really the distance between two adiacent images).
Then do "SetDataSpacing(xPixelSpacing, yPixelSpacing, SliceDistance)".

Regards
    Stefano Mininel

P.S.: To Sebastian Barré: I'm humbly sorry!! I didn't remember Dicom2
was for Linux too.  It's a great tool! I didn't mean to underestimate
it. :-)

cspl wrote:

> Dear friends, I converted my DICOM  files into .raw files using DICOM2
> tool.After that I read the data using vtkVolume16Reader.But I am not
> getting exact volume.I have written code as follows.Total 51
> files.Image size is 512kb. vtkRenderer *ren1 = vtkRenderer::New();
> vtkRenderWindow *renWin = vtkRenderWindow::New();
> renWin->AddRenderer(ren1);
> vtkRenderWindowInteractor *iren1 = vtkRenderWindowInteractor::New();
> iren1->SetRenderWindow(renWin);
> vtkVolume16Reader *reader = vtkVolume16Reader::New();
>      reader->SetDataByteOrderToLittleEndian();
>      reader->SetFilePrefix("C:\\DicomFiles\\DownLoad\\xyz\\6554888");
>
> reader->SetFilePattern("C:\\DicomFiles\\DownLoad\\xyz\\6554888.raw");
>      reader->SetImageRange(6554888,6555788);
>      reader->SetDataSpacing(1,1,1);
>      reader->SetDataDimensions(256,256);  vtkImageActor
> *Actor=vtkImageActor::New();
>  Actor->SetInput(reader->GetOutput());
>  renWin->SetSize(300,300);
>  ren1->SetBackground(0.1, 0.2, 0.4);
>  ren1->AddActor(Actor);
>  iren1->Initialize();
>  renWin->Render();
>  SAVEIMAGE( renWin );
>  iren1->Start();
> If anybody knows pls.help me . Regards,Ramakrishna
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20020412/03754d23/attachment.htm>


More information about the vtkusers mailing list